aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/parserstress
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/parserstress')
-rw-r--r--tests/auto/qml/parserstress/parserstress.pro12
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Array/15.4-1.js135
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Array/15.4-2.js114
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Array/15.4.1.1.js111
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Array/15.4.1.2.js162
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Array/15.4.1.3.js84
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Array/15.4.1.js132
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Array/15.4.2.1-1.js112
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Array/15.4.2.1-2.js101
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Array/15.4.2.1-3.js137
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Array/15.4.2.2-1.js183
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Array/15.4.2.2-2.js118
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Array/15.4.2.3.js101
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Array/15.4.3.1-2.js81
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Array/15.4.3.2.js62
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Array/15.4.4.1.js63
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Array/15.4.4.2.js120
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Array/15.4.4.3-1.js163
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Array/15.4.4.4-1.js294
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Array/15.4.4.4-2.js169
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Array/15.4.4.5-1.js225
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Array/15.4.4.5-2.js227
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Array/15.4.4.5-3.js182
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Array/15.4.4.js74
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Array/15.4.5.1-1.js170
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Array/15.4.5.1-2.js152
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Array/15.4.5.2-1.js86
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Array/15.4.5.2-2.js127
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Array/browser.js0
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Array/shell.js1
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.1.js96
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.2.js161
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.3.1-1.js72
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.3.1-2.js71
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.3.1-3.js71
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.3.1-4.js75
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.3.1.js69
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.4-1.js72
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.4.1.js62
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.4.2-1.js97
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.4.2-2.js73
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.4.2-3.js65
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.4.2-4-n.js69
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.4.3-1.js88
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.4.3-2.js67
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.4.3-3.js66
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.4.3-4-n.js69
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.4.3.js83
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.4.js80
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Boolean/browser.js0
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Boolean/shell.js1
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.1.1-1.js96
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.1.1-2.js91
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma/Date/15.9.1.13-1.js79
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.2.1.js104
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.2.2-1.js69
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.2.2-2.js69
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.2.2-3.js69
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.2.2-4.js68
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.2.2-5.js68
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.2.2-6.js67
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.1-1.js239
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.1-2.js152
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.1-3.js141
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.1-4.js151
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.1-5.js140
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.2-1.js151
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.2-2.js142
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.2-3.js146
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.2-4.js143
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.2-5.js140
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.8-1.js155
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.8-2.js153
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.8-3.js160
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.8-4.js161
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.8-5.js161
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.4.2-1.js81
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.4.2.js191
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.4.3.js186
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.1.js63
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.10-1.js85
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.10-10.js89
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.10-11.js89
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.10-12.js89
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.10-13.js89
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.10-2.js87
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.10-3.js85
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.10-4.js85
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.10-5.js85
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.10-6.js85
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.10-7.js85
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.10-8.js89
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.10-9.js89
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.11-1.js76
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.11-2.js76
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.11-3.js76
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.11-4.js76
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.11-5.js76
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.11-6.js76
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.11-7.js76
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.12-1.js77
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.12-2.js77
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.12-3.js77
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.12-4.js77
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.12-5.js77
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.12-6.js77
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.12-7.js77
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.12-8.js71
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.13-1.js79
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.13-2.js76
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.13-3.js77
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.13-4.js77
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.13-5.js77
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.13-6.js77
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.13-7.js76
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.13-8.js71
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.14.js87
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.15.js88
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.16.js87
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.17.js88
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.18.js88
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.19.js88
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.2-1.js151
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.2-2-n.js84
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.2.js151
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.20.js88
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.21-1.js70
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.21-2.js70
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.21-3.js70
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.21-4.js70
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.21-5.js70
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.21-6.js70
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.21-7.js70
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.21-8.js71
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.22-1.js89
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.22-2.js74
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.22-3.js74
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.22-4.js74
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.22-5.js74
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.22-6.js74
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.22-7.js74
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.22-8.js72
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-1.js139
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-10.js139
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-11.js140
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-12.js137
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-13.js137
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-14.js137
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-15.js137
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-16.js137
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-17.js137
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-18.js137
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-2.js109
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-3-n.js79
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-4.js112
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-5.js113
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-6.js112
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-7.js113
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-8.js103
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-9.js103
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.24-1.js134
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.24-2.js134
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.24-3.js134
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.24-4.js134
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.24-5.js134
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.24-6.js134
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.24-7.js134
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.24-8.js133
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.25-1.js174
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.26-1.js183
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.27-1.js183
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.28-1.js196
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.29-1.js191
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.3-1-n.js80
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.3-2.js104
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.30-1.js192
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.31-1.js221
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.32-1.js141
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.33-1.js145
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.34-1.js182
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.35-1.js139
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.36-1.js165
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.36-2.js164
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.36-3.js163
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.36-4.js163
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.36-5.js163
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.36-6.js163
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.36-7.js163
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.37-1.js173
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.37-2.js161
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.37-3.js164
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.37-4.js163
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.37-5.js159
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.4-1.js93
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.4-2-n.js76
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.5.js112
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.6.js104
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.7.js105
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.8.js113
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.9.js113
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.js83
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/browser.js0
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Date/shell.js1
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.3-1.js107
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.3-2.js73
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.3.js170
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-1.js111
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-10.js105
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-2.js113
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-3.js111
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-4.js113
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-5.js112
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-6.js100
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-7.js112
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-8.js113
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.5-1.js118
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.5-2.js100
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.5-3.js130
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.5-4.js91
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.8-2.js120
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.8-3.js66
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.2.1.js85
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.2.2-1.js122
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.2.2-2.js133
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.2.3-1.js86
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.2.3-2.js92
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/browser.js0
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/shell.js1
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.1.1.js137
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.10-1.js270
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.10-2.js269
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.10-3.js268
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.12-1.js110
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.12-2-n.js74
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.12-3.js71
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.12-4.js71
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.13.1.js72
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.13.2-1.js231
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.13.2-2.js253
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.13.2-3.js300
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.13.2-4.js137
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.13.2-5.js137
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.13.js86
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.14-1.js73
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.1-1.js272
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.1-2.js128
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.1-3-n.js128
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.1-4-n.js128
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.1-5.js128
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.2-1-n.js104
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.2-1.js100
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.2-10-n.js102
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.2-11.js104
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.2-2-n.js104
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.2-3-n.js100
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.2-4-n.js104
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.2-5-n.js104
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.2-6-n.js103
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.2-7-n.js104
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.2-8-n.js104
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.2-9-n.js104
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.3-1.js125
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.3-2-n.js94
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.3-3-n.js91
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.3-4-n.js91
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.3-5.js85
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.3.1.js153
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.3.2.js153
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.4.1.js92
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.4.2.js83
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.4.3.js111
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.4.4.js156
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.4.5.js154
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.4.6.js299
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.4.7-01.js299
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.4.7-02.js87
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.4.8.js215
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.4.9.js94
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.5.1.js115
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.5.2.js154
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.5.3.js161
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.6.1-1.js160
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.6.1-2.js164
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.6.1-3.js150
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.6.2-1.js165
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.6.3.js115
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.7.1.js228
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.7.2.js246
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.7.3.js230
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.8.1.js121
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.8.2.js121
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.8.3.js120
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.8.4.js121
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.9.1.js159
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.9.2.js159
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/11.9.3.js159
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/browser.js0
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Expressions/shell.js1
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.1.1-1.js136
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.1.1-2.js183
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.1.1-3.js99
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.2.1-1.js132
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.2.1-2.js107
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.2.1-3.js95
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.3.1-2.js70
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.3.1-3.js79
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.3.1-4.js70
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.3.2.js62
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.4-1.js94
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.4.1.js61
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.4.js81
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.5-1.js117
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.5-2.js90
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.5.1.js83
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.5.3.js72
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/FunctionObjects/browser.js0
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/FunctionObjects/shell.js1
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1-1-n.js70
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1-2-n.js67
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.1.1.js63
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.1.2.js62
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.1-2.js66
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.2-1.js410
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.2-2.js238
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.3-1.js441
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.3-2.js291
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.4.js205
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.5-1.js206
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.5-2.js183
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.5-3.js207
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.6.js125
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.7.js130
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/GlobalObject/browser.js0
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/GlobalObject/shell.js1
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.1-1.js82
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.1-2.js73
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.1-3.js89
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.2-1.js73
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.2-2-n.js74
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.2-3-n.js74
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.2-4-n.js73
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.2-5-n.js72
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.2-6.js68
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.3-1.js92
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.3-10.js65
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.3-11.js66
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.3-12.js64
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.3-13-n.js66
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.3-2.js65
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.3-3.js65
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.3-4.js65
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.3-5.js65
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.3-6.js65
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.3-7.js66
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.3-8.js65
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.3-9.js65
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.1-1-n.js71
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.1-2-n.js71
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.1-3-n.js69
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-1-n.js77
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-10-n.js77
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-11-n.js77
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-12-n.js77
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-13-n.js77
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-14-n.js77
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-15-n.js77
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-16-n.js77
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-2-n.js77
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-3-n.js77
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-4-n.js77
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-5-n.js77
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-6-n.js77
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-7-n.js75
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-8-n.js76
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-9-n.js77
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-1-n.js71
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-10-n.js71
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-11-n.js71
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-12-n.js71
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-13-n.js71
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-14-n.js97
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-15-n.js97
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-16-n.js88
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-2-n.js71
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-3-n.js71
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-4-n.js96
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-5-n.js71
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-6-n.js71
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-7-n.js97
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-8-n.js71
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-9-n.js98
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.5-1.js62
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.5-10-n.js64
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.5-2-n.js64
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.5-3-n.js64
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.5-4-n.js64
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.5-5-n.js64
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.5-6.js61
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.5-7.js61
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.5-8-n.js64
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.5-9-n.js64
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.6.js313
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.1.js64
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.2.js71
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3-1.js198
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3-2.js93
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3.js331
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.4.js269
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.8.2-n.js63
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/browser.js0
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/LexicalConventions/shell.js1
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/15.8-2-n.js82
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/15.8-3-n.js81
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.1-1.js64
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.1-2.js69
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.2-1.js64
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.2-2.js70
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.3-1.js65
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.3-2.js72
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.4-1.js65
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.4-2.js69
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.5-1.js66
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.5-2.js70
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.6-1.js65
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.6-2.js70
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.7-1.js65
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.7-2.js70
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.8-1.js65
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.8-2.js69
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.8-3.js63
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.js149
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.1.js226
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.10.js153
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.11.js200
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.12.js177
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.13.js385
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.14.js79
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.15.js202
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.16.js132
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.17.js217
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.18.js165
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.2.js151
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.3.js158
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.4.js156
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.5.js244
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.6.js232
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.7.js283
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.8.js134
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.9.js191
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/browser.js0
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Math/shell.js1
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/NativeObjects/browser.js0
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/NativeObjects/shell.js1
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Number/15.7.1.js88
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Number/15.7.2.js168
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.1-1.js71
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.1-2.js71
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.1-3.js67
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.2-1.js65
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.2-2.js70
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.2-3.js67
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.2-4.js64
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.3-1.js68
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.3-2.js73
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.3-3.js64
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.3-4.js66
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.4-1.js66
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.4-2.js71
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.4-3.js65
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.4-4.js66
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.5-1.js64
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.5-2.js70
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.5-3.js65
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.5-4.js66
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.6-1.js65
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.6-2.js69
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.6-3.js65
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.6-4.js66
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.js69
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Number/15.7.4-1.js60
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Number/15.7.4.1.js62
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Number/15.7.4.2-1.js111
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Number/15.7.4.2-2-n.js76
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Number/15.7.4.2-3-n.js73
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Number/15.7.4.2-4.js70
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Number/15.7.4.3-1.js97
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Number/15.7.4.3-2.js65
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Number/15.7.4.3-3-n.js72
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Number/browser.js0
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Number/shell.js1
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ObjectObjects/15.2.1.1.js146
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ObjectObjects/15.2.1.2.js81
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ObjectObjects/15.2.2.1.js138
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ObjectObjects/15.2.2.2.js74
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ObjectObjects/15.2.3-1.js64
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ObjectObjects/15.2.3.1-1.js69
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ObjectObjects/15.2.3.1-2.js70
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ObjectObjects/15.2.3.1-3.js70
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ObjectObjects/15.2.3.1-4.js70
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ObjectObjects/15.2.3.js67
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ObjectObjects/15.2.4.1.js64
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ObjectObjects/15.2.4.2.js130
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ObjectObjects/15.2.4.3.js117
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ObjectObjects/browser.js0
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/ObjectObjects/shell.js1
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma/README1
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/SourceText/6-1.js128
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/SourceText/6-2.js131
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/SourceText/browser.js0
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/SourceText/shell.js1
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Statements/12.10-1.js151
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Statements/12.10.js61
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Statements/12.2-1.js74
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Statements/12.5-1.js102
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Statements/12.5-2.js99
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Statements/12.6.1-1.js74
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Statements/12.6.2-1.js75
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Statements/12.6.2-2.js76
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Statements/12.6.2-3.js72
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Statements/12.6.2-4.js72
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Statements/12.6.2-5.js73
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Statements/12.6.2-6.js75
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Statements/12.6.2-7.js73
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Statements/12.6.2-8.js71
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Statements/12.6.2-9-n.js76
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Statements/12.6.3-1.js63
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Statements/12.6.3-10.js115
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Statements/12.6.3-11.js98
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Statements/12.6.3-12.js103
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Statements/12.6.3-19.js117
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Statements/12.6.3-2.js63
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Statements/12.6.3-3.js73
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Statements/12.6.3-4.js202
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Statements/12.6.3-5-n.js110
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Statements/12.6.3-6-n.js109
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Statements/12.6.3-7-n.js110
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Statements/12.6.3-8-n.js110
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Statements/12.6.3-9-n.js109
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Statements/12.7-1-n.js64
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Statements/12.8-1-n.js67
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Statements/12.9-1-n.js63
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Statements/browser.js0
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Statements/shell.js1
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.1.js134
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.2.js110
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.3.1-1.js71
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.3.1-2.js69
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.3.1-3.js66
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.3.1-4.js66
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.3.2-1.js190
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.3.2-2.js77
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.3.2-3.js121
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.3.js66
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.4.1.js63
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.4.10-1.js217
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.4.11-1.js518
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.4.11-2.js515
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.4.11-3.js514
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.4.11-4.js507
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.4.11-5.js520
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.4.11-6.js516
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.4.12-1.js520
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.4.12-2.js518
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.4.12-3.js559
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.4.12-4.js515
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.4.12-5.js515
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.4.2-1.js72
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.4.2-2-n.js73
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.4.2-3.js83
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.4.2.js87
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.4.3-1.js72
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.4.3-2.js90
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.4.3-3-n.js72
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.4.4-1.js92
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.4.4-2.js136
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.4.4-3.js112
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.4.4-4.js124
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.4.5-1.js87
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.4.5-2.js121
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.4.5-3.js131
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.4.5-4.js75
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.4.5-5.js106
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.4.6-1.js155
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.4.6-2.js259
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.4.7-1.js219
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.4.7-2.js217
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.4.8-1.js232
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.4.8-2.js247
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.4.8-3.js204
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.4.9-1.js202
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.4.js108
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/15.5.5.1.js88
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/browser.js0
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/String/shell.js1
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.2.js138
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3-1.js100
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3.1-1.js323
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3.1-2.js87
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3.1-3.js743
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3.js87
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.4-1.js112
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.4-2.js112
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.5-2.js173
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.6.js140
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.7.js160
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.8.1.js167
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.9-1.js119
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/TypeConversion/browser.js0
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/TypeConversion/shell.js1
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Types/8.1.js75
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Types/8.4.js130
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Types/8.6.2.1-1.js78
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Types/browser.js0
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/Types/shell.js1
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/browser.js62
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/extensions/10.1.4-9.js110
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/extensions/10.1.6.js127
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/extensions/10.1.8-1.js135
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/extensions/11.6.1-1.js145
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/extensions/11.6.1-2.js136
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/extensions/11.6.1-3.js137
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/extensions/11.6.2-1.js124
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/extensions/15-1.js94
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/extensions/15-2.js77
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/extensions/15.1.2.1-1.js88
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/extensions/15.2.1.1.js82
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/extensions/15.2.3-1.js64
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/extensions/15.2.4.js66
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/extensions/15.3.1.1-1.js82
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/extensions/15.3.1.1-2.js82
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/extensions/15.3.2.1-1.js72
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/extensions/15.3.2.1-2.js72
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/extensions/15.3.3.1-1.js67
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/extensions/15.4.3.js63
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/extensions/15.5.3.js66
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/extensions/15.5.4.2.js59
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/extensions/15.5.4.4-4.js107
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/extensions/15.5.4.5-6.js94
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/extensions/15.5.4.7-3.js161
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/extensions/15.6.3.1-5.js58
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/extensions/15.6.3.js65
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/extensions/15.6.4-2.js66
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/extensions/15.7.3.js69
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/extensions/15.7.4.js90
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/extensions/15.8-1.js84
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/extensions/15.9.5.js76
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/extensions/8.6.2.1-1.js98
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/extensions/9.9-1.js102
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/extensions/browser.js0
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/extensions/shell.js1
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/jsref.js634
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/shell.js577
-rw-r--r--tests/auto/qml/parserstress/tests/ecma/template.js70
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/boolean-001.js80
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/boolean-002.js84
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/browser.js0
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/date-001.js93
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/date-002.js87
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/date-003.js89
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/date-004.js83
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/exception-001.js78
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/exception-002.js78
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/exception-003.js82
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/exception-004.js78
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/exception-005.js78
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/exception-006.js89
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/exception-007.js90
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/exception-008.js77
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/exception-009.js86
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/exception-010-n.js61
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/exception-011-n.js62
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-001.js83
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-002.js93
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-003.js88
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-004.js82
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-005.js74
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-006.js79
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-007.js77
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-008.js74
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-009.js75
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-010.js76
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-011.js76
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-012.js77
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-013.js77
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-014.js79
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-015.js73
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-016.js73
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-017.js73
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-019.js77
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/function-001.js86
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/global-001.js78
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/global-002.js78
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-001.js85
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-002.js85
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-003.js76
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-004.js85
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-005.js85
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-006.js91
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-007.js84
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-008.js86
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-009.js86
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-010.js84
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-011.js95
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-012.js86
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-013.js86
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-014.js95
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-015.js86
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-016.js95
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-017.js87
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-018.js86
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-019.js86
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-020.js86
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-021.js95
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-022.js86
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-023.js85
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-024.js92
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-025.js92
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-026.js92
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-027.js94
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-028.js92
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-029.js92
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-030.js92
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-031.js92
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-032.js92
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-033.js92
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-034.js91
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-035.js92
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-036.js92
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-037.js92
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-038.js92
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-039.js79
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-040.js79
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-041.js81
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-042.js82
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-047.js83
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-048.js77
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-049.js82
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-050.js78
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-051.js78
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-052.js80
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-053.js78
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-054.js79
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/number-001.js86
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/number-002.js81
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/number-003.js83
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/shell.js1
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/statement-001.js80
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/statement-002.js102
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/statement-003.js113
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/statement-004.js85
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/statement-005.js84
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/statement-006.js84
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/statement-007.js75
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/statement-008.js75
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/statement-009.js74
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/string-001.js86
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Exceptions/string-002.js85
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Expressions/StrictEquality-001.js106
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Expressions/browser.js0
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Expressions/shell.js1
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/FunctionObjects/apply-001-n.js65
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/FunctionObjects/browser.js0
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/FunctionObjects/call-1.js75
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/FunctionObjects/shell.js1
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/LexicalConventions/browser.js0
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/LexicalConventions/keywords-001.js81
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/LexicalConventions/regexp-literals-001.js77
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/LexicalConventions/regexp-literals-002.js61
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/LexicalConventions/shell.js1
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_2/README1
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/RegExp/browser.js0
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/RegExp/constructor-001.js99
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/RegExp/exec-001.js73
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/RegExp/exec-002.js221
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/RegExp/function-001.js99
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/RegExp/hex-001.js102
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/RegExp/multiline-001.js101
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/RegExp/octal-001.js111
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/RegExp/octal-002.js126
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/RegExp/octal-003.js120
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/RegExp/properties-001.js124
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/RegExp/properties-002.js162
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/RegExp/regexp-enumerate-001.js121
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/RegExp/regress-001.js78
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/RegExp/shell.js1
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/RegExp/unicode-001.js92
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Statements/browser.js0
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Statements/dowhile-001.js77
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Statements/dowhile-002.js104
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Statements/dowhile-003.js96
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Statements/dowhile-004.js100
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Statements/dowhile-005.js106
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Statements/dowhile-006.js122
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Statements/dowhile-007.js130
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Statements/forin-001.js330
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Statements/forin-002.js109
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Statements/if-001.js75
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Statements/label-001.js75
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Statements/label-002.js89
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Statements/shell.js1
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Statements/switch-001.js98
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Statements/switch-002.js96
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Statements/switch-003.js90
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Statements/switch-004.js127
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Statements/try-001.js118
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Statements/try-003.js115
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Statements/try-004.js87
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Statements/try-005.js90
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Statements/try-006.js120
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Statements/try-007.js125
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Statements/try-008.js92
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Statements/try-009.js99
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Statements/try-010.js106
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Statements/try-012.js128
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Statements/while-001.js75
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Statements/while-002.js119
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Statements/while-003.js120
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/Statements/while-004.js250
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/String/browser.js0
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/String/match-001.js139
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/String/match-002.js207
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/String/match-003.js165
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/String/match-004.js206
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/String/replace-001.js99
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/String/shell.js1
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/String/split-001.js145
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/String/split-002.js303
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/String/split-003.js156
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/browser.js37
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/extensions/browser.js0
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_2/extensions/constructor-001.js74
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_2/extensions/function-001.js74
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_2/extensions/instanceof-001.js144
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_2/extensions/instanceof-002.js160
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_2/extensions/instanceof-003-n.js121
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_2/extensions/instanceof-004-n.js121
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_2/extensions/instanceof-005-n.js122
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_2/extensions/instanceof-006.js119
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/extensions/shell.js1
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/instanceof/browser.js0
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/instanceof/instanceof-001.js67
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/instanceof/instanceof-002.js84
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/instanceof/instanceof-003.js98
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/instanceof/regress-7635.js88
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/instanceof/shell.js1
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/jsref.js591
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/shell.js51
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_2/template.js57
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Array/15.4.4.11-01.js61
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Array/15.4.4.3-1.js88
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Array/15.4.4.4-001.js153
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Array/15.4.5.1-01.js93
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Array/browser.js0
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Array/regress-101488.js172
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Array/regress-130451.js219
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Array/regress-322135-01.js73
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Array/regress-322135-02.js65
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Array/regress-322135-03.js73
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Array/regress-322135-04.js71
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Array/regress-387501.js94
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Array/regress-421325.js67
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Array/regress-430717.js65
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Array/shell.js1
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Date/15.9.1.2-01.js62
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Date/15.9.3.2-1.js91
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Date/15.9.4.3.js233
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Date/15.9.5.3.js152
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Date/15.9.5.4.js185
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Date/15.9.5.5-02.js88
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Date/15.9.5.5.js144
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Date/15.9.5.6.js153
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Date/15.9.5.7.js142
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Date/browser.js37
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Date/shell.js564
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Exceptions/15.11.1.1.js137
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Exceptions/15.11.4.4-1.js174
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Exceptions/15.11.7.6-001.js130
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Exceptions/15.11.7.6-002.js132
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Exceptions/15.11.7.6-003.js132
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Exceptions/binding-001.js128
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Exceptions/browser.js0
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Exceptions/regress-181654.js155
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Exceptions/regress-181914.js194
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Exceptions/regress-58946.js71
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Exceptions/regress-95101.js118
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Exceptions/shell.js1
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/10.1.3-1.js201
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/10.1.3-2.js70
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/10.1.3.js73
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/10.1.4-1.js85
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/10.6.1-01.js136
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/browser.js0
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/regress-23346.js71
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/regress-448595-01.js91
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/shell.js1
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Expressions/11.10-01.js76
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Expressions/11.10-02.js76
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Expressions/11.10-03.js76
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Expressions/11.6.1-1.js176
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Expressions/11.7.1-01.js76
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Expressions/11.7.2-01.js76
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Expressions/11.7.3-01.js76
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Expressions/11.9.6-1.js213
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Expressions/browser.js0
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Expressions/shell.js1
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/FunExpr/browser.js0
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/FunExpr/fe-001-n.js58
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/FunExpr/fe-001.js57
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/FunExpr/fe-002.js61
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/FunExpr/shell.js1
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Function/15.3.4.3-1.js210
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Function/15.3.4.4-1.js185
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Function/arguments-001.js169
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Function/arguments-002.js73
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Function/browser.js0
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Function/call-001.js153
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Function/regress-131964.js196
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Function/regress-137181.js113
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Function/regress-193555.js136
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Function/regress-313570.js63
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Function/regress-49286.js137
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Function/regress-58274.js226
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Function/regress-85880.js173
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Function/regress-94506.js163
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Function/regress-97921.js152
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Function/scope-001.js265
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Function/scope-002.js245
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Function/shell.js1
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/LexicalConventions/7.9.1.js157
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/LexicalConventions/browser.js0
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/LexicalConventions/shell.js1
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Number/15.7.4.2-01.js77
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Number/15.7.4.3-01.js69
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Number/15.7.4.3-02.js53
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Number/15.7.4.5-1.js145
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Number/15.7.4.6-1.js134
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Number/15.7.4.7-1.js139
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Number/15.7.4.7-2.js72
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Number/browser.js0
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Number/regress-442242-01.js62
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Number/shell.js1
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/NumberFormatting/browser.js0
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/NumberFormatting/shell.js1
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/NumberFormatting/tostring-001.js60
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Object/8.6.1-01.js113
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Object/8.6.2.6-001.js113
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Object/browser.js7
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Object/class-001.js156
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Object/class-002.js146
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Object/class-003.js139
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Object/class-004.js139
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Object/class-005.js124
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Object/regress-361274.js66
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Object/regress-385393-07.js67
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Object/regress-72773.js97
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Object/regress-79129-001.js80
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Object/shell.js105
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Operators/11.13.1-001.js152
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Operators/11.13.1-002.js57
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Operators/11.4.1-001.js120
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Operators/11.4.1-002.js72
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Operators/browser.js0
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Operators/order-01.js108
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Operators/shell.js1
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/README1
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/15.10.2-1.js181
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/RegExp/15.10.2.12.js63
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/15.10.3.1-1.js136
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/15.10.3.1-2.js144
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/15.10.4.1-1.js127
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/15.10.4.1-2.js133
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/15.10.4.1-3.js139
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/15.10.4.1-4.js146
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/15.10.4.1-5-n.js139
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/15.10.6.2-1.js140
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/15.10.6.2-2.js367
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/browser.js0
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/octal-001.js136
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/octal-002.js218
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/perlstress-001.js3230
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/perlstress-002.js1842
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-100199.js307
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-105972.js157
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-119909.js92
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-122076.js110
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-123437.js112
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-165353.js122
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-169497.js105
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-169534.js95
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-187133.js142
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-188206.js219
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-191479.js198
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-202564.js101
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-209067.js1106
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-209919.js174
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-216591.js117
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-220367-001.js104
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-223273.js279
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-223535.js133
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-224676.js232
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-225289.js176
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-225343.js125
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-24712.js59
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-285219.js51
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-28686.js57
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-289669.js88
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-307456.js54
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-309840.js58
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-311414.js101
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-312351.js50
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-31316.js96
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-330684.js53
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-334158.js58
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-346090.js63
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-367888.js62
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-375642.js61
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-375711.js118
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-375715-01-n.js63
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-375715-02.js60
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-375715-03.js60
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-375715-04.js68
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-57572.js150
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-57631.js152
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-67773.js211
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-72964.js121
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-76683.js114
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-78156.js123
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-85721.js276
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-87231.js145
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-98306.js99
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/RegExp/shell.js266
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Regress/browser.js0
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Regress/regress-385393-04.js66
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Regress/regress-419152.js90
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Regress/regress-420087.js64
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Regress/regress-420610.js50
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Regress/regress-441477-01.js73
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Regress/shell.js1
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Statements/12.6.3.js80
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Statements/browser.js0
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-121744.js217
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-131348.js184
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-157509.js111
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-194364.js152
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-226517.js112
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Statements/regress-302439.js1368
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Statements/regress-324650.js5461
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-74474-001.js139
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-74474-002.js9097
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-74474-003.js9099
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-83532-001.js71
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-83532-002.js74
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Statements/shell.js1
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Statements/switch-001.js143
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/String/15.5.4.11.js532
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/String/15.5.4.14.js50
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/String/browser.js0
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/String/regress-104375.js116
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/String/regress-189898.js157
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/String/regress-304376.js68
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/String/regress-313567.js56
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/String/regress-392378.js77
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/String/regress-83293.js216
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/String/shell.js1
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Unicode/browser.js0
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Unicode/regress-352044-01.js72
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/Unicode/regress-352044-02-n.js72
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Unicode/shell.js1
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Unicode/uc-001-n.js62
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Unicode/uc-001.js56
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Unicode/uc-002-n.js55
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Unicode/uc-002.js60
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Unicode/uc-003.js71
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Unicode/uc-004.js65
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/Unicode/uc-005.js276
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/browser.js36
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/extensions/10.1.3-2.js162
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/extensions/7.9.1.js83
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/extensions/browser.js0
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/extensions/regress-103087.js178
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/extensions/regress-188206-01.js108
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/extensions/regress-188206-02.js158
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/extensions/regress-220367-002.js112
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/extensions/regress-228087.js352
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/extensions/regress-274152.js83
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/extensions/regress-320854.js53
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/extensions/regress-327170.js58
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/extensions/regress-368516.js78
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/extensions/regress-385393-03.js63
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/extensions/regress-429248.js67
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/extensions/regress-430740.js72
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/extensions/shell.js266
-rw-r--r--tests/auto/qml/parserstress/tests/ecma_3/shell.js40
-rwxr-xr-xtests/auto/qml/parserstress/tests/ecma_3/template.js59
-rw-r--r--tests/auto/qml/parserstress/tests/shell.js886
-rw-r--r--tests/auto/qml/parserstress/tst_parserstress.cpp154
1096 files changed, 149723 insertions, 0 deletions
diff --git a/tests/auto/qml/parserstress/parserstress.pro b/tests/auto/qml/parserstress/parserstress.pro
new file mode 100644
index 0000000000..3cf3e02e4e
--- /dev/null
+++ b/tests/auto/qml/parserstress/parserstress.pro
@@ -0,0 +1,12 @@
+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 qml-private testlib
diff --git a/tests/auto/qml/parserstress/tests/ecma/Array/15.4-1.js b/tests/auto/qml/parserstress/tests/ecma/Array/15.4-1.js
new file mode 100644
index 0000000000..b73ca2df71
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Array/15.4-1.js
@@ -0,0 +1,135 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Array/15.4-2.js b/tests/auto/qml/parserstress/tests/ecma/Array/15.4-2.js
new file mode 100644
index 0000000000..7d00703d30
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Array/15.4-2.js
@@ -0,0 +1,114 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Array/15.4.1.1.js b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.1.1.js
new file mode 100644
index 0000000000..b894433d01
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.1.1.js
@@ -0,0 +1,111 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Array/15.4.1.2.js b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.1.2.js
new file mode 100644
index 0000000000..7e2e7ef436
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.1.2.js
@@ -0,0 +1,162 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Array/15.4.1.3.js b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.1.3.js
new file mode 100644
index 0000000000..b36f339966
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.1.3.js
@@ -0,0 +1,84 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Array/15.4.1.js b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.1.js
new file mode 100644
index 0000000000..414c901926
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.1.js
@@ -0,0 +1,132 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Array/15.4.2.1-1.js b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.2.1-1.js
new file mode 100644
index 0000000000..986684e338
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.2.1-1.js
@@ -0,0 +1,112 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Array/15.4.2.1-2.js b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.2.1-2.js
new file mode 100644
index 0000000000..9e957cbb21
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.2.1-2.js
@@ -0,0 +1,101 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Array/15.4.2.1-3.js b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.2.1-3.js
new file mode 100644
index 0000000000..4d1806d9b8
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.2.1-3.js
@@ -0,0 +1,137 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Array/15.4.2.2-1.js b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.2.2-1.js
new file mode 100644
index 0000000000..255d0b5fb4
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.2.2-1.js
@@ -0,0 +1,183 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Array/15.4.2.2-2.js b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.2.2-2.js
new file mode 100644
index 0000000000..e77ba8d876
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.2.2-2.js
@@ -0,0 +1,118 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Array/15.4.2.3.js b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.2.3.js
new file mode 100644
index 0000000000..27d9bd257b
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.2.3.js
@@ -0,0 +1,101 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Array/15.4.3.1-2.js b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.3.1-2.js
new file mode 100644
index 0000000000..36c1967f16
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.3.1-2.js
@@ -0,0 +1,81 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Array/15.4.3.2.js b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.3.2.js
new file mode 100644
index 0000000000..dfb47ca284
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.3.2.js
@@ -0,0 +1,62 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Array/15.4.4.1.js b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.4.1.js
new file mode 100644
index 0000000000..bd886b0cb0
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.4.1.js
@@ -0,0 +1,63 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Array/15.4.4.2.js b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.4.2.js
new file mode 100644
index 0000000000..d0be6bd471
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.4.2.js
@@ -0,0 +1,120 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Array/15.4.4.3-1.js b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.4.3-1.js
new file mode 100644
index 0000000000..ff97512a44
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.4.3-1.js
@@ -0,0 +1,163 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Array/15.4.4.4-1.js b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.4.4-1.js
new file mode 100644
index 0000000000..503d7e635e
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.4.4-1.js
@@ -0,0 +1,294 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Array/15.4.4.4-2.js b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.4.4-2.js
new file mode 100644
index 0000000000..a9b7b0ec14
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.4.4-2.js
@@ -0,0 +1,169 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Array/15.4.4.5-1.js b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.4.5-1.js
new file mode 100644
index 0000000000..a3a521da09
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.4.5-1.js
@@ -0,0 +1,225 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Array/15.4.4.5-2.js b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.4.5-2.js
new file mode 100644
index 0000000000..301c435d15
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.4.5-2.js
@@ -0,0 +1,227 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Array/15.4.4.5-3.js b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.4.5-3.js
new file mode 100644
index 0000000000..984d2fe80a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.4.5-3.js
@@ -0,0 +1,182 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Array/15.4.4.js b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.4.js
new file mode 100644
index 0000000000..2ab2072098
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.4.js
@@ -0,0 +1,74 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Array/15.4.5.1-1.js b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.5.1-1.js
new file mode 100644
index 0000000000..090300d59b
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.5.1-1.js
@@ -0,0 +1,170 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Array/15.4.5.1-2.js b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.5.1-2.js
new file mode 100644
index 0000000000..2966a00456
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.5.1-2.js
@@ -0,0 +1,152 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Array/15.4.5.2-1.js b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.5.2-1.js
new file mode 100644
index 0000000000..ff15f9d4e8
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.5.2-1.js
@@ -0,0 +1,86 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Array/15.4.5.2-2.js b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.5.2-2.js
new file mode 100644
index 0000000000..56a400ab49
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Array/15.4.5.2-2.js
@@ -0,0 +1,127 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Array/browser.js b/tests/auto/qml/parserstress/tests/ecma/Array/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Array/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma/Array/shell.js b/tests/auto/qml/parserstress/tests/ecma/Array/shell.js
new file mode 100644
index 0000000000..9480d9e77d
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Array/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'Array';
diff --git a/tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.1.js b/tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.1.js
new file mode 100644
index 0000000000..b698cbe407
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.1.js
@@ -0,0 +1,96 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Boolean/15.6.2.js b/tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.2.js
new file mode 100644
index 0000000000..f9fccb3e57
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.2.js
@@ -0,0 +1,161 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Boolean/15.6.3.1-1.js b/tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.3.1-1.js
new file mode 100644
index 0000000000..0be8097487
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.3.1-1.js
@@ -0,0 +1,72 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Boolean/15.6.3.1-2.js b/tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.3.1-2.js
new file mode 100644
index 0000000000..5d435982d4
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.3.1-2.js
@@ -0,0 +1,71 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Boolean/15.6.3.1-3.js b/tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.3.1-3.js
new file mode 100644
index 0000000000..0f1b125267
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.3.1-3.js
@@ -0,0 +1,71 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Boolean/15.6.3.1-4.js b/tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.3.1-4.js
new file mode 100644
index 0000000000..822750308a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.3.1-4.js
@@ -0,0 +1,75 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Boolean/15.6.3.1.js b/tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.3.1.js
new file mode 100644
index 0000000000..ca808c63a5
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.3.1.js
@@ -0,0 +1,69 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Boolean/15.6.4-1.js b/tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.4-1.js
new file mode 100644
index 0000000000..584562b2a8
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.4-1.js
@@ -0,0 +1,72 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Boolean/15.6.4.1.js b/tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.4.1.js
new file mode 100644
index 0000000000..3b75fb49ec
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.4.1.js
@@ -0,0 +1,62 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Boolean/15.6.4.2-1.js b/tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.4.2-1.js
new file mode 100644
index 0000000000..54bd2e19d3
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.4.2-1.js
@@ -0,0 +1,97 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Boolean/15.6.4.2-2.js b/tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.4.2-2.js
new file mode 100644
index 0000000000..2039004472
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.4.2-2.js
@@ -0,0 +1,73 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Boolean/15.6.4.2-3.js b/tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.4.2-3.js
new file mode 100644
index 0000000000..4dcc65f21f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.4.2-3.js
@@ -0,0 +1,65 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Boolean/15.6.4.2-4-n.js b/tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.4.2-4-n.js
new file mode 100644
index 0000000000..0dd3e5f349
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.4.2-4-n.js
@@ -0,0 +1,69 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Boolean/15.6.4.3-1.js b/tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.4.3-1.js
new file mode 100644
index 0000000000..8b913e011e
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.4.3-1.js
@@ -0,0 +1,88 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Boolean/15.6.4.3-2.js b/tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.4.3-2.js
new file mode 100644
index 0000000000..5548a7874f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.4.3-2.js
@@ -0,0 +1,67 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Boolean/15.6.4.3-3.js b/tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.4.3-3.js
new file mode 100644
index 0000000000..f05dfc0c60
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.4.3-3.js
@@ -0,0 +1,66 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Boolean/15.6.4.3-4-n.js b/tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.4.3-4-n.js
new file mode 100644
index 0000000000..4ebabfa84c
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.4.3-4-n.js
@@ -0,0 +1,69 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Boolean/15.6.4.3.js b/tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.4.3.js
new file mode 100644
index 0000000000..570652ee39
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.4.3.js
@@ -0,0 +1,83 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Boolean/15.6.4.js b/tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.4.js
new file mode 100644
index 0000000000..0c95d255fe
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Boolean/15.6.4.js
@@ -0,0 +1,80 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Boolean/browser.js b/tests/auto/qml/parserstress/tests/ecma/Boolean/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Boolean/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma/Boolean/shell.js b/tests/auto/qml/parserstress/tests/ecma/Boolean/shell.js
new file mode 100644
index 0000000000..2ff7258ce8
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Boolean/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'Boolean';
diff --git a/tests/auto/qml/parserstress/tests/ecma/Date/15.9.1.1-1.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.1.1-1.js
new file mode 100644
index 0000000000..8e82d205f3
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.1.1-1.js
@@ -0,0 +1,96 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.1.1-2.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.1.1-2.js
new file mode 100644
index 0000000000..7b8c2644e3
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.1.1-2.js
@@ -0,0 +1,91 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.1.13-1.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.1.13-1.js
new file mode 100755
index 0000000000..720b39dd54
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.1.13-1.js
@@ -0,0 +1,79 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.2.1.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.2.1.js
new file mode 100644
index 0000000000..6cd76efb6b
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.2.1.js
@@ -0,0 +1,104 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.2.2-1.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.2.2-1.js
new file mode 100644
index 0000000000..0c643cfd3a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.2.2-1.js
@@ -0,0 +1,69 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.2.2-2.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.2.2-2.js
new file mode 100644
index 0000000000..af95bb3ae6
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.2.2-2.js
@@ -0,0 +1,69 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.2.2-3.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.2.2-3.js
new file mode 100644
index 0000000000..f7de60b5b1
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.2.2-3.js
@@ -0,0 +1,69 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.2.2-4.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.2.2-4.js
new file mode 100644
index 0000000000..119b4f2559
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.2.2-4.js
@@ -0,0 +1,68 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.2.2-5.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.2.2-5.js
new file mode 100644
index 0000000000..d9369ca4c5
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.2.2-5.js
@@ -0,0 +1,68 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.2.2-6.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.2.2-6.js
new file mode 100644
index 0000000000..8e549936e3
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.2.2-6.js
@@ -0,0 +1,67 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.3.1-1.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.1-1.js
new file mode 100644
index 0000000000..642169a60c
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.1-1.js
@@ -0,0 +1,239 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.3.1-2.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.1-2.js
new file mode 100644
index 0000000000..fb9dff486c
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.1-2.js
@@ -0,0 +1,152 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.3.1-3.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.1-3.js
new file mode 100644
index 0000000000..0d888b089c
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.1-3.js
@@ -0,0 +1,141 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.3.1-4.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.1-4.js
new file mode 100644
index 0000000000..5f95a5b797
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.1-4.js
@@ -0,0 +1,151 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.3.1-5.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.1-5.js
new file mode 100644
index 0000000000..f37c1c8da2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.1-5.js
@@ -0,0 +1,140 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.3.2-1.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.2-1.js
new file mode 100644
index 0000000000..ae0502be64
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.2-1.js
@@ -0,0 +1,151 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.3.2-2.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.2-2.js
new file mode 100644
index 0000000000..acc2ac7f0b
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.2-2.js
@@ -0,0 +1,142 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.3.2-3.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.2-3.js
new file mode 100644
index 0000000000..d4b48fed35
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.2-3.js
@@ -0,0 +1,146 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.3.2-4.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.2-4.js
new file mode 100644
index 0000000000..1b2757cd9a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.2-4.js
@@ -0,0 +1,143 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.3.2-5.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.2-5.js
new file mode 100644
index 0000000000..09d6272c6f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.2-5.js
@@ -0,0 +1,140 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.3.8-1.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.8-1.js
new file mode 100644
index 0000000000..d48199ccba
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.8-1.js
@@ -0,0 +1,155 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.3.8-2.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.8-2.js
new file mode 100644
index 0000000000..f9d8d36d04
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.8-2.js
@@ -0,0 +1,153 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.3.8-3.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.8-3.js
new file mode 100644
index 0000000000..c3042a8216
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.8-3.js
@@ -0,0 +1,160 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.3.8-4.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.8-4.js
new file mode 100644
index 0000000000..c3a1eae7dc
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.8-4.js
@@ -0,0 +1,161 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.3.8-5.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.8-5.js
new file mode 100644
index 0000000000..405842c79f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.3.8-5.js
@@ -0,0 +1,161 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.4.2-1.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.4.2-1.js
new file mode 100644
index 0000000000..4b269f264f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.4.2-1.js
@@ -0,0 +1,81 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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/qml/parserstress/tests/ecma/Date/15.9.4.2.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.4.2.js
new file mode 100644
index 0000000000..5a518e6442
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.4.2.js
@@ -0,0 +1,191 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.4.3.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.4.3.js
new file mode 100644
index 0000000000..b0549588aa
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.4.3.js
@@ -0,0 +1,186 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.1.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.1.js
new file mode 100644
index 0000000000..3185a7c4e5
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.1.js
@@ -0,0 +1,63 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.10-1.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.10-1.js
new file mode 100644
index 0000000000..cd73d288c9
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.10-1.js
@@ -0,0 +1,85 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.10-10.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.10-10.js
new file mode 100644
index 0000000000..4142635486
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.10-10.js
@@ -0,0 +1,89 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.10-11.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.10-11.js
new file mode 100644
index 0000000000..dfadc18838
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.10-11.js
@@ -0,0 +1,89 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.10-12.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.10-12.js
new file mode 100644
index 0000000000..2557108faf
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.10-12.js
@@ -0,0 +1,89 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.10-13.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.10-13.js
new file mode 100644
index 0000000000..e0e2402ebd
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.10-13.js
@@ -0,0 +1,89 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.10-2.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.10-2.js
new file mode 100644
index 0000000000..e44cfcc5d7
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.10-2.js
@@ -0,0 +1,87 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.10-3.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.10-3.js
new file mode 100644
index 0000000000..325c9bfaf2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.10-3.js
@@ -0,0 +1,85 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.10-4.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.10-4.js
new file mode 100644
index 0000000000..41676c2658
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.10-4.js
@@ -0,0 +1,85 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.10-5.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.10-5.js
new file mode 100644
index 0000000000..f17b0a0b29
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.10-5.js
@@ -0,0 +1,85 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.10-6.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.10-6.js
new file mode 100644
index 0000000000..84f57b8805
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.10-6.js
@@ -0,0 +1,85 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.10-7.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.10-7.js
new file mode 100644
index 0000000000..96ba89078a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.10-7.js
@@ -0,0 +1,85 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.10-8.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.10-8.js
new file mode 100644
index 0000000000..bae220a94e
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.10-8.js
@@ -0,0 +1,89 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.10-9.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.10-9.js
new file mode 100644
index 0000000000..a1cee0e682
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.10-9.js
@@ -0,0 +1,89 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.11-1.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.11-1.js
new file mode 100644
index 0000000000..5c2439ba09
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.11-1.js
@@ -0,0 +1,76 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.11-2.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.11-2.js
new file mode 100644
index 0000000000..d9eda4cfc1
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.11-2.js
@@ -0,0 +1,76 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.11-3.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.11-3.js
new file mode 100644
index 0000000000..d35f8d5967
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.11-3.js
@@ -0,0 +1,76 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.11-4.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.11-4.js
new file mode 100644
index 0000000000..4fc9f2ee65
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.11-4.js
@@ -0,0 +1,76 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.11-5.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.11-5.js
new file mode 100644
index 0000000000..cee93a770b
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.11-5.js
@@ -0,0 +1,76 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.11-6.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.11-6.js
new file mode 100644
index 0000000000..b756e43a7e
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.11-6.js
@@ -0,0 +1,76 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.11-7.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.11-7.js
new file mode 100644
index 0000000000..65c5c1c765
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.11-7.js
@@ -0,0 +1,76 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.12-1.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.12-1.js
new file mode 100644
index 0000000000..c173ffb193
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.12-1.js
@@ -0,0 +1,77 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.12-2.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.12-2.js
new file mode 100644
index 0000000000..5967da6ef6
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.12-2.js
@@ -0,0 +1,77 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.12-3.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.12-3.js
new file mode 100644
index 0000000000..9ce226665c
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.12-3.js
@@ -0,0 +1,77 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.12-4.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.12-4.js
new file mode 100644
index 0000000000..3b752a1767
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.12-4.js
@@ -0,0 +1,77 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.12-5.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.12-5.js
new file mode 100644
index 0000000000..7fe153a5ea
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.12-5.js
@@ -0,0 +1,77 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.12-6.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.12-6.js
new file mode 100644
index 0000000000..663ab81b2d
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.12-6.js
@@ -0,0 +1,77 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.12-7.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.12-7.js
new file mode 100644
index 0000000000..23a0218058
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.12-7.js
@@ -0,0 +1,77 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.12-8.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.12-8.js
new file mode 100644
index 0000000000..4f3f66e0ce
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.12-8.js
@@ -0,0 +1,71 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.13-1.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.13-1.js
new file mode 100644
index 0000000000..d82f39a7e0
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.13-1.js
@@ -0,0 +1,79 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.13-2.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.13-2.js
new file mode 100644
index 0000000000..13f0d080e3
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.13-2.js
@@ -0,0 +1,76 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.13-3.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.13-3.js
new file mode 100644
index 0000000000..7c78072ee5
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.13-3.js
@@ -0,0 +1,77 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.13-4.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.13-4.js
new file mode 100644
index 0000000000..bcfcfb8c00
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.13-4.js
@@ -0,0 +1,77 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.13-5.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.13-5.js
new file mode 100644
index 0000000000..96b1acb170
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.13-5.js
@@ -0,0 +1,77 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.13-6.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.13-6.js
new file mode 100644
index 0000000000..e749ad6b7f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.13-6.js
@@ -0,0 +1,77 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.13-7.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.13-7.js
new file mode 100644
index 0000000000..63607f8d2d
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.13-7.js
@@ -0,0 +1,76 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.13-8.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.13-8.js
new file mode 100644
index 0000000000..75d42b200b
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.13-8.js
@@ -0,0 +1,71 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.14.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.14.js
new file mode 100644
index 0000000000..5a3f8216da
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.14.js
@@ -0,0 +1,87 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.15.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.15.js
new file mode 100644
index 0000000000..ca2babd7ef
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.15.js
@@ -0,0 +1,88 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.16.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.16.js
new file mode 100644
index 0000000000..e791b74eae
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.16.js
@@ -0,0 +1,87 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.17.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.17.js
new file mode 100644
index 0000000000..e9b30c3eed
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.17.js
@@ -0,0 +1,88 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.18.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.18.js
new file mode 100644
index 0000000000..f735168efe
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.18.js
@@ -0,0 +1,88 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.19.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.19.js
new file mode 100644
index 0000000000..2a0d7430ef
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.19.js
@@ -0,0 +1,88 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.2-1.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.2-1.js
new file mode 100644
index 0000000000..7ec3c691c8
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.2-1.js
@@ -0,0 +1,151 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.2-2-n.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.2-2-n.js
new file mode 100644
index 0000000000..c5513b8168
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.2-2-n.js
@@ -0,0 +1,84 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.2.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.2.js
new file mode 100644
index 0000000000..ef2df0510b
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.2.js
@@ -0,0 +1,151 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.20.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.20.js
new file mode 100644
index 0000000000..fb3dafde2c
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.20.js
@@ -0,0 +1,88 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.21-1.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.21-1.js
new file mode 100644
index 0000000000..4eea164305
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.21-1.js
@@ -0,0 +1,70 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.21-2.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.21-2.js
new file mode 100644
index 0000000000..37b443117a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.21-2.js
@@ -0,0 +1,70 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.21-3.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.21-3.js
new file mode 100644
index 0000000000..d1d96cb7a3
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.21-3.js
@@ -0,0 +1,70 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.21-4.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.21-4.js
new file mode 100644
index 0000000000..b7dfa656ff
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.21-4.js
@@ -0,0 +1,70 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.21-5.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.21-5.js
new file mode 100644
index 0000000000..ca90b1784a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.21-5.js
@@ -0,0 +1,70 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.21-6.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.21-6.js
new file mode 100644
index 0000000000..9178ae76cf
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.21-6.js
@@ -0,0 +1,70 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.21-7.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.21-7.js
new file mode 100644
index 0000000000..c4d0a4b615
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.21-7.js
@@ -0,0 +1,70 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.21-8.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.21-8.js
new file mode 100644
index 0000000000..624d6c6bcb
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.21-8.js
@@ -0,0 +1,71 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.22-1.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.22-1.js
new file mode 100644
index 0000000000..5d2a6934ab
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.22-1.js
@@ -0,0 +1,89 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.22-2.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.22-2.js
new file mode 100644
index 0000000000..b828b468d1
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.22-2.js
@@ -0,0 +1,74 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.22-3.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.22-3.js
new file mode 100644
index 0000000000..26c059368d
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.22-3.js
@@ -0,0 +1,74 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.22-4.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.22-4.js
new file mode 100644
index 0000000000..96b9771d59
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.22-4.js
@@ -0,0 +1,74 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.22-5.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.22-5.js
new file mode 100644
index 0000000000..a943aa5699
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.22-5.js
@@ -0,0 +1,74 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.22-6.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.22-6.js
new file mode 100644
index 0000000000..96b39d2c43
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.22-6.js
@@ -0,0 +1,74 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.22-7.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.22-7.js
new file mode 100644
index 0000000000..7fa0ecaf14
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.22-7.js
@@ -0,0 +1,74 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.22-8.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.22-8.js
new file mode 100644
index 0000000000..3eca9d8ec9
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.22-8.js
@@ -0,0 +1,72 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.23-1.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-1.js
new file mode 100644
index 0000000000..e4a228e2cd
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-1.js
@@ -0,0 +1,139 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.23-10.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-10.js
new file mode 100644
index 0000000000..d4cb298d19
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-10.js
@@ -0,0 +1,139 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.23-11.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-11.js
new file mode 100644
index 0000000000..ca28015766
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-11.js
@@ -0,0 +1,140 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.23-12.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-12.js
new file mode 100644
index 0000000000..a03f599567
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-12.js
@@ -0,0 +1,137 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.23-13.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-13.js
new file mode 100644
index 0000000000..a68128770c
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-13.js
@@ -0,0 +1,137 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.23-14.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-14.js
new file mode 100644
index 0000000000..1923d715e3
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-14.js
@@ -0,0 +1,137 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.23-15.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-15.js
new file mode 100644
index 0000000000..31680eb386
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-15.js
@@ -0,0 +1,137 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.23-16.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-16.js
new file mode 100644
index 0000000000..3dc0726ca8
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-16.js
@@ -0,0 +1,137 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.23-17.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-17.js
new file mode 100644
index 0000000000..605f4cf00b
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-17.js
@@ -0,0 +1,137 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.23-18.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-18.js
new file mode 100644
index 0000000000..e30d0f05c8
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-18.js
@@ -0,0 +1,137 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.23-2.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-2.js
new file mode 100644
index 0000000000..8086af88d9
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-2.js
@@ -0,0 +1,109 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.23-3-n.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-3-n.js
new file mode 100644
index 0000000000..040604bd0e
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-3-n.js
@@ -0,0 +1,79 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.23-4.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-4.js
new file mode 100644
index 0000000000..39e3dec8d4
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-4.js
@@ -0,0 +1,112 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.23-5.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-5.js
new file mode 100644
index 0000000000..b4317e6a55
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-5.js
@@ -0,0 +1,113 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.23-6.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-6.js
new file mode 100644
index 0000000000..cc9e07b9fd
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-6.js
@@ -0,0 +1,112 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.23-7.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-7.js
new file mode 100644
index 0000000000..46bb900b18
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-7.js
@@ -0,0 +1,113 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.23-8.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-8.js
new file mode 100644
index 0000000000..8072a9cc1f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-8.js
@@ -0,0 +1,103 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.23-9.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-9.js
new file mode 100644
index 0000000000..b480791e3d
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.23-9.js
@@ -0,0 +1,103 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.24-1.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.24-1.js
new file mode 100644
index 0000000000..e02aa6150a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.24-1.js
@@ -0,0 +1,134 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.24-2.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.24-2.js
new file mode 100644
index 0000000000..da6261670b
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.24-2.js
@@ -0,0 +1,134 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.24-3.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.24-3.js
new file mode 100644
index 0000000000..8199010953
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.24-3.js
@@ -0,0 +1,134 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.24-4.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.24-4.js
new file mode 100644
index 0000000000..f6b1dae966
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.24-4.js
@@ -0,0 +1,134 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.24-5.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.24-5.js
new file mode 100644
index 0000000000..53458028be
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.24-5.js
@@ -0,0 +1,134 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.24-6.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.24-6.js
new file mode 100644
index 0000000000..188dbacff9
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.24-6.js
@@ -0,0 +1,134 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.24-7.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.24-7.js
new file mode 100644
index 0000000000..b2fe8fcff9
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.24-7.js
@@ -0,0 +1,134 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.24-8.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.24-8.js
new file mode 100644
index 0000000000..d6ea2d8d3e
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.24-8.js
@@ -0,0 +1,133 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.25-1.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.25-1.js
new file mode 100644
index 0000000000..0eb7783ec8
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.25-1.js
@@ -0,0 +1,174 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.26-1.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.26-1.js
new file mode 100644
index 0000000000..509ec73d33
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.26-1.js
@@ -0,0 +1,183 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.27-1.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.27-1.js
new file mode 100644
index 0000000000..1b06777332
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.27-1.js
@@ -0,0 +1,183 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.28-1.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.28-1.js
new file mode 100644
index 0000000000..902d70a873
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.28-1.js
@@ -0,0 +1,196 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.29-1.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.29-1.js
new file mode 100644
index 0000000000..42fa36e9b5
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.29-1.js
@@ -0,0 +1,191 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.3-1-n.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.3-1-n.js
new file mode 100644
index 0000000000..e1f227f785
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.3-1-n.js
@@ -0,0 +1,80 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.3-2.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.3-2.js
new file mode 100644
index 0000000000..9f425c3450
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.3-2.js
@@ -0,0 +1,104 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.30-1.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.30-1.js
new file mode 100644
index 0000000000..7abb3927d7
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.30-1.js
@@ -0,0 +1,192 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.31-1.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.31-1.js
new file mode 100644
index 0000000000..10f0f93e17
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.31-1.js
@@ -0,0 +1,221 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.32-1.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.32-1.js
new file mode 100644
index 0000000000..d277fd9af1
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.32-1.js
@@ -0,0 +1,141 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.33-1.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.33-1.js
new file mode 100644
index 0000000000..01e1ff2f94
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.33-1.js
@@ -0,0 +1,145 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.34-1.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.34-1.js
new file mode 100644
index 0000000000..de4d8c817b
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.34-1.js
@@ -0,0 +1,182 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.35-1.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.35-1.js
new file mode 100644
index 0000000000..427657cb47
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.35-1.js
@@ -0,0 +1,139 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.36-1.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.36-1.js
new file mode 100644
index 0000000000..f4cd44c2c2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.36-1.js
@@ -0,0 +1,165 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.36-2.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.36-2.js
new file mode 100644
index 0000000000..a0ce018d0f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.36-2.js
@@ -0,0 +1,164 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.36-3.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.36-3.js
new file mode 100644
index 0000000000..f0849f28e7
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.36-3.js
@@ -0,0 +1,163 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.36-4.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.36-4.js
new file mode 100644
index 0000000000..0ca872f8db
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.36-4.js
@@ -0,0 +1,163 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.36-5.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.36-5.js
new file mode 100644
index 0000000000..2496548b1d
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.36-5.js
@@ -0,0 +1,163 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.36-6.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.36-6.js
new file mode 100644
index 0000000000..9a05c3130e
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.36-6.js
@@ -0,0 +1,163 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.36-7.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.36-7.js
new file mode 100644
index 0000000000..5bc330bbea
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.36-7.js
@@ -0,0 +1,163 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.37-1.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.37-1.js
new file mode 100644
index 0000000000..a6acd3d10a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.37-1.js
@@ -0,0 +1,173 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.37-2.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.37-2.js
new file mode 100644
index 0000000000..e5ec78ea72
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.37-2.js
@@ -0,0 +1,161 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.37-3.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.37-3.js
new file mode 100644
index 0000000000..d256511459
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.37-3.js
@@ -0,0 +1,164 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.37-4.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.37-4.js
new file mode 100644
index 0000000000..017afd6389
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.37-4.js
@@ -0,0 +1,163 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.37-5.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.37-5.js
new file mode 100644
index 0000000000..046f3095df
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.37-5.js
@@ -0,0 +1,159 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.4-1.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.4-1.js
new file mode 100644
index 0000000000..6ad06931f8
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.4-1.js
@@ -0,0 +1,93 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.4-2-n.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.4-2-n.js
new file mode 100644
index 0000000000..1cd98dd801
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.4-2-n.js
@@ -0,0 +1,76 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.5.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.5.js
new file mode 100644
index 0000000000..f0136b00ad
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.5.js
@@ -0,0 +1,112 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.6.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.6.js
new file mode 100644
index 0000000000..9ae804ebb9
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.6.js
@@ -0,0 +1,104 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.7.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.7.js
new file mode 100644
index 0000000000..c4c83a2c38
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.7.js
@@ -0,0 +1,105 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.8.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.8.js
new file mode 100644
index 0000000000..572e293960
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.8.js
@@ -0,0 +1,113 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.9.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.9.js
new file mode 100644
index 0000000000..9f0fc124af
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.9.js
@@ -0,0 +1,113 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/15.9.5.js b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.js
new file mode 100644
index 0000000000..9e3bd94080
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/15.9.5.js
@@ -0,0 +1,83 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Date/browser.js b/tests/auto/qml/parserstress/tests/ecma/Date/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma/Date/shell.js b/tests/auto/qml/parserstress/tests/ecma/Date/shell.js
new file mode 100644
index 0000000000..0beb78e064
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Date/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'Date';
diff --git a/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.3-1.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.3-1.js
new file mode 100644
index 0000000000..699296d6b1
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.3-1.js
@@ -0,0 +1,107 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/ExecutionContexts/10.1.3-2.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.3-2.js
new file mode 100755
index 0000000000..3762842461
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.3-2.js
@@ -0,0 +1,73 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the 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/qml/parserstress/tests/ecma/ExecutionContexts/10.1.3.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.3.js
new file mode 100644
index 0000000000..fd466de210
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.3.js
@@ -0,0 +1,170 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-1.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-1.js
new file mode 100644
index 0000000000..ec49f20596
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-1.js
@@ -0,0 +1,111 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-10.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-10.js
new file mode 100644
index 0000000000..218031c83f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-10.js
@@ -0,0 +1,105 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-2.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-2.js
new file mode 100644
index 0000000000..2aee831b45
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-2.js
@@ -0,0 +1,113 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-3.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-3.js
new file mode 100644
index 0000000000..a3ae0ffdec
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-3.js
@@ -0,0 +1,111 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-4.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-4.js
new file mode 100644
index 0000000000..31274a0209
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-4.js
@@ -0,0 +1,113 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-5.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-5.js
new file mode 100644
index 0000000000..c36d2db8cc
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-5.js
@@ -0,0 +1,112 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-6.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-6.js
new file mode 100644
index 0000000000..da11110cc5
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-6.js
@@ -0,0 +1,100 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-7.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-7.js
new file mode 100644
index 0000000000..f1a0db4569
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-7.js
@@ -0,0 +1,112 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-8.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-8.js
new file mode 100644
index 0000000000..1eee8da4fb
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.4-8.js
@@ -0,0 +1,113 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/ExecutionContexts/10.1.5-1.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.5-1.js
new file mode 100644
index 0000000000..363581eff6
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.5-1.js
@@ -0,0 +1,118 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/ExecutionContexts/10.1.5-2.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.5-2.js
new file mode 100644
index 0000000000..cfba3b5c73
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.5-2.js
@@ -0,0 +1,100 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/ExecutionContexts/10.1.5-3.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.5-3.js
new file mode 100644
index 0000000000..f5234cb13b
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.5-3.js
@@ -0,0 +1,130 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/ExecutionContexts/10.1.5-4.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.5-4.js
new file mode 100644
index 0000000000..953e6a8feb
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.5-4.js
@@ -0,0 +1,91 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/ExecutionContexts/10.1.8-2.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.8-2.js
new file mode 100644
index 0000000000..40e6f0ee8f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.8-2.js
@@ -0,0 +1,120 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/ExecutionContexts/10.1.8-3.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.8-3.js
new file mode 100644
index 0000000000..71aa876f02
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.1.8-3.js
@@ -0,0 +1,66 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the 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/qml/parserstress/tests/ecma/ExecutionContexts/10.2.1.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.2.1.js
new file mode 100644
index 0000000000..5384da4f83
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.2.1.js
@@ -0,0 +1,85 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/ExecutionContexts/10.2.2-1.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.2.2-1.js
new file mode 100644
index 0000000000..787ef9e5b3
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.2.2-1.js
@@ -0,0 +1,122 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/ExecutionContexts/10.2.2-2.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.2.2-2.js
new file mode 100644
index 0000000000..8048c45575
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.2.2-2.js
@@ -0,0 +1,133 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/ExecutionContexts/10.2.3-1.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.2.3-1.js
new file mode 100644
index 0000000000..a1977c66d6
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.2.3-1.js
@@ -0,0 +1,86 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/ExecutionContexts/10.2.3-2.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.2.3-2.js
new file mode 100644
index 0000000000..e1aa78c5da
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/10.2.3-2.js
@@ -0,0 +1,92 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/ExecutionContexts/browser.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/shell.js b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/shell.js
new file mode 100644
index 0000000000..1d353cff74
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ExecutionContexts/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'ExecutionContexts';
diff --git a/tests/auto/qml/parserstress/tests/ecma/Expressions/11.1.1.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.1.1.js
new file mode 100644
index 0000000000..18f0ec7f13
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.1.1.js
@@ -0,0 +1,137 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.10-1.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.10-1.js
new file mode 100644
index 0000000000..5b70334ff5
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.10-1.js
@@ -0,0 +1,270 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.10-2.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.10-2.js
new file mode 100644
index 0000000000..27bde196e0
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.10-2.js
@@ -0,0 +1,269 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.10-3.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.10-3.js
new file mode 100644
index 0000000000..3da6963255
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.10-3.js
@@ -0,0 +1,268 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.12-1.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.12-1.js
new file mode 100644
index 0000000000..ff131b672e
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.12-1.js
@@ -0,0 +1,110 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.12-2-n.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.12-2-n.js
new file mode 100644
index 0000000000..c2a1e894e0
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.12-2-n.js
@@ -0,0 +1,74 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.12-3.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.12-3.js
new file mode 100644
index 0000000000..11dde79fb3
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.12-3.js
@@ -0,0 +1,71 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.12-4.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.12-4.js
new file mode 100644
index 0000000000..861692c4e8
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.12-4.js
@@ -0,0 +1,71 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.13.1.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.13.1.js
new file mode 100644
index 0000000000..5e548a3e76
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.13.1.js
@@ -0,0 +1,72 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.13.2-1.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.13.2-1.js
new file mode 100644
index 0000000000..41402b77ce
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.13.2-1.js
@@ -0,0 +1,231 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.13.2-2.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.13.2-2.js
new file mode 100644
index 0000000000..2d3b53630b
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.13.2-2.js
@@ -0,0 +1,253 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.13.2-3.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.13.2-3.js
new file mode 100644
index 0000000000..c432934a30
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.13.2-3.js
@@ -0,0 +1,300 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.13.2-4.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.13.2-4.js
new file mode 100644
index 0000000000..8514dd8c9c
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.13.2-4.js
@@ -0,0 +1,137 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.13.2-5.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.13.2-5.js
new file mode 100644
index 0000000000..99d227b80f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.13.2-5.js
@@ -0,0 +1,137 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.13.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.13.js
new file mode 100644
index 0000000000..bf5f172d36
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.13.js
@@ -0,0 +1,86 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.14-1.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.14-1.js
new file mode 100644
index 0000000000..c2f30afb6a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.14-1.js
@@ -0,0 +1,73 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.2.1-1.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.1-1.js
new file mode 100644
index 0000000000..91e25b01f1
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.1-1.js
@@ -0,0 +1,272 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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 [ <identifier-string> ]
+ and similarly
+ CallExpression . Identifier
+ is identical in its behavior to
+ CallExpression [ <identifier-string> ]
+ where <identifier-string> 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/qml/parserstress/tests/ecma/Expressions/11.2.1-2.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.1-2.js
new file mode 100644
index 0000000000..eda8168c0f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.1-2.js
@@ -0,0 +1,128 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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 [ <identifier-string> ]
+ and similarly
+ CallExpression . Identifier
+ is identical in its behavior to
+ CallExpression [ <identifier-string> ]
+ where <identifier-string> 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/qml/parserstress/tests/ecma/Expressions/11.2.1-3-n.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.1-3-n.js
new file mode 100644
index 0000000000..0732aa0378
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.1-3-n.js
@@ -0,0 +1,128 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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 [ <identifier-string> ]
+ and similarly
+ CallExpression . Identifier
+ is identical in its behavior to
+ CallExpression [ <identifier-string> ]
+ where <identifier-string> 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/qml/parserstress/tests/ecma/Expressions/11.2.1-4-n.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.1-4-n.js
new file mode 100644
index 0000000000..110684c9c6
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.1-4-n.js
@@ -0,0 +1,128 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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 [ <identifier-string> ]
+ and similarly
+ CallExpression . Identifier
+ is identical in its behavior to
+ CallExpression [ <identifier-string> ]
+ where <identifier-string> 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/qml/parserstress/tests/ecma/Expressions/11.2.1-5.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.1-5.js
new file mode 100644
index 0000000000..2d9f0f1632
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.1-5.js
@@ -0,0 +1,128 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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 [ <identifier-string> ]
+ and similarly
+ CallExpression . Identifier
+ is identical in its behavior to
+ CallExpression [ <identifier-string> ]
+ where <identifier-string> 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/qml/parserstress/tests/ecma/Expressions/11.2.2-1-n.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.2-1-n.js
new file mode 100644
index 0000000000..3603892114
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.2-1-n.js
@@ -0,0 +1,104 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.2.2-1.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.2-1.js
new file mode 100644
index 0000000000..7105f17071
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.2-1.js
@@ -0,0 +1,100 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.2.2-10-n.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.2-10-n.js
new file mode 100644
index 0000000000..36781503d9
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.2-10-n.js
@@ -0,0 +1,102 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.2.2-11.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.2-11.js
new file mode 100644
index 0000000000..03a0f8c436
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.2-11.js
@@ -0,0 +1,104 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.2.2-2-n.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.2-2-n.js
new file mode 100644
index 0000000000..7fbea97ca1
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.2-2-n.js
@@ -0,0 +1,104 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.2.2-3-n.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.2-3-n.js
new file mode 100644
index 0000000000..8b344a3dda
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.2-3-n.js
@@ -0,0 +1,100 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.2.2-4-n.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.2-4-n.js
new file mode 100644
index 0000000000..c2ff538b9f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.2-4-n.js
@@ -0,0 +1,104 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.2.2-5-n.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.2-5-n.js
new file mode 100644
index 0000000000..ba8d0756fb
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.2-5-n.js
@@ -0,0 +1,104 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.2.2-6-n.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.2-6-n.js
new file mode 100644
index 0000000000..f89b4009e3
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.2-6-n.js
@@ -0,0 +1,103 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.2.2-7-n.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.2-7-n.js
new file mode 100644
index 0000000000..97ae43e810
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.2-7-n.js
@@ -0,0 +1,104 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.2.2-8-n.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.2-8-n.js
new file mode 100644
index 0000000000..10117c726e
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.2-8-n.js
@@ -0,0 +1,104 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.2.2-9-n.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.2-9-n.js
new file mode 100644
index 0000000000..6099754ca3
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.2-9-n.js
@@ -0,0 +1,104 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.2.3-1.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.3-1.js
new file mode 100644
index 0000000000..6e36ba8d3f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.3-1.js
@@ -0,0 +1,125 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.2.3-2-n.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.3-2-n.js
new file mode 100644
index 0000000000..c3539e817a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.3-2-n.js
@@ -0,0 +1,94 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.2.3-3-n.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.3-3-n.js
new file mode 100644
index 0000000000..3023fee16b
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.3-3-n.js
@@ -0,0 +1,91 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.2.3-4-n.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.3-4-n.js
new file mode 100644
index 0000000000..3c0ac1a4b3
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.3-4-n.js
@@ -0,0 +1,91 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.2.3-5.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.3-5.js
new file mode 100644
index 0000000000..92b356c1dd
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.2.3-5.js
@@ -0,0 +1,85 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.3.1.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.3.1.js
new file mode 100644
index 0000000000..29235f1107
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.3.1.js
@@ -0,0 +1,153 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.3.2.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.3.2.js
new file mode 100644
index 0000000000..2d6f6c6770
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.3.2.js
@@ -0,0 +1,153 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.4.1.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.4.1.js
new file mode 100644
index 0000000000..62354e17bc
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.4.1.js
@@ -0,0 +1,92 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.4.2.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.4.2.js
new file mode 100644
index 0000000000..b89d9145c9
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.4.2.js
@@ -0,0 +1,83 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.4.3.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.4.3.js
new file mode 100644
index 0000000000..b746fbe8b5
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.4.3.js
@@ -0,0 +1,111 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.4.4.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.4.4.js
new file mode 100644
index 0000000000..cbacf869e4
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.4.4.js
@@ -0,0 +1,156 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.4.5.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.4.5.js
new file mode 100644
index 0000000000..ee761c5d96
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.4.5.js
@@ -0,0 +1,154 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.4.6.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.4.6.js
new file mode 100644
index 0000000000..9b100d9d50
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.4.6.js
@@ -0,0 +1,299 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.4.7-01.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.4.7-01.js
new file mode 100644
index 0000000000..827b80189d
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.4.7-01.js
@@ -0,0 +1,299 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.4.7-02.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.4.7-02.js
new file mode 100644
index 0000000000..43bd923e23
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.4.7-02.js
@@ -0,0 +1,87 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma/Expressions/11.4.8.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.4.8.js
new file mode 100644
index 0000000000..f617e10689
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.4.8.js
@@ -0,0 +1,215 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.4.9.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.4.9.js
new file mode 100644
index 0000000000..2c57e88211
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.4.9.js
@@ -0,0 +1,94 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.5.1.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.5.1.js
new file mode 100644
index 0000000000..94edcefea5
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.5.1.js
@@ -0,0 +1,115 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.5.2.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.5.2.js
new file mode 100644
index 0000000000..e459e7613f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.5.2.js
@@ -0,0 +1,154 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.5.3.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.5.3.js
new file mode 100644
index 0000000000..9558b63a96
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.5.3.js
@@ -0,0 +1,161 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.6.1-1.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.6.1-1.js
new file mode 100644
index 0000000000..87666161b6
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.6.1-1.js
@@ -0,0 +1,160 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.6.1-2.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.6.1-2.js
new file mode 100644
index 0000000000..1d96d14e92
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.6.1-2.js
@@ -0,0 +1,164 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.6.1-3.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.6.1-3.js
new file mode 100644
index 0000000000..9a162787d5
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.6.1-3.js
@@ -0,0 +1,150 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.6.2-1.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.6.2-1.js
new file mode 100644
index 0000000000..b3ab9b17fb
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.6.2-1.js
@@ -0,0 +1,165 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.6.3.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.6.3.js
new file mode 100644
index 0000000000..cf44738528
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.6.3.js
@@ -0,0 +1,115 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.7.1.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.7.1.js
new file mode 100644
index 0000000000..44099f6c94
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.7.1.js
@@ -0,0 +1,228 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.7.2.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.7.2.js
new file mode 100644
index 0000000000..843388767f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.7.2.js
@@ -0,0 +1,246 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.7.3.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.7.3.js
new file mode 100644
index 0000000000..27d24e121a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.7.3.js
@@ -0,0 +1,230 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.8.1.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.8.1.js
new file mode 100644
index 0000000000..4b35c11b16
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.8.1.js
@@ -0,0 +1,121 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.8.2.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.8.2.js
new file mode 100644
index 0000000000..c4e6f4cfbd
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.8.2.js
@@ -0,0 +1,121 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.8.3.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.8.3.js
new file mode 100644
index 0000000000..2180fc5655
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.8.3.js
@@ -0,0 +1,120 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.8.4.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.8.4.js
new file mode 100644
index 0000000000..d43aaa260d
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.8.4.js
@@ -0,0 +1,121 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.9.1.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.9.1.js
new file mode 100644
index 0000000000..6bf3fc0517
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.9.1.js
@@ -0,0 +1,159 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.9.2.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.9.2.js
new file mode 100644
index 0000000000..b6983e6af1
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.9.2.js
@@ -0,0 +1,159 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/11.9.3.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.9.3.js
new file mode 100644
index 0000000000..cce1c63c16
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/11.9.3.js
@@ -0,0 +1,159 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Expressions/browser.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma/Expressions/shell.js b/tests/auto/qml/parserstress/tests/ecma/Expressions/shell.js
new file mode 100644
index 0000000000..8f5d1129d5
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Expressions/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'Expressions';
diff --git a/tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.1.1-1.js b/tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.1.1-1.js
new file mode 100644
index 0000000000..90f080acc9
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.1.1-1.js
@@ -0,0 +1,136 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/FunctionObjects/15.3.1.1-2.js b/tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.1.1-2.js
new file mode 100644
index 0000000000..57fe78c8f1
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.1.1-2.js
@@ -0,0 +1,183 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/FunctionObjects/15.3.1.1-3.js b/tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.1.1-3.js
new file mode 100644
index 0000000000..51f7bb763b
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.1.1-3.js
@@ -0,0 +1,99 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/FunctionObjects/15.3.2.1-1.js b/tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.2.1-1.js
new file mode 100644
index 0000000000..d76e57b828
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.2.1-1.js
@@ -0,0 +1,132 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/FunctionObjects/15.3.2.1-2.js b/tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.2.1-2.js
new file mode 100644
index 0000000000..7729c9587a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.2.1-2.js
@@ -0,0 +1,107 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/FunctionObjects/15.3.2.1-3.js b/tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.2.1-3.js
new file mode 100644
index 0000000000..80b1c41e00
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.2.1-3.js
@@ -0,0 +1,95 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/FunctionObjects/15.3.3.1-2.js b/tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.3.1-2.js
new file mode 100644
index 0000000000..b760afd149
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.3.1-2.js
@@ -0,0 +1,70 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/FunctionObjects/15.3.3.1-3.js b/tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.3.1-3.js
new file mode 100644
index 0000000000..62e6d42342
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.3.1-3.js
@@ -0,0 +1,79 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/FunctionObjects/15.3.3.1-4.js b/tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.3.1-4.js
new file mode 100644
index 0000000000..6e1aa8426d
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.3.1-4.js
@@ -0,0 +1,70 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/FunctionObjects/15.3.3.2.js b/tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.3.2.js
new file mode 100644
index 0000000000..b1d04f3957
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.3.2.js
@@ -0,0 +1,62 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/FunctionObjects/15.3.4-1.js b/tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.4-1.js
new file mode 100644
index 0000000000..c90c26a9e5
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.4-1.js
@@ -0,0 +1,94 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/FunctionObjects/15.3.4.1.js b/tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.4.1.js
new file mode 100644
index 0000000000..a6bc775902
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.4.1.js
@@ -0,0 +1,61 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/FunctionObjects/15.3.4.js b/tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.4.js
new file mode 100644
index 0000000000..59e3ff81a5
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.4.js
@@ -0,0 +1,81 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/FunctionObjects/15.3.5-1.js b/tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.5-1.js
new file mode 100644
index 0000000000..c3fbfc774e
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.5-1.js
@@ -0,0 +1,117 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/FunctionObjects/15.3.5-2.js b/tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.5-2.js
new file mode 100644
index 0000000000..dcb351985d
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.5-2.js
@@ -0,0 +1,90 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/FunctionObjects/15.3.5.1.js b/tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.5.1.js
new file mode 100644
index 0000000000..406d569dba
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.5.1.js
@@ -0,0 +1,83 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/FunctionObjects/15.3.5.3.js b/tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.5.3.js
new file mode 100644
index 0000000000..4a127fbc68
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/FunctionObjects/15.3.5.3.js
@@ -0,0 +1,72 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/FunctionObjects/browser.js b/tests/auto/qml/parserstress/tests/ecma/FunctionObjects/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/FunctionObjects/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma/FunctionObjects/shell.js b/tests/auto/qml/parserstress/tests/ecma/FunctionObjects/shell.js
new file mode 100644
index 0000000000..27aa7b1318
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/FunctionObjects/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'FunctionObjects';
diff --git a/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1-1-n.js b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1-1-n.js
new file mode 100644
index 0000000000..9946a7f2da
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1-1-n.js
@@ -0,0 +1,70 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/GlobalObject/15.1-2-n.js b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1-2-n.js
new file mode 100644
index 0000000000..545caeeae0
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1-2-n.js
@@ -0,0 +1,67 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/GlobalObject/15.1.1.1.js b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.1.1.js
new file mode 100644
index 0000000000..a8d4e7fecf
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.1.1.js
@@ -0,0 +1,63 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/GlobalObject/15.1.1.2.js b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.1.2.js
new file mode 100644
index 0000000000..8671ff642a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.1.2.js
@@ -0,0 +1,62 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/GlobalObject/15.1.2.1-2.js b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.1-2.js
new file mode 100644
index 0000000000..8572371f8e
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.1-2.js
@@ -0,0 +1,66 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/GlobalObject/15.1.2.2-1.js b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.2-1.js
new file mode 100644
index 0000000000..a4bf1c7de6
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.2-1.js
@@ -0,0 +1,410 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/GlobalObject/15.1.2.2-2.js b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.2-2.js
new file mode 100644
index 0000000000..ff8806dfb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.2-2.js
@@ -0,0 +1,238 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/GlobalObject/15.1.2.3-1.js b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.3-1.js
new file mode 100644
index 0000000000..56bf83adcc
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.3-1.js
@@ -0,0 +1,441 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/GlobalObject/15.1.2.3-2.js b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.3-2.js
new file mode 100644
index 0000000000..557b93f637
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.3-2.js
@@ -0,0 +1,291 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/GlobalObject/15.1.2.4.js b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.4.js
new file mode 100644
index 0000000000..bd2114a1a9
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.4.js
@@ -0,0 +1,205 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/GlobalObject/15.1.2.5-1.js b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.5-1.js
new file mode 100644
index 0000000000..b7b072a627
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.5-1.js
@@ -0,0 +1,206 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/GlobalObject/15.1.2.5-2.js b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.5-2.js
new file mode 100644
index 0000000000..99b58752b2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.5-2.js
@@ -0,0 +1,183 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/GlobalObject/15.1.2.5-3.js b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.5-3.js
new file mode 100644
index 0000000000..2615d62531
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.5-3.js
@@ -0,0 +1,207 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/GlobalObject/15.1.2.6.js b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.6.js
new file mode 100644
index 0000000000..faeeb9e0b0
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.6.js
@@ -0,0 +1,125 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/GlobalObject/15.1.2.7.js b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.7.js
new file mode 100644
index 0000000000..e3db5e7931
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/15.1.2.7.js
@@ -0,0 +1,130 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/GlobalObject/browser.js b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma/GlobalObject/shell.js b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/shell.js
new file mode 100644
index 0000000000..d922707218
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/GlobalObject/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'GlobalObject';
diff --git a/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.1-1.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.1-1.js
new file mode 100644
index 0000000000..7fa415c20d
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.1-1.js
@@ -0,0 +1,82 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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 <TAB> \t
+ \u000B veritical tab <VT> \v
+ \U000C form feed <FF> \f
+ \u0020 space <SP> " "
+
+ 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/qml/parserstress/tests/ecma/LexicalConventions/7.1-2.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.1-2.js
new file mode 100644
index 0000000000..aa0c3fb373
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.1-2.js
@@ -0,0 +1,73 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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 <TAB> \t
+ \u000B veritical tab <VT> ??
+ \U000C form feed <FF> \f
+ \u0020 space <SP> " "
+
+ 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/qml/parserstress/tests/ecma/LexicalConventions/7.1-3.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.1-3.js
new file mode 100644
index 0000000000..c405106ade
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.1-3.js
@@ -0,0 +1,89 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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 <TAB> \t
+ \u000B veritical tab <VT> ??
+ \U000C form feed <FF> \f
+ \u0020 space <SP> " "
+
+ 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') );
+
+// +<white space>+ 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/qml/parserstress/tests/ecma/LexicalConventions/7.2-1.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.2-1.js
new file mode 100644
index 0000000000..dd4f2fcbed
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.2-1.js
@@ -0,0 +1,73 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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 <LF> \n
+ \u000D carriage return <CR> \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/qml/parserstress/tests/ecma/LexicalConventions/7.2-2-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.2-2-n.js
new file mode 100644
index 0000000000..d945115832
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.2-2-n.js
@@ -0,0 +1,74 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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 <LF> \n
+ \u000D carriage return <CR> \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/qml/parserstress/tests/ecma/LexicalConventions/7.2-3-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.2-3-n.js
new file mode 100644
index 0000000000..c62410d202
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.2-3-n.js
@@ -0,0 +1,74 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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 <LF> \n
+ \u000D carriage return <CR> \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, "<cr>a", "error", eval("\r\nb"));
+
+test();
diff --git a/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.2-4-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.2-4-n.js
new file mode 100644
index 0000000000..b29f999739
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.2-4-n.js
@@ -0,0 +1,73 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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 <LF> \n
+ \u000D carriage return <CR> \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/qml/parserstress/tests/ecma/LexicalConventions/7.2-5-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.2-5-n.js
new file mode 100644
index 0000000000..b563d86437
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.2-5-n.js
@@ -0,0 +1,72 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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 <LF> \n
+ \u000D carriage return <CR> \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/qml/parserstress/tests/ecma/LexicalConventions/7.2-6.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.2-6.js
new file mode 100644
index 0000000000..220548e78e
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.2-6.js
@@ -0,0 +1,68 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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 <LF> \n
+ \u000D carriage return <CR> \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/qml/parserstress/tests/ecma/LexicalConventions/7.3-1.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.3-1.js
new file mode 100644
index 0000000000..9701660576
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.3-1.js
@@ -0,0 +1,92 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.3-10.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.3-10.js
new file mode 100644
index 0000000000..1cd0f18a90
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.3-10.js
@@ -0,0 +1,65 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.3-11.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.3-11.js
new file mode 100644
index 0000000000..f9033cd05a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.3-11.js
@@ -0,0 +1,66 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.3-12.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.3-12.js
new file mode 100644
index 0000000000..04ceb81409
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.3-12.js
@@ -0,0 +1,64 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.3-13-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.3-13-n.js
new file mode 100644
index 0000000000..714de99a9a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.3-13-n.js
@@ -0,0 +1,66 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.3-2.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.3-2.js
new file mode 100644
index 0000000000..7aa029feda
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.3-2.js
@@ -0,0 +1,65 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.3-3.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.3-3.js
new file mode 100644
index 0000000000..1886639e26
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.3-3.js
@@ -0,0 +1,65 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.3-4.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.3-4.js
new file mode 100644
index 0000000000..4cb53af0fb
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.3-4.js
@@ -0,0 +1,65 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.3-5.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.3-5.js
new file mode 100644
index 0000000000..22d9e08a60
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.3-5.js
@@ -0,0 +1,65 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.3-6.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.3-6.js
new file mode 100644
index 0000000000..91afd319a4
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.3-6.js
@@ -0,0 +1,65 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.3-7.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.3-7.js
new file mode 100644
index 0000000000..a35cd54289
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.3-7.js
@@ -0,0 +1,66 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.3-8.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.3-8.js
new file mode 100644
index 0000000000..2d665c4ff0
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.3-8.js
@@ -0,0 +1,65 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.3-9.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.3-9.js
new file mode 100644
index 0000000000..caff9f7f09
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.3-9.js
@@ -0,0 +1,65 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.4.1-1-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.1-1-n.js
new file mode 100644
index 0000000000..2153cc2638
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.1-1-n.js
@@ -0,0 +1,71 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.4.1-2-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.1-2-n.js
new file mode 100644
index 0000000000..a50bd6020f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.1-2-n.js
@@ -0,0 +1,71 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.4.1-3-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.1-3-n.js
new file mode 100644
index 0000000000..b49fe7937b
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.1-3-n.js
@@ -0,0 +1,69 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-1-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-1-n.js
new file mode 100644
index 0000000000..36723173f5
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-1-n.js
@@ -0,0 +1,77 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-10-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-10-n.js
new file mode 100644
index 0000000000..89003d3601
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-10-n.js
@@ -0,0 +1,77 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-11-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-11-n.js
new file mode 100644
index 0000000000..3aff749e51
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-11-n.js
@@ -0,0 +1,77 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-12-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-12-n.js
new file mode 100644
index 0000000000..f19ed8c904
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-12-n.js
@@ -0,0 +1,77 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-13-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-13-n.js
new file mode 100644
index 0000000000..22a5284dcc
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-13-n.js
@@ -0,0 +1,77 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-14-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-14-n.js
new file mode 100644
index 0000000000..b9b05f42b7
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-14-n.js
@@ -0,0 +1,77 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-15-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-15-n.js
new file mode 100644
index 0000000000..27e83972c3
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-15-n.js
@@ -0,0 +1,77 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-16-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-16-n.js
new file mode 100644
index 0000000000..988920538c
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-16-n.js
@@ -0,0 +1,77 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-2-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-2-n.js
new file mode 100644
index 0000000000..648610a9e6
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-2-n.js
@@ -0,0 +1,77 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-3-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-3-n.js
new file mode 100644
index 0000000000..d8b74d6b0e
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-3-n.js
@@ -0,0 +1,77 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-4-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-4-n.js
new file mode 100644
index 0000000000..2bb0aa260b
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-4-n.js
@@ -0,0 +1,77 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-5-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-5-n.js
new file mode 100644
index 0000000000..3fdf06b2c1
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-5-n.js
@@ -0,0 +1,77 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-6-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-6-n.js
new file mode 100644
index 0000000000..00f3f99a4c
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-6-n.js
@@ -0,0 +1,77 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-7-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-7-n.js
new file mode 100644
index 0000000000..6a85b261ce
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-7-n.js
@@ -0,0 +1,75 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-8-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-8-n.js
new file mode 100644
index 0000000000..5f5122e0f2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-8-n.js
@@ -0,0 +1,76 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-9-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-9-n.js
new file mode 100644
index 0000000000..c1c4df6d9b
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.2-9-n.js
@@ -0,0 +1,77 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-1-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-1-n.js
new file mode 100644
index 0000000000..dee163d8e5
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-1-n.js
@@ -0,0 +1,71 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-10-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-10-n.js
new file mode 100644
index 0000000000..8d717f323d
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-10-n.js
@@ -0,0 +1,71 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-11-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-11-n.js
new file mode 100644
index 0000000000..4e29e9c3af
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-11-n.js
@@ -0,0 +1,71 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-12-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-12-n.js
new file mode 100644
index 0000000000..913fae905b
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-12-n.js
@@ -0,0 +1,71 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-13-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-13-n.js
new file mode 100644
index 0000000000..c196ea2418
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-13-n.js
@@ -0,0 +1,71 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-14-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-14-n.js
new file mode 100644
index 0000000000..8d5af29ede
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-14-n.js
@@ -0,0 +1,97 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-15-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-15-n.js
new file mode 100644
index 0000000000..f855132d8a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-15-n.js
@@ -0,0 +1,97 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-16-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-16-n.js
new file mode 100644
index 0000000000..6d86d357f2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-16-n.js
@@ -0,0 +1,88 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-2-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-2-n.js
new file mode 100644
index 0000000000..fe5f6ffac1
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-2-n.js
@@ -0,0 +1,71 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-3-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-3-n.js
new file mode 100644
index 0000000000..b95c8ecbe0
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-3-n.js
@@ -0,0 +1,71 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-4-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-4-n.js
new file mode 100644
index 0000000000..b17b06f2e9
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-4-n.js
@@ -0,0 +1,96 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-5-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-5-n.js
new file mode 100644
index 0000000000..d76025b3cc
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-5-n.js
@@ -0,0 +1,71 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-6-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-6-n.js
new file mode 100644
index 0000000000..36ffe63977
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-6-n.js
@@ -0,0 +1,71 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-7-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-7-n.js
new file mode 100644
index 0000000000..31239d561a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-7-n.js
@@ -0,0 +1,97 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-8-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-8-n.js
new file mode 100644
index 0000000000..666abcc0c8
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-8-n.js
@@ -0,0 +1,71 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-9-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-9-n.js
new file mode 100644
index 0000000000..4fee9c8c4a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.4.3-9-n.js
@@ -0,0 +1,98 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.5-1.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.5-1.js
new file mode 100644
index 0000000000..57be9b63ee
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.5-1.js
@@ -0,0 +1,62 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.5-10-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.5-10-n.js
new file mode 100644
index 0000000000..2561a3deda
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.5-10-n.js
@@ -0,0 +1,64 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.5-2-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.5-2-n.js
new file mode 100644
index 0000000000..3401fe4891
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.5-2-n.js
@@ -0,0 +1,64 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.5-3-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.5-3-n.js
new file mode 100644
index 0000000000..778c284cfb
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.5-3-n.js
@@ -0,0 +1,64 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.5-4-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.5-4-n.js
new file mode 100644
index 0000000000..0f4b0fb2f1
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.5-4-n.js
@@ -0,0 +1,64 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.5-5-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.5-5-n.js
new file mode 100644
index 0000000000..97a61e3449
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.5-5-n.js
@@ -0,0 +1,64 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.5-6.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.5-6.js
new file mode 100644
index 0000000000..a53f4413eb
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.5-6.js
@@ -0,0 +1,61 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.5-7.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.5-7.js
new file mode 100644
index 0000000000..c3446c6c0d
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.5-7.js
@@ -0,0 +1,61 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.5-8-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.5-8-n.js
new file mode 100644
index 0000000000..e363666148
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.5-8-n.js
@@ -0,0 +1,64 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.5-9-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.5-9-n.js
new file mode 100644
index 0000000000..c1ac68512a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.5-9-n.js
@@ -0,0 +1,64 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.6.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.6.js
new file mode 100644
index 0000000000..091c74d7db
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.6.js
@@ -0,0 +1,313 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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<b",
+ false,
+ eval("var a=true,b=false;a<b") );
+
+// <=
+new TestCase( SECTION,
+ "var a=0xFFFF,b=0X0FFF;a<=b",
+ false,
+ eval("var a=0xFFFF,b=0X0FFF;a<=b") );
+
+// >=
+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<<b",
+ 32,
+ eval("var a=4,b=3;a<<b") );
+
+// >>
+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/qml/parserstress/tests/ecma/LexicalConventions/7.7.1.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.1.js
new file mode 100644
index 0000000000..83325b5f32
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.1.js
@@ -0,0 +1,64 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.7.2.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.2.js
new file mode 100644
index 0000000000..f021eb9b18
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.2.js
@@ -0,0 +1,71 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.7.3-1.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3-1.js
new file mode 100644
index 0000000000..fb13b24e07
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3-1.js
@@ -0,0 +1,198 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.7.3-2.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3-2.js
new file mode 100644
index 0000000000..8fbe16cb8f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3-2.js
@@ -0,0 +1,93 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.7.3.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3.js
new file mode 100644
index 0000000000..9ccb912752
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.3.js
@@ -0,0 +1,331 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.7.4.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.4.js
new file mode 100644
index 0000000000..015a385220
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.7.4.js
@@ -0,0 +1,269 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/7.8.2-n.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.8.2-n.js
new file mode 100644
index 0000000000..b8d844e41d
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/7.8.2-n.js
@@ -0,0 +1,63 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/LexicalConventions/browser.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/shell.js b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/shell.js
new file mode 100644
index 0000000000..4e1d61d68a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/LexicalConventions/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'LexicalConventions';
diff --git a/tests/auto/qml/parserstress/tests/ecma/Math/15.8-2-n.js b/tests/auto/qml/parserstress/tests/ecma/Math/15.8-2-n.js
new file mode 100644
index 0000000000..40c2ae8d2d
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/15.8-2-n.js
@@ -0,0 +1,82 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Math/15.8-3-n.js b/tests/auto/qml/parserstress/tests/ecma/Math/15.8-3-n.js
new file mode 100644
index 0000000000..f6333d7ec7
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/15.8-3-n.js
@@ -0,0 +1,81 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Math/15.8.1.1-1.js b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.1-1.js
new file mode 100644
index 0000000000..f90f74b9e8
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.1-1.js
@@ -0,0 +1,64 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Math/15.8.1.1-2.js b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.1-2.js
new file mode 100644
index 0000000000..9f136f2fb8
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.1-2.js
@@ -0,0 +1,69 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Math/15.8.1.2-1.js b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.2-1.js
new file mode 100644
index 0000000000..0cbc65a4fb
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.2-1.js
@@ -0,0 +1,64 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Math/15.8.1.2-2.js b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.2-2.js
new file mode 100644
index 0000000000..6937b3520b
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.2-2.js
@@ -0,0 +1,70 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Math/15.8.1.3-1.js b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.3-1.js
new file mode 100644
index 0000000000..8289cc2a46
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.3-1.js
@@ -0,0 +1,65 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Math/15.8.1.3-2.js b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.3-2.js
new file mode 100644
index 0000000000..24a8b18231
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.3-2.js
@@ -0,0 +1,72 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Math/15.8.1.4-1.js b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.4-1.js
new file mode 100644
index 0000000000..227dbb3e2a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.4-1.js
@@ -0,0 +1,65 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Math/15.8.1.4-2.js b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.4-2.js
new file mode 100644
index 0000000000..c9aa98e77a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.4-2.js
@@ -0,0 +1,69 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Math/15.8.1.5-1.js b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.5-1.js
new file mode 100644
index 0000000000..b753025c8a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.5-1.js
@@ -0,0 +1,66 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Math/15.8.1.5-2.js b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.5-2.js
new file mode 100644
index 0000000000..c134e4a577
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.5-2.js
@@ -0,0 +1,70 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Math/15.8.1.6-1.js b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.6-1.js
new file mode 100644
index 0000000000..f2a395618c
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.6-1.js
@@ -0,0 +1,65 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Math/15.8.1.6-2.js b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.6-2.js
new file mode 100644
index 0000000000..ba53e78de5
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.6-2.js
@@ -0,0 +1,70 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Math/15.8.1.7-1.js b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.7-1.js
new file mode 100644
index 0000000000..aa60aead5b
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.7-1.js
@@ -0,0 +1,65 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Math/15.8.1.7-2.js b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.7-2.js
new file mode 100644
index 0000000000..2f8c45c9f9
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.7-2.js
@@ -0,0 +1,70 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Math/15.8.1.8-1.js b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.8-1.js
new file mode 100644
index 0000000000..3c5764d019
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.8-1.js
@@ -0,0 +1,65 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Math/15.8.1.8-2.js b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.8-2.js
new file mode 100644
index 0000000000..f999dac920
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.8-2.js
@@ -0,0 +1,69 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Math/15.8.1.8-3.js b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.8-3.js
new file mode 100644
index 0000000000..0c823aea57
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.8-3.js
@@ -0,0 +1,63 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Math/15.8.1.js b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.js
new file mode 100644
index 0000000000..009325640b
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.1.js
@@ -0,0 +1,149 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Math/15.8.2.1.js b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.1.js
new file mode 100644
index 0000000000..0412742767
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.1.js
@@ -0,0 +1,226 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Math/15.8.2.10.js b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.10.js
new file mode 100644
index 0000000000..05d4c187c9
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.10.js
@@ -0,0 +1,153 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Math/15.8.2.11.js b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.11.js
new file mode 100644
index 0000000000..5a957b3de4
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.11.js
@@ -0,0 +1,200 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Math/15.8.2.12.js b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.12.js
new file mode 100644
index 0000000000..a33a5aca4a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.12.js
@@ -0,0 +1,177 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Math/15.8.2.13.js b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.13.js
new file mode 100644
index 0000000000..341b3e7651
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.13.js
@@ -0,0 +1,385 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Math/15.8.2.14.js b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.14.js
new file mode 100644
index 0000000000..1972518c81
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.14.js
@@ -0,0 +1,79 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Math/15.8.2.15.js b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.15.js
new file mode 100644
index 0000000000..a5c36b4e61
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.15.js
@@ -0,0 +1,202 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Math/15.8.2.16.js b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.16.js
new file mode 100644
index 0000000000..deb873cdaa
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.16.js
@@ -0,0 +1,132 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Math/15.8.2.17.js b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.17.js
new file mode 100644
index 0000000000..2f12f1d93b
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.17.js
@@ -0,0 +1,217 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Math/15.8.2.18.js b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.18.js
new file mode 100644
index 0000000000..be68ea191f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.18.js
@@ -0,0 +1,165 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Math/15.8.2.2.js b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.2.js
new file mode 100644
index 0000000000..12fb00ef81
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.2.js
@@ -0,0 +1,151 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Math/15.8.2.3.js b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.3.js
new file mode 100644
index 0000000000..11c6d73657
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.3.js
@@ -0,0 +1,158 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Math/15.8.2.4.js b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.4.js
new file mode 100644
index 0000000000..c67ac6d4ea
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.4.js
@@ -0,0 +1,156 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Math/15.8.2.5.js b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.5.js
new file mode 100644
index 0000000000..0adc690743
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.5.js
@@ -0,0 +1,244 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Math/15.8.2.6.js b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.6.js
new file mode 100644
index 0000000000..1c20a1c93e
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.6.js
@@ -0,0 +1,232 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Math/15.8.2.7.js b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.7.js
new file mode 100644
index 0000000000..2b19b5986e
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.7.js
@@ -0,0 +1,283 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Math/15.8.2.8.js b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.8.js
new file mode 100644
index 0000000000..96b6231da2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.8.js
@@ -0,0 +1,134 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Math/15.8.2.9.js b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.9.js
new file mode 100644
index 0000000000..b68a57d5bb
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/15.8.2.9.js
@@ -0,0 +1,191 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Math/browser.js b/tests/auto/qml/parserstress/tests/ecma/Math/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma/Math/shell.js b/tests/auto/qml/parserstress/tests/ecma/Math/shell.js
new file mode 100644
index 0000000000..fbcc5c3f92
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Math/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'Math';
diff --git a/tests/auto/qml/parserstress/tests/ecma/NativeObjects/browser.js b/tests/auto/qml/parserstress/tests/ecma/NativeObjects/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/NativeObjects/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma/NativeObjects/shell.js b/tests/auto/qml/parserstress/tests/ecma/NativeObjects/shell.js
new file mode 100644
index 0000000000..4ddb940f71
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/NativeObjects/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'NativeObjects';
diff --git a/tests/auto/qml/parserstress/tests/ecma/Number/15.7.1.js b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.1.js
new file mode 100644
index 0000000000..34cec9f378
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.1.js
@@ -0,0 +1,88 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Number/15.7.2.js b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.2.js
new file mode 100644
index 0000000000..4c2c8a298c
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.2.js
@@ -0,0 +1,168 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Number/15.7.3.1-1.js b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.1-1.js
new file mode 100644
index 0000000000..d275f50a12
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.1-1.js
@@ -0,0 +1,71 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Number/15.7.3.1-2.js b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.1-2.js
new file mode 100644
index 0000000000..ff26a03e63
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.1-2.js
@@ -0,0 +1,71 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Number/15.7.3.1-3.js b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.1-3.js
new file mode 100644
index 0000000000..4669e969a7
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.1-3.js
@@ -0,0 +1,67 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Number/15.7.3.2-1.js b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.2-1.js
new file mode 100644
index 0000000000..35ff1b25c3
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.2-1.js
@@ -0,0 +1,65 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Number/15.7.3.2-2.js b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.2-2.js
new file mode 100644
index 0000000000..980b688bb6
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.2-2.js
@@ -0,0 +1,70 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Number/15.7.3.2-3.js b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.2-3.js
new file mode 100644
index 0000000000..2f20efe2a8
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.2-3.js
@@ -0,0 +1,67 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Number/15.7.3.2-4.js b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.2-4.js
new file mode 100644
index 0000000000..04d70ce3a9
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.2-4.js
@@ -0,0 +1,64 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Number/15.7.3.3-1.js b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.3-1.js
new file mode 100644
index 0000000000..ed7f0e88a9
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.3-1.js
@@ -0,0 +1,68 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Number/15.7.3.3-2.js b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.3-2.js
new file mode 100644
index 0000000000..2b73147c2a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.3-2.js
@@ -0,0 +1,73 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Number/15.7.3.3-3.js b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.3-3.js
new file mode 100644
index 0000000000..d0c98282dd
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.3-3.js
@@ -0,0 +1,64 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Number/15.7.3.3-4.js b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.3-4.js
new file mode 100644
index 0000000000..e9427c62f2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.3-4.js
@@ -0,0 +1,66 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Number/15.7.3.4-1.js b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.4-1.js
new file mode 100644
index 0000000000..6a6835f04d
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.4-1.js
@@ -0,0 +1,66 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Number/15.7.3.4-2.js b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.4-2.js
new file mode 100644
index 0000000000..fd1e630d54
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.4-2.js
@@ -0,0 +1,71 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Number/15.7.3.4-3.js b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.4-3.js
new file mode 100644
index 0000000000..6cf1072e20
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.4-3.js
@@ -0,0 +1,65 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Number/15.7.3.4-4.js b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.4-4.js
new file mode 100644
index 0000000000..3e1db5b9d2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.4-4.js
@@ -0,0 +1,66 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Number/15.7.3.5-1.js b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.5-1.js
new file mode 100644
index 0000000000..8bcb3e3782
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.5-1.js
@@ -0,0 +1,64 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Number/15.7.3.5-2.js b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.5-2.js
new file mode 100644
index 0000000000..e0c2c440ac
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.5-2.js
@@ -0,0 +1,70 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Number/15.7.3.5-3.js b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.5-3.js
new file mode 100644
index 0000000000..983cdd3147
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.5-3.js
@@ -0,0 +1,65 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Number/15.7.3.5-4.js b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.5-4.js
new file mode 100644
index 0000000000..acf7b0f543
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.5-4.js
@@ -0,0 +1,66 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Number/15.7.3.6-1.js b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.6-1.js
new file mode 100644
index 0000000000..466267f7d4
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.6-1.js
@@ -0,0 +1,65 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Number/15.7.3.6-2.js b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.6-2.js
new file mode 100644
index 0000000000..c3e6dbd0fb
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.6-2.js
@@ -0,0 +1,69 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Number/15.7.3.6-3.js b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.6-3.js
new file mode 100644
index 0000000000..6055f49374
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.6-3.js
@@ -0,0 +1,65 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Number/15.7.3.6-4.js b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.6-4.js
new file mode 100644
index 0000000000..75fa6ee485
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.6-4.js
@@ -0,0 +1,66 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Number/15.7.3.js b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.js
new file mode 100644
index 0000000000..bc5e7a3fa1
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.3.js
@@ -0,0 +1,69 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Number/15.7.4-1.js b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.4-1.js
new file mode 100644
index 0000000000..175835987a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.4-1.js
@@ -0,0 +1,60 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Number/15.7.4.1.js b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.4.1.js
new file mode 100644
index 0000000000..27c0a0a9e4
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.4.1.js
@@ -0,0 +1,62 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Number/15.7.4.2-1.js b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.4.2-1.js
new file mode 100644
index 0000000000..531876d980
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.4.2-1.js
@@ -0,0 +1,111 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Number/15.7.4.2-2-n.js b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.4.2-2-n.js
new file mode 100644
index 0000000000..a99b1deb45
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.4.2-2-n.js
@@ -0,0 +1,76 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Number/15.7.4.2-3-n.js b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.4.2-3-n.js
new file mode 100644
index 0000000000..f6148db1cc
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.4.2-3-n.js
@@ -0,0 +1,73 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Number/15.7.4.2-4.js b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.4.2-4.js
new file mode 100644
index 0000000000..c2fd40dd17
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.4.2-4.js
@@ -0,0 +1,70 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Number/15.7.4.3-1.js b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.4.3-1.js
new file mode 100644
index 0000000000..755e2281b3
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.4.3-1.js
@@ -0,0 +1,97 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Number/15.7.4.3-2.js b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.4.3-2.js
new file mode 100644
index 0000000000..1bfed1d4af
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.4.3-2.js
@@ -0,0 +1,65 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Number/15.7.4.3-3-n.js b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.4.3-3-n.js
new file mode 100644
index 0000000000..7df413ae48
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Number/15.7.4.3-3-n.js
@@ -0,0 +1,72 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/Number/browser.js b/tests/auto/qml/parserstress/tests/ecma/Number/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Number/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma/Number/shell.js b/tests/auto/qml/parserstress/tests/ecma/Number/shell.js
new file mode 100644
index 0000000000..03cca1d551
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Number/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'Number';
diff --git a/tests/auto/qml/parserstress/tests/ecma/ObjectObjects/15.2.1.1.js b/tests/auto/qml/parserstress/tests/ecma/ObjectObjects/15.2.1.1.js
new file mode 100644
index 0000000000..73ddd2894c
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ObjectObjects/15.2.1.1.js
@@ -0,0 +1,146 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/ObjectObjects/15.2.1.2.js b/tests/auto/qml/parserstress/tests/ecma/ObjectObjects/15.2.1.2.js
new file mode 100644
index 0000000000..9e41594430
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ObjectObjects/15.2.1.2.js
@@ -0,0 +1,81 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/ObjectObjects/15.2.2.1.js b/tests/auto/qml/parserstress/tests/ecma/ObjectObjects/15.2.2.1.js
new file mode 100644
index 0000000000..dfdfaeb4ab
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ObjectObjects/15.2.2.1.js
@@ -0,0 +1,138 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/ObjectObjects/15.2.2.2.js b/tests/auto/qml/parserstress/tests/ecma/ObjectObjects/15.2.2.2.js
new file mode 100644
index 0000000000..2a5743a826
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ObjectObjects/15.2.2.2.js
@@ -0,0 +1,74 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/ObjectObjects/15.2.3-1.js b/tests/auto/qml/parserstress/tests/ecma/ObjectObjects/15.2.3-1.js
new file mode 100644
index 0000000000..5242d7e6a5
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ObjectObjects/15.2.3-1.js
@@ -0,0 +1,64 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/ObjectObjects/15.2.3.1-1.js b/tests/auto/qml/parserstress/tests/ecma/ObjectObjects/15.2.3.1-1.js
new file mode 100644
index 0000000000..39510b6b22
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ObjectObjects/15.2.3.1-1.js
@@ -0,0 +1,69 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/ObjectObjects/15.2.3.1-2.js b/tests/auto/qml/parserstress/tests/ecma/ObjectObjects/15.2.3.1-2.js
new file mode 100644
index 0000000000..a92739f2d1
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ObjectObjects/15.2.3.1-2.js
@@ -0,0 +1,70 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/ObjectObjects/15.2.3.1-3.js b/tests/auto/qml/parserstress/tests/ecma/ObjectObjects/15.2.3.1-3.js
new file mode 100644
index 0000000000..0a82c6cd02
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ObjectObjects/15.2.3.1-3.js
@@ -0,0 +1,70 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/ObjectObjects/15.2.3.1-4.js b/tests/auto/qml/parserstress/tests/ecma/ObjectObjects/15.2.3.1-4.js
new file mode 100644
index 0000000000..86be98e1ad
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ObjectObjects/15.2.3.1-4.js
@@ -0,0 +1,70 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/ObjectObjects/15.2.3.js b/tests/auto/qml/parserstress/tests/ecma/ObjectObjects/15.2.3.js
new file mode 100644
index 0000000000..70a9605c2e
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ObjectObjects/15.2.3.js
@@ -0,0 +1,67 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/ObjectObjects/15.2.4.1.js b/tests/auto/qml/parserstress/tests/ecma/ObjectObjects/15.2.4.1.js
new file mode 100644
index 0000000000..bff668f43c
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ObjectObjects/15.2.4.1.js
@@ -0,0 +1,64 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/ObjectObjects/15.2.4.2.js b/tests/auto/qml/parserstress/tests/ecma/ObjectObjects/15.2.4.2.js
new file mode 100644
index 0000000000..c52a825bb8
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ObjectObjects/15.2.4.2.js
@@ -0,0 +1,130 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/ObjectObjects/15.2.4.3.js b/tests/auto/qml/parserstress/tests/ecma/ObjectObjects/15.2.4.3.js
new file mode 100644
index 0000000000..17c4558679
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ObjectObjects/15.2.4.3.js
@@ -0,0 +1,117 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/ObjectObjects/browser.js b/tests/auto/qml/parserstress/tests/ecma/ObjectObjects/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ObjectObjects/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma/ObjectObjects/shell.js b/tests/auto/qml/parserstress/tests/ecma/ObjectObjects/shell.js
new file mode 100644
index 0000000000..1a71207967
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/ObjectObjects/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'ObjectObjects';
diff --git a/tests/auto/qml/parserstress/tests/ecma/README b/tests/auto/qml/parserstress/tests/ecma/README
new file mode 100755
index 0000000000..91f174ab61
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/README
@@ -0,0 +1 @@
+ECMA 262 Edition 1
diff --git a/tests/auto/qml/parserstress/tests/ecma/SourceText/6-1.js b/tests/auto/qml/parserstress/tests/ecma/SourceText/6-1.js
new file mode 100644
index 0000000000..487a47e3aa
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/SourceText/6-1.js
@@ -0,0 +1,128 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/SourceText/6-2.js b/tests/auto/qml/parserstress/tests/ecma/SourceText/6-2.js
new file mode 100644
index 0000000000..4044308053
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/SourceText/6-2.js
@@ -0,0 +1,131 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/SourceText/browser.js b/tests/auto/qml/parserstress/tests/ecma/SourceText/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/SourceText/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma/SourceText/shell.js b/tests/auto/qml/parserstress/tests/ecma/SourceText/shell.js
new file mode 100644
index 0000000000..c8f9f02671
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/SourceText/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'SourceText';
diff --git a/tests/auto/qml/parserstress/tests/ecma/Statements/12.10-1.js b/tests/auto/qml/parserstress/tests/ecma/Statements/12.10-1.js
new file mode 100644
index 0000000000..7cb13789eb
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Statements/12.10-1.js
@@ -0,0 +1,151 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Statements/12.10.js b/tests/auto/qml/parserstress/tests/ecma/Statements/12.10.js
new file mode 100644
index 0000000000..b8d27c64e9
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Statements/12.10.js
@@ -0,0 +1,61 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Statements/12.2-1.js b/tests/auto/qml/parserstress/tests/ecma/Statements/12.2-1.js
new file mode 100644
index 0000000000..d6f3b97f6d
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Statements/12.2-1.js
@@ -0,0 +1,74 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Statements/12.5-1.js b/tests/auto/qml/parserstress/tests/ecma/Statements/12.5-1.js
new file mode 100644
index 0000000000..0745428c4a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Statements/12.5-1.js
@@ -0,0 +1,102 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Statements/12.5-2.js b/tests/auto/qml/parserstress/tests/ecma/Statements/12.5-2.js
new file mode 100644
index 0000000000..143edb0705
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Statements/12.5-2.js
@@ -0,0 +1,99 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Statements/12.6.1-1.js b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.1-1.js
new file mode 100644
index 0000000000..97b9afaa82
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.1-1.js
@@ -0,0 +1,74 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Statements/12.6.2-1.js b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.2-1.js
new file mode 100644
index 0000000000..2ef9378f5a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.2-1.js
@@ -0,0 +1,75 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Statements/12.6.2-2.js b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.2-2.js
new file mode 100644
index 0000000000..cc8676cd29
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.2-2.js
@@ -0,0 +1,76 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Statements/12.6.2-3.js b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.2-3.js
new file mode 100644
index 0000000000..a16b7aa18e
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.2-3.js
@@ -0,0 +1,72 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Statements/12.6.2-4.js b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.2-4.js
new file mode 100644
index 0000000000..6b1500d3a4
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.2-4.js
@@ -0,0 +1,72 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Statements/12.6.2-5.js b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.2-5.js
new file mode 100644
index 0000000000..a6f86ecc88
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.2-5.js
@@ -0,0 +1,73 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Statements/12.6.2-6.js b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.2-6.js
new file mode 100644
index 0000000000..48a4e2e607
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.2-6.js
@@ -0,0 +1,75 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Statements/12.6.2-7.js b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.2-7.js
new file mode 100644
index 0000000000..a14ced0497
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.2-7.js
@@ -0,0 +1,73 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Statements/12.6.2-8.js b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.2-8.js
new file mode 100644
index 0000000000..73d931d838
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.2-8.js
@@ -0,0 +1,71 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Statements/12.6.2-9-n.js b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.2-9-n.js
new file mode 100644
index 0000000000..3e2f942a22
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.2-9-n.js
@@ -0,0 +1,76 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Statements/12.6.3-1.js b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.3-1.js
new file mode 100644
index 0000000000..6e23b84a48
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.3-1.js
@@ -0,0 +1,63 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Statements/12.6.3-10.js b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.3-10.js
new file mode 100644
index 0000000000..0e74f14ece
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.3-10.js
@@ -0,0 +1,115 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Statements/12.6.3-11.js b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.3-11.js
new file mode 100644
index 0000000000..efc65ee14e
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.3-11.js
@@ -0,0 +1,98 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Statements/12.6.3-12.js b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.3-12.js
new file mode 100644
index 0000000000..840ca9da65
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.3-12.js
@@ -0,0 +1,103 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Statements/12.6.3-19.js b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.3-19.js
new file mode 100644
index 0000000000..5acbee7127
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.3-19.js
@@ -0,0 +1,117 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Statements/12.6.3-2.js b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.3-2.js
new file mode 100644
index 0000000000..3ed93dc9a1
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.3-2.js
@@ -0,0 +1,63 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Statements/12.6.3-3.js b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.3-3.js
new file mode 100644
index 0000000000..f52569bba2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.3-3.js
@@ -0,0 +1,73 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Statements/12.6.3-4.js b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.3-4.js
new file mode 100644
index 0000000000..c30641f8bb
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.3-4.js
@@ -0,0 +1,202 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Statements/12.6.3-5-n.js b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.3-5-n.js
new file mode 100644
index 0000000000..295d059c39
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.3-5-n.js
@@ -0,0 +1,110 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Statements/12.6.3-6-n.js b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.3-6-n.js
new file mode 100644
index 0000000000..8cb4c7f638
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.3-6-n.js
@@ -0,0 +1,109 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Statements/12.6.3-7-n.js b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.3-7-n.js
new file mode 100644
index 0000000000..871dd474cb
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.3-7-n.js
@@ -0,0 +1,110 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Statements/12.6.3-8-n.js b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.3-8-n.js
new file mode 100644
index 0000000000..b75a7b5f37
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.3-8-n.js
@@ -0,0 +1,110 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Statements/12.6.3-9-n.js b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.3-9-n.js
new file mode 100644
index 0000000000..f83a8ed65a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Statements/12.6.3-9-n.js
@@ -0,0 +1,109 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Statements/12.7-1-n.js b/tests/auto/qml/parserstress/tests/ecma/Statements/12.7-1-n.js
new file mode 100644
index 0000000000..7978f3be56
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Statements/12.7-1-n.js
@@ -0,0 +1,64 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Statements/12.8-1-n.js b/tests/auto/qml/parserstress/tests/ecma/Statements/12.8-1-n.js
new file mode 100644
index 0000000000..29f46cf29e
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Statements/12.8-1-n.js
@@ -0,0 +1,67 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Statements/12.9-1-n.js b/tests/auto/qml/parserstress/tests/ecma/Statements/12.9-1-n.js
new file mode 100644
index 0000000000..450cb66593
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Statements/12.9-1-n.js
@@ -0,0 +1,63 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Statements/browser.js b/tests/auto/qml/parserstress/tests/ecma/Statements/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Statements/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma/Statements/shell.js b/tests/auto/qml/parserstress/tests/ecma/Statements/shell.js
new file mode 100644
index 0000000000..7346f697a5
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Statements/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'Statements';
diff --git a/tests/auto/qml/parserstress/tests/ecma/String/15.5.1.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.1.js
new file mode 100644
index 0000000000..cf7ab8b420
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.1.js
@@ -0,0 +1,134 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.2.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.2.js
new file mode 100644
index 0000000000..062d31cdc2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.2.js
@@ -0,0 +1,110 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.3.1-1.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.3.1-1.js
new file mode 100644
index 0000000000..cc62c9ed51
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.3.1-1.js
@@ -0,0 +1,71 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.3.1-2.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.3.1-2.js
new file mode 100644
index 0000000000..b87137a140
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.3.1-2.js
@@ -0,0 +1,69 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.3.1-3.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.3.1-3.js
new file mode 100644
index 0000000000..f94f83db11
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.3.1-3.js
@@ -0,0 +1,66 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.3.1-4.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.3.1-4.js
new file mode 100644
index 0000000000..af8c1b9560
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.3.1-4.js
@@ -0,0 +1,66 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.3.2-1.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.3.2-1.js
new file mode 100644
index 0000000000..17e715bca0
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.3.2-1.js
@@ -0,0 +1,190 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.3.2-2.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.3.2-2.js
new file mode 100644
index 0000000000..563623e6e3
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.3.2-2.js
@@ -0,0 +1,77 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.3.2-3.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.3.2-3.js
new file mode 100644
index 0000000000..ae41742be2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.3.2-3.js
@@ -0,0 +1,121 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.3.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.3.js
new file mode 100644
index 0000000000..5370484568
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.3.js
@@ -0,0 +1,66 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.4.1.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.1.js
new file mode 100644
index 0000000000..ae8e12463d
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.1.js
@@ -0,0 +1,63 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.4.10-1.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.10-1.js
new file mode 100644
index 0000000000..2647d18cb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.10-1.js
@@ -0,0 +1,217 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.4.11-1.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.11-1.js
new file mode 100644
index 0000000000..a705f3bbda
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.11-1.js
@@ -0,0 +1,518 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.4.11-2.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.11-2.js
new file mode 100644
index 0000000000..7377dc8247
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.11-2.js
@@ -0,0 +1,515 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.4.11-3.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.11-3.js
new file mode 100644
index 0000000000..0a37dcd28a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.11-3.js
@@ -0,0 +1,514 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.4.11-4.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.11-4.js
new file mode 100644
index 0000000000..1196e61c08
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.11-4.js
@@ -0,0 +1,507 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.4.11-5.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.11-5.js
new file mode 100644
index 0000000000..eec6410200
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.11-5.js
@@ -0,0 +1,520 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.4.11-6.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.11-6.js
new file mode 100644
index 0000000000..e3cc6039d4
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.11-6.js
@@ -0,0 +1,516 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.4.12-1.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.12-1.js
new file mode 100644
index 0000000000..ecc497db48
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.12-1.js
@@ -0,0 +1,520 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.4.12-2.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.12-2.js
new file mode 100644
index 0000000000..c22b87b4dc
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.12-2.js
@@ -0,0 +1,518 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.4.12-3.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.12-3.js
new file mode 100644
index 0000000000..d9d8bc69ce
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.12-3.js
@@ -0,0 +1,559 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.4.12-4.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.12-4.js
new file mode 100644
index 0000000000..caf5663f07
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.12-4.js
@@ -0,0 +1,515 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.4.12-5.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.12-5.js
new file mode 100644
index 0000000000..2fbed42202
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.12-5.js
@@ -0,0 +1,515 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.4.2-1.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.2-1.js
new file mode 100644
index 0000000000..e607ed51e4
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.2-1.js
@@ -0,0 +1,72 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.4.2-2-n.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.2-2-n.js
new file mode 100644
index 0000000000..930c1f8136
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.2-2-n.js
@@ -0,0 +1,73 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.4.2-3.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.2-3.js
new file mode 100644
index 0000000000..1e306a06f3
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.2-3.js
@@ -0,0 +1,83 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.4.2.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.2.js
new file mode 100644
index 0000000000..0a1100fc63
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.2.js
@@ -0,0 +1,87 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.4.3-1.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.3-1.js
new file mode 100644
index 0000000000..b990876fe8
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.3-1.js
@@ -0,0 +1,72 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.4.3-2.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.3-2.js
new file mode 100644
index 0000000000..4747e013e6
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.3-2.js
@@ -0,0 +1,90 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.4.3-3-n.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.3-3-n.js
new file mode 100644
index 0000000000..bdfa52ece0
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.3-3-n.js
@@ -0,0 +1,72 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.4.4-1.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.4-1.js
new file mode 100644
index 0000000000..5dbffb1d14
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.4-1.js
@@ -0,0 +1,92 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.4.4-2.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.4-2.js
new file mode 100644
index 0000000000..c822a1d5f7
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.4-2.js
@@ -0,0 +1,136 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.4.4-3.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.4-3.js
new file mode 100644
index 0000000000..96b4759c98
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.4-3.js
@@ -0,0 +1,112 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.4.4-4.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.4-4.js
new file mode 100644
index 0000000000..bf9f7a6898
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.4-4.js
@@ -0,0 +1,124 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.4.5-1.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.5-1.js
new file mode 100644
index 0000000000..a1ba440a60
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.5-1.js
@@ -0,0 +1,87 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.4.5-2.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.5-2.js
new file mode 100644
index 0000000000..29cb76152e
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.5-2.js
@@ -0,0 +1,121 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.4.5-3.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.5-3.js
new file mode 100644
index 0000000000..46852f4022
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.5-3.js
@@ -0,0 +1,131 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.4.5-4.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.5-4.js
new file mode 100644
index 0000000000..e1d42c820f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.5-4.js
@@ -0,0 +1,75 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.4.5-5.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.5-5.js
new file mode 100644
index 0000000000..cb3ec71e25
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.5-5.js
@@ -0,0 +1,106 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.4.6-1.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.6-1.js
new file mode 100644
index 0000000000..94e34ad5ed
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.6-1.js
@@ -0,0 +1,155 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.4.6-2.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.6-2.js
new file mode 100644
index 0000000000..acaeffb38a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.6-2.js
@@ -0,0 +1,259 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.4.7-1.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.7-1.js
new file mode 100644
index 0000000000..094be2ed62
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.7-1.js
@@ -0,0 +1,219 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.4.7-2.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.7-2.js
new file mode 100644
index 0000000000..0252eae00f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.7-2.js
@@ -0,0 +1,217 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.4.8-1.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.8-1.js
new file mode 100644
index 0000000000..4aa16d5ea0
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.8-1.js
@@ -0,0 +1,232 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.4.8-2.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.8-2.js
new file mode 100644
index 0000000000..ff33e62ba6
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.8-2.js
@@ -0,0 +1,247 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.4.8-3.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.8-3.js
new file mode 100644
index 0000000000..fe10284a9c
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.8-3.js
@@ -0,0 +1,204 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.4.9-1.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.9-1.js
new file mode 100644
index 0000000000..2184c60f45
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.9-1.js
@@ -0,0 +1,202 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.4.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.js
new file mode 100644
index 0000000000..063e4e68d1
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.4.js
@@ -0,0 +1,108 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/15.5.5.1.js b/tests/auto/qml/parserstress/tests/ecma/String/15.5.5.1.js
new file mode 100644
index 0000000000..85d3d24ef2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/15.5.5.1.js
@@ -0,0 +1,88 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/String/browser.js b/tests/auto/qml/parserstress/tests/ecma/String/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma/String/shell.js b/tests/auto/qml/parserstress/tests/ecma/String/shell.js
new file mode 100644
index 0000000000..7d850446cc
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/String/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'String';
diff --git a/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.2.js b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.2.js
new file mode 100644
index 0000000000..2d428b9a9e
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.2.js
@@ -0,0 +1,138 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the 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/qml/parserstress/tests/ecma/TypeConversion/9.3-1.js b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3-1.js
new file mode 100644
index 0000000000..9994d6a7cd
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3-1.js
@@ -0,0 +1,100 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/TypeConversion/9.3.1-1.js b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3.1-1.js
new file mode 100644
index 0000000000..da3e8794c0
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3.1-1.js
@@ -0,0 +1,323 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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
+// <TAB> 0X0009 \t
+// <SP> 0X0020
+// <FF> 0X000C \f
+// <VT> 0X000B
+// <CR> 0X000D \r
+// <LF> 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/qml/parserstress/tests/ecma/TypeConversion/9.3.1-2.js b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3.1-2.js
new file mode 100644
index 0000000000..911ec84b94
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3.1-2.js
@@ -0,0 +1,87 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/TypeConversion/9.3.1-3.js b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3.1-3.js
new file mode 100644
index 0000000000..dc56427395
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3.1-3.js
@@ -0,0 +1,743 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/TypeConversion/9.3.js b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3.js
new file mode 100644
index 0000000000..c4b866e7f3
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.3.js
@@ -0,0 +1,87 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/TypeConversion/9.4-1.js b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.4-1.js
new file mode 100644
index 0000000000..e99875697a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.4-1.js
@@ -0,0 +1,112 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/TypeConversion/9.4-2.js b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.4-2.js
new file mode 100644
index 0000000000..9b26a67fac
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.4-2.js
@@ -0,0 +1,112 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/TypeConversion/9.5-2.js b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.5-2.js
new file mode 100644
index 0000000000..2773052340
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.5-2.js
@@ -0,0 +1,173 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/TypeConversion/9.6.js b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.6.js
new file mode 100644
index 0000000000..3d958b3f9d
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.6.js
@@ -0,0 +1,140 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/TypeConversion/9.7.js b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.7.js
new file mode 100644
index 0000000000..34e4857fd7
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.7.js
@@ -0,0 +1,160 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/TypeConversion/9.8.1.js b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.8.1.js
new file mode 100644
index 0000000000..897dc59f6f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.8.1.js
@@ -0,0 +1,167 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/TypeConversion/9.9-1.js b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.9-1.js
new file mode 100644
index 0000000000..ea22980767
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/9.9-1.js
@@ -0,0 +1,119 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/TypeConversion/browser.js b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma/TypeConversion/shell.js b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/shell.js
new file mode 100644
index 0000000000..49ce60f627
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/TypeConversion/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'TypeConversion';
diff --git a/tests/auto/qml/parserstress/tests/ecma/Types/8.1.js b/tests/auto/qml/parserstress/tests/ecma/Types/8.1.js
new file mode 100644
index 0000000000..7abcb93c02
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Types/8.1.js
@@ -0,0 +1,75 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Types/8.4.js b/tests/auto/qml/parserstress/tests/ecma/Types/8.4.js
new file mode 100644
index 0000000000..7d3465f8b2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Types/8.4.js
@@ -0,0 +1,130 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Types/8.6.2.1-1.js b/tests/auto/qml/parserstress/tests/ecma/Types/8.6.2.1-1.js
new file mode 100644
index 0000000000..c06999c42c
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Types/8.6.2.1-1.js
@@ -0,0 +1,78 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/Types/browser.js b/tests/auto/qml/parserstress/tests/ecma/Types/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Types/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma/Types/shell.js b/tests/auto/qml/parserstress/tests/ecma/Types/shell.js
new file mode 100644
index 0000000000..a16b996e00
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/Types/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'Types';
diff --git a/tests/auto/qml/parserstress/tests/ecma/browser.js b/tests/auto/qml/parserstress/tests/ecma/browser.js
new file mode 100644
index 0000000000..60e48ceed8
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/browser.js
@@ -0,0 +1,62 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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:
+ * <script src="./../shell.js"></script>
+ * <script src="./../browser.js"></script>
+ * <script src="./mytest.js"></script>
+ */
+
+/*
+ * 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/qml/parserstress/tests/ecma/extensions/10.1.4-9.js b/tests/auto/qml/parserstress/tests/ecma/extensions/10.1.4-9.js
new file mode 100644
index 0000000000..91982de20c
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/extensions/10.1.4-9.js
@@ -0,0 +1,110 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/extensions/10.1.6.js b/tests/auto/qml/parserstress/tests/ecma/extensions/10.1.6.js
new file mode 100644
index 0000000000..99fd4a7ff1
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/extensions/10.1.6.js
@@ -0,0 +1,127 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/extensions/10.1.8-1.js b/tests/auto/qml/parserstress/tests/ecma/extensions/10.1.8-1.js
new file mode 100644
index 0000000000..adfc8d5df5
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/extensions/10.1.8-1.js
@@ -0,0 +1,135 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/extensions/11.6.1-1.js b/tests/auto/qml/parserstress/tests/ecma/extensions/11.6.1-1.js
new file mode 100644
index 0000000000..e467157441
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/extensions/11.6.1-1.js
@@ -0,0 +1,145 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/extensions/11.6.1-2.js b/tests/auto/qml/parserstress/tests/ecma/extensions/11.6.1-2.js
new file mode 100644
index 0000000000..a486885b7f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/extensions/11.6.1-2.js
@@ -0,0 +1,136 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/extensions/11.6.1-3.js b/tests/auto/qml/parserstress/tests/ecma/extensions/11.6.1-3.js
new file mode 100644
index 0000000000..7d66e58530
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/extensions/11.6.1-3.js
@@ -0,0 +1,137 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/extensions/11.6.2-1.js b/tests/auto/qml/parserstress/tests/ecma/extensions/11.6.2-1.js
new file mode 100644
index 0000000000..be8a6f6c98
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/extensions/11.6.2-1.js
@@ -0,0 +1,124 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/extensions/15-1.js b/tests/auto/qml/parserstress/tests/ecma/extensions/15-1.js
new file mode 100644
index 0000000000..fc037873a5
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/extensions/15-1.js
@@ -0,0 +1,94 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/extensions/15-2.js b/tests/auto/qml/parserstress/tests/ecma/extensions/15-2.js
new file mode 100644
index 0000000000..e403e46e8e
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/extensions/15-2.js
@@ -0,0 +1,77 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/extensions/15.1.2.1-1.js b/tests/auto/qml/parserstress/tests/ecma/extensions/15.1.2.1-1.js
new file mode 100644
index 0000000000..c3fe679e5e
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/extensions/15.1.2.1-1.js
@@ -0,0 +1,88 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/extensions/15.2.1.1.js b/tests/auto/qml/parserstress/tests/ecma/extensions/15.2.1.1.js
new file mode 100644
index 0000000000..f4f821877d
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/extensions/15.2.1.1.js
@@ -0,0 +1,82 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/extensions/15.2.3-1.js b/tests/auto/qml/parserstress/tests/ecma/extensions/15.2.3-1.js
new file mode 100644
index 0000000000..6d49db2481
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/extensions/15.2.3-1.js
@@ -0,0 +1,64 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/extensions/15.2.4.js b/tests/auto/qml/parserstress/tests/ecma/extensions/15.2.4.js
new file mode 100644
index 0000000000..df55e0894a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/extensions/15.2.4.js
@@ -0,0 +1,66 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/extensions/15.3.1.1-1.js b/tests/auto/qml/parserstress/tests/ecma/extensions/15.3.1.1-1.js
new file mode 100644
index 0000000000..169cf50851
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/extensions/15.3.1.1-1.js
@@ -0,0 +1,82 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/extensions/15.3.1.1-2.js b/tests/auto/qml/parserstress/tests/ecma/extensions/15.3.1.1-2.js
new file mode 100644
index 0000000000..42165465bc
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/extensions/15.3.1.1-2.js
@@ -0,0 +1,82 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/extensions/15.3.2.1-1.js b/tests/auto/qml/parserstress/tests/ecma/extensions/15.3.2.1-1.js
new file mode 100644
index 0000000000..fab359211f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/extensions/15.3.2.1-1.js
@@ -0,0 +1,72 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/extensions/15.3.2.1-2.js b/tests/auto/qml/parserstress/tests/ecma/extensions/15.3.2.1-2.js
new file mode 100644
index 0000000000..0b37e21028
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/extensions/15.3.2.1-2.js
@@ -0,0 +1,72 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/extensions/15.3.3.1-1.js b/tests/auto/qml/parserstress/tests/ecma/extensions/15.3.3.1-1.js
new file mode 100644
index 0000000000..d4f22ff257
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/extensions/15.3.3.1-1.js
@@ -0,0 +1,67 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/extensions/15.4.3.js b/tests/auto/qml/parserstress/tests/ecma/extensions/15.4.3.js
new file mode 100644
index 0000000000..8cbf949855
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/extensions/15.4.3.js
@@ -0,0 +1,63 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/extensions/15.5.3.js b/tests/auto/qml/parserstress/tests/ecma/extensions/15.5.3.js
new file mode 100644
index 0000000000..c25398c4f4
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/extensions/15.5.3.js
@@ -0,0 +1,66 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/extensions/15.5.4.2.js b/tests/auto/qml/parserstress/tests/ecma/extensions/15.5.4.2.js
new file mode 100644
index 0000000000..ebf4d03781
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/extensions/15.5.4.2.js
@@ -0,0 +1,59 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/extensions/15.5.4.4-4.js b/tests/auto/qml/parserstress/tests/ecma/extensions/15.5.4.4-4.js
new file mode 100644
index 0000000000..c2e115e0c6
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/extensions/15.5.4.4-4.js
@@ -0,0 +1,107 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/extensions/15.5.4.5-6.js b/tests/auto/qml/parserstress/tests/ecma/extensions/15.5.4.5-6.js
new file mode 100644
index 0000000000..4eadc66c04
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/extensions/15.5.4.5-6.js
@@ -0,0 +1,94 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/extensions/15.5.4.7-3.js b/tests/auto/qml/parserstress/tests/ecma/extensions/15.5.4.7-3.js
new file mode 100644
index 0000000000..c5832fd477
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/extensions/15.5.4.7-3.js
@@ -0,0 +1,161 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/extensions/15.6.3.1-5.js b/tests/auto/qml/parserstress/tests/ecma/extensions/15.6.3.1-5.js
new file mode 100644
index 0000000000..b9f35b8225
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/extensions/15.6.3.1-5.js
@@ -0,0 +1,58 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/extensions/15.6.3.js b/tests/auto/qml/parserstress/tests/ecma/extensions/15.6.3.js
new file mode 100644
index 0000000000..0ae48c59f2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/extensions/15.6.3.js
@@ -0,0 +1,65 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/extensions/15.6.4-2.js b/tests/auto/qml/parserstress/tests/ecma/extensions/15.6.4-2.js
new file mode 100644
index 0000000000..7ca222235f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/extensions/15.6.4-2.js
@@ -0,0 +1,66 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/extensions/15.7.3.js b/tests/auto/qml/parserstress/tests/ecma/extensions/15.7.3.js
new file mode 100644
index 0000000000..84e362c2db
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/extensions/15.7.3.js
@@ -0,0 +1,69 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/extensions/15.7.4.js b/tests/auto/qml/parserstress/tests/ecma/extensions/15.7.4.js
new file mode 100644
index 0000000000..733b937e55
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/extensions/15.7.4.js
@@ -0,0 +1,90 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/extensions/15.8-1.js b/tests/auto/qml/parserstress/tests/ecma/extensions/15.8-1.js
new file mode 100644
index 0000000000..0f51cf5e61
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/extensions/15.8-1.js
@@ -0,0 +1,84 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/extensions/15.9.5.js b/tests/auto/qml/parserstress/tests/ecma/extensions/15.9.5.js
new file mode 100644
index 0000000000..54e6bb6f0f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/extensions/15.9.5.js
@@ -0,0 +1,76 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use 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/qml/parserstress/tests/ecma/extensions/8.6.2.1-1.js b/tests/auto/qml/parserstress/tests/ecma/extensions/8.6.2.1-1.js
new file mode 100644
index 0000000000..a99bb01ee6
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/extensions/8.6.2.1-1.js
@@ -0,0 +1,98 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/extensions/9.9-1.js b/tests/auto/qml/parserstress/tests/ecma/extensions/9.9-1.js
new file mode 100644
index 0000000000..0df44013cd
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/extensions/9.9-1.js
@@ -0,0 +1,102 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may 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/qml/parserstress/tests/ecma/extensions/browser.js b/tests/auto/qml/parserstress/tests/ecma/extensions/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/extensions/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma/extensions/shell.js b/tests/auto/qml/parserstress/tests/ecma/extensions/shell.js
new file mode 100644
index 0000000000..3f52cffbc0
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/extensions/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'extensions';
diff --git a/tests/auto/qml/parserstress/tests/ecma/jsref.js b/tests/auto/qml/parserstress/tests/ecma/jsref.js
new file mode 100644
index 0000000000..1416643e1e
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/jsref.js
@@ -0,0 +1,634 @@
+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/qml/parserstress/tests/ecma/shell.js b/tests/auto/qml/parserstress/tests/ecma/shell.js
new file mode 100644
index 0000000000..1c012601e6
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/shell.js
@@ -0,0 +1,577 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient 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/qml/parserstress/tests/ecma/template.js b/tests/auto/qml/parserstress/tests/ecma/template.js
new file mode 100644
index 0000000000..8f11686890
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma/template.js
@@ -0,0 +1,70 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/boolean-001.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/boolean-001.js
new file mode 100644
index 0000000000..7462df2f98
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/boolean-001.js
@@ -0,0 +1,80 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/boolean-002.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/boolean-002.js
new file mode 100644
index 0000000000..813e11cd39
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/boolean-002.js
@@ -0,0 +1,84 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/browser.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/date-001.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/date-001.js
new file mode 100644
index 0000000000..041bbb523c
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/date-001.js
@@ -0,0 +1,93 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/date-002.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/date-002.js
new file mode 100644
index 0000000000..4fb11b38d9
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/date-002.js
@@ -0,0 +1,87 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/date-003.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/date-003.js
new file mode 100644
index 0000000000..95129177c7
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/date-003.js
@@ -0,0 +1,89 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/date-004.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/date-004.js
new file mode 100644
index 0000000000..d77bd1c272
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/date-004.js
@@ -0,0 +1,83 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/exception-001.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/exception-001.js
new file mode 100644
index 0000000000..3762c5b3c4
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/exception-001.js
@@ -0,0 +1,78 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/exception-002.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/exception-002.js
new file mode 100644
index 0000000000..e5328b8b81
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/exception-002.js
@@ -0,0 +1,78 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/exception-003.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/exception-003.js
new file mode 100644
index 0000000000..c5956ffc95
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/exception-003.js
@@ -0,0 +1,82 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/exception-004.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/exception-004.js
new file mode 100644
index 0000000000..15a07a806f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/exception-004.js
@@ -0,0 +1,78 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/exception-005.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/exception-005.js
new file mode 100644
index 0000000000..e5532ff40c
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/exception-005.js
@@ -0,0 +1,78 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/exception-006.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/exception-006.js
new file mode 100644
index 0000000000..b37b52becb
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/exception-006.js
@@ -0,0 +1,89 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/exception-007.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/exception-007.js
new file mode 100644
index 0000000000..a63ed0e3f8
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/exception-007.js
@@ -0,0 +1,90 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/exception-008.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/exception-008.js
new file mode 100644
index 0000000000..39326183a4
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/exception-008.js
@@ -0,0 +1,77 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/exception-009.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/exception-009.js
new file mode 100644
index 0000000000..bd5cbe7f40
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/exception-009.js
@@ -0,0 +1,86 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/exception-010-n.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/exception-010-n.js
new file mode 100644
index 0000000000..cb28d635a6
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/exception-010-n.js
@@ -0,0 +1,61 @@
+/* -*- 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/qml/parserstress/tests/ecma_2/Exceptions/exception-011-n.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/exception-011-n.js
new file mode 100644
index 0000000000..ec5302c247
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/exception-011-n.js
@@ -0,0 +1,62 @@
+/* -*- 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/qml/parserstress/tests/ecma_2/Exceptions/expression-001.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-001.js
new file mode 100644
index 0000000000..c3ae4f21e6
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-001.js
@@ -0,0 +1,83 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/expression-002.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-002.js
new file mode 100644
index 0000000000..2f060936ae
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-002.js
@@ -0,0 +1,93 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/expression-003.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-003.js
new file mode 100644
index 0000000000..5007b83adf
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-003.js
@@ -0,0 +1,88 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/expression-004.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-004.js
new file mode 100644
index 0000000000..2befdd10f3
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-004.js
@@ -0,0 +1,82 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/expression-005.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-005.js
new file mode 100644
index 0000000000..2d76593ea2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-005.js
@@ -0,0 +1,74 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/expression-006.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-006.js
new file mode 100644
index 0000000000..eb21e0308c
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-006.js
@@ -0,0 +1,79 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/expression-007.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-007.js
new file mode 100644
index 0000000000..a2305be16d
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-007.js
@@ -0,0 +1,77 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/expression-008.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-008.js
new file mode 100644
index 0000000000..c85310f957
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-008.js
@@ -0,0 +1,74 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/expression-009.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-009.js
new file mode 100644
index 0000000000..feec2cd052
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-009.js
@@ -0,0 +1,75 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/expression-010.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-010.js
new file mode 100644
index 0000000000..e0b38a4838
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-010.js
@@ -0,0 +1,76 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/expression-011.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-011.js
new file mode 100644
index 0000000000..75f872480d
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-011.js
@@ -0,0 +1,76 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/expression-012.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-012.js
new file mode 100644
index 0000000000..5223abd480
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-012.js
@@ -0,0 +1,77 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/expression-013.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-013.js
new file mode 100644
index 0000000000..10ad726653
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-013.js
@@ -0,0 +1,77 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/expression-014.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-014.js
new file mode 100644
index 0000000000..fadca81c7a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-014.js
@@ -0,0 +1,79 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/expression-015.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-015.js
new file mode 100644
index 0000000000..2bd2b8d094
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-015.js
@@ -0,0 +1,73 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/expression-016.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-016.js
new file mode 100644
index 0000000000..3c91495f3c
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-016.js
@@ -0,0 +1,73 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/expression-017.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-017.js
new file mode 100644
index 0000000000..4e762a54a9
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-017.js
@@ -0,0 +1,73 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/expression-019.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-019.js
new file mode 100644
index 0000000000..11ee3a0063
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/expression-019.js
@@ -0,0 +1,77 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/function-001.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/function-001.js
new file mode 100644
index 0000000000..d5f7b452e2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/function-001.js
@@ -0,0 +1,86 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/global-001.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/global-001.js
new file mode 100644
index 0000000000..a186a51e64
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/global-001.js
@@ -0,0 +1,78 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/global-002.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/global-002.js
new file mode 100644
index 0000000000..c4ef143529
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/global-002.js
@@ -0,0 +1,78 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-001.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-001.js
new file mode 100644
index 0000000000..cc2e3a46aa
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-001.js
@@ -0,0 +1,85 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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 <LF> \n
+ \u000D carriage return <CR> \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/qml/parserstress/tests/ecma_2/Exceptions/lexical-002.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-002.js
new file mode 100644
index 0000000000..f7f691a049
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-002.js
@@ -0,0 +1,85 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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 <LF> \n
+ \u000D carriage return <CR> \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/qml/parserstress/tests/ecma_2/Exceptions/lexical-003.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-003.js
new file mode 100644
index 0000000000..482382eeed
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-003.js
@@ -0,0 +1,76 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-004.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-004.js
new file mode 100644
index 0000000000..ccf6124109
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-004.js
@@ -0,0 +1,85 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-005.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-005.js
new file mode 100644
index 0000000000..44b2ea9c87
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-005.js
@@ -0,0 +1,85 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-006.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-006.js
new file mode 100644
index 0000000000..6f693d8ad2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-006.js
@@ -0,0 +1,91 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-007.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-007.js
new file mode 100644
index 0000000000..b6d5152ea0
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-007.js
@@ -0,0 +1,84 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-008.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-008.js
new file mode 100644
index 0000000000..eed455c243
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-008.js
@@ -0,0 +1,86 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-009.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-009.js
new file mode 100644
index 0000000000..d796574809
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-009.js
@@ -0,0 +1,86 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-010.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-010.js
new file mode 100644
index 0000000000..059b5a06be
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-010.js
@@ -0,0 +1,84 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-011.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-011.js
new file mode 100644
index 0000000000..7f01041c41
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-011.js
@@ -0,0 +1,95 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-012.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-012.js
new file mode 100644
index 0000000000..e55b6eb30f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-012.js
@@ -0,0 +1,86 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-013.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-013.js
new file mode 100644
index 0000000000..fbbf20b263
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-013.js
@@ -0,0 +1,86 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-014.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-014.js
new file mode 100644
index 0000000000..880d2800e5
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-014.js
@@ -0,0 +1,95 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-015.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-015.js
new file mode 100644
index 0000000000..a15a2be544
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-015.js
@@ -0,0 +1,86 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-016.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-016.js
new file mode 100644
index 0000000000..021594d052
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-016.js
@@ -0,0 +1,95 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-017.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-017.js
new file mode 100644
index 0000000000..b89a526229
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-017.js
@@ -0,0 +1,87 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-018.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-018.js
new file mode 100644
index 0000000000..18773dafe6
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-018.js
@@ -0,0 +1,86 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-019.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-019.js
new file mode 100644
index 0000000000..c1c34a93c1
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-019.js
@@ -0,0 +1,86 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-020.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-020.js
new file mode 100644
index 0000000000..e82e1e50b9
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-020.js
@@ -0,0 +1,86 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-021.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-021.js
new file mode 100644
index 0000000000..47a0725a09
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-021.js
@@ -0,0 +1,95 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-022.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-022.js
new file mode 100644
index 0000000000..75d72aa5b6
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-022.js
@@ -0,0 +1,86 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-023.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-023.js
new file mode 100644
index 0000000000..aa89c04782
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-023.js
@@ -0,0 +1,85 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-024.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-024.js
new file mode 100644
index 0000000000..7c1f22f745
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-024.js
@@ -0,0 +1,92 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-025.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-025.js
new file mode 100644
index 0000000000..f1c7b93daf
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-025.js
@@ -0,0 +1,92 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-026.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-026.js
new file mode 100644
index 0000000000..31b5aaaf61
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-026.js
@@ -0,0 +1,92 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-027.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-027.js
new file mode 100644
index 0000000000..573025b591
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-027.js
@@ -0,0 +1,94 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-028.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-028.js
new file mode 100644
index 0000000000..1b76a22169
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-028.js
@@ -0,0 +1,92 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-029.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-029.js
new file mode 100644
index 0000000000..f978b8ef89
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-029.js
@@ -0,0 +1,92 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-030.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-030.js
new file mode 100644
index 0000000000..3796551698
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-030.js
@@ -0,0 +1,92 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-031.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-031.js
new file mode 100644
index 0000000000..13379fed01
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-031.js
@@ -0,0 +1,92 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-032.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-032.js
new file mode 100644
index 0000000000..48e6e9aac5
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-032.js
@@ -0,0 +1,92 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-033.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-033.js
new file mode 100644
index 0000000000..cc223c2282
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-033.js
@@ -0,0 +1,92 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-034.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-034.js
new file mode 100644
index 0000000000..4d3c7d5fc0
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-034.js
@@ -0,0 +1,91 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-035.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-035.js
new file mode 100644
index 0000000000..2a61b437ba
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-035.js
@@ -0,0 +1,92 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-036.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-036.js
new file mode 100644
index 0000000000..a1923b7303
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-036.js
@@ -0,0 +1,92 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-037.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-037.js
new file mode 100644
index 0000000000..e3cd75bd60
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-037.js
@@ -0,0 +1,92 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-038.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-038.js
new file mode 100644
index 0000000000..1bf8c6c4e4
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-038.js
@@ -0,0 +1,92 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-039.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-039.js
new file mode 100644
index 0000000000..2f193af89a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-039.js
@@ -0,0 +1,79 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-040.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-040.js
new file mode 100644
index 0000000000..f5ba3533dd
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-040.js
@@ -0,0 +1,79 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-041.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-041.js
new file mode 100644
index 0000000000..06d63bddb3
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-041.js
@@ -0,0 +1,81 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-042.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-042.js
new file mode 100644
index 0000000000..c2cedb0b81
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-042.js
@@ -0,0 +1,82 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-047.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-047.js
new file mode 100644
index 0000000000..e809c24149
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-047.js
@@ -0,0 +1,83 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-048.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-048.js
new file mode 100644
index 0000000000..18054d4328
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-048.js
@@ -0,0 +1,77 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-049.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-049.js
new file mode 100644
index 0000000000..e4ce840829
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-049.js
@@ -0,0 +1,82 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-050.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-050.js
new file mode 100644
index 0000000000..d9161c4b8f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-050.js
@@ -0,0 +1,78 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-051.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-051.js
new file mode 100644
index 0000000000..97ccbc6b43
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-051.js
@@ -0,0 +1,78 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-052.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-052.js
new file mode 100644
index 0000000000..20d2d3c254
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-052.js
@@ -0,0 +1,80 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-053.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-053.js
new file mode 100644
index 0000000000..4e64fa1322
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-053.js
@@ -0,0 +1,78 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/lexical-054.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-054.js
new file mode 100644
index 0000000000..3e25c36ef8
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/lexical-054.js
@@ -0,0 +1,79 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/number-001.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/number-001.js
new file mode 100644
index 0000000000..eb49a5b9bd
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/number-001.js
@@ -0,0 +1,86 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/number-002.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/number-002.js
new file mode 100644
index 0000000000..fef61fd527
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/number-002.js
@@ -0,0 +1,81 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/number-003.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/number-003.js
new file mode 100644
index 0000000000..46920b7072
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/number-003.js
@@ -0,0 +1,83 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/shell.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/shell.js
new file mode 100644
index 0000000000..6c671f1eea
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'Exceptions';
diff --git a/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/statement-001.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/statement-001.js
new file mode 100644
index 0000000000..98e3d61a0c
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/statement-001.js
@@ -0,0 +1,80 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/statement-002.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/statement-002.js
new file mode 100644
index 0000000000..da9931e9ab
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/statement-002.js
@@ -0,0 +1,102 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/statement-003.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/statement-003.js
new file mode 100644
index 0000000000..d51083c4cf
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/statement-003.js
@@ -0,0 +1,113 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/statement-004.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/statement-004.js
new file mode 100644
index 0000000000..8b9789a929
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/statement-004.js
@@ -0,0 +1,85 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/statement-005.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/statement-005.js
new file mode 100644
index 0000000000..62a8c45d92
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/statement-005.js
@@ -0,0 +1,84 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/statement-006.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/statement-006.js
new file mode 100644
index 0000000000..ec5ba97576
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/statement-006.js
@@ -0,0 +1,84 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/statement-007.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/statement-007.js
new file mode 100644
index 0000000000..bb367c9924
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/statement-007.js
@@ -0,0 +1,75 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/statement-008.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/statement-008.js
new file mode 100644
index 0000000000..54ab39a9c9
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/statement-008.js
@@ -0,0 +1,75 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/statement-009.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/statement-009.js
new file mode 100644
index 0000000000..a63bd84e8e
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/statement-009.js
@@ -0,0 +1,74 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/string-001.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/string-001.js
new file mode 100644
index 0000000000..551030db33
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/string-001.js
@@ -0,0 +1,86 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Exceptions/string-002.js b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/string-002.js
new file mode 100644
index 0000000000..785e339080
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Exceptions/string-002.js
@@ -0,0 +1,85 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Expressions/StrictEquality-001.js b/tests/auto/qml/parserstress/tests/ecma_2/Expressions/StrictEquality-001.js
new file mode 100644
index 0000000000..db5c403d3d
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Expressions/StrictEquality-001.js
@@ -0,0 +1,106 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Expressions/browser.js b/tests/auto/qml/parserstress/tests/ecma_2/Expressions/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Expressions/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma_2/Expressions/shell.js b/tests/auto/qml/parserstress/tests/ecma_2/Expressions/shell.js
new file mode 100644
index 0000000000..8f5d1129d5
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Expressions/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'Expressions';
diff --git a/tests/auto/qml/parserstress/tests/ecma_2/FunctionObjects/apply-001-n.js b/tests/auto/qml/parserstress/tests/ecma_2/FunctionObjects/apply-001-n.js
new file mode 100644
index 0000000000..e58d087121
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/FunctionObjects/apply-001-n.js
@@ -0,0 +1,65 @@
+/* -*- 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/qml/parserstress/tests/ecma_2/FunctionObjects/browser.js b/tests/auto/qml/parserstress/tests/ecma_2/FunctionObjects/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/FunctionObjects/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma_2/FunctionObjects/call-1.js b/tests/auto/qml/parserstress/tests/ecma_2/FunctionObjects/call-1.js
new file mode 100644
index 0000000000..283e323797
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/FunctionObjects/call-1.js
@@ -0,0 +1,75 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/FunctionObjects/shell.js b/tests/auto/qml/parserstress/tests/ecma_2/FunctionObjects/shell.js
new file mode 100644
index 0000000000..27aa7b1318
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/FunctionObjects/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'FunctionObjects';
diff --git a/tests/auto/qml/parserstress/tests/ecma_2/LexicalConventions/browser.js b/tests/auto/qml/parserstress/tests/ecma_2/LexicalConventions/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/LexicalConventions/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma_2/LexicalConventions/keywords-001.js b/tests/auto/qml/parserstress/tests/ecma_2/LexicalConventions/keywords-001.js
new file mode 100644
index 0000000000..7362613783
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/LexicalConventions/keywords-001.js
@@ -0,0 +1,81 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/LexicalConventions/regexp-literals-001.js b/tests/auto/qml/parserstress/tests/ecma_2/LexicalConventions/regexp-literals-001.js
new file mode 100644
index 0000000000..caa50fe363
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/LexicalConventions/regexp-literals-001.js
@@ -0,0 +1,77 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/LexicalConventions/regexp-literals-002.js b/tests/auto/qml/parserstress/tests/ecma_2/LexicalConventions/regexp-literals-002.js
new file mode 100644
index 0000000000..911b5d117a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/LexicalConventions/regexp-literals-002.js
@@ -0,0 +1,61 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/LexicalConventions/shell.js b/tests/auto/qml/parserstress/tests/ecma_2/LexicalConventions/shell.js
new file mode 100644
index 0000000000..4e1d61d68a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/LexicalConventions/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'LexicalConventions';
diff --git a/tests/auto/qml/parserstress/tests/ecma_2/README b/tests/auto/qml/parserstress/tests/ecma_2/README
new file mode 100755
index 0000000000..6da6cdd514
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/README
@@ -0,0 +1 @@
+ECMA 262 Edition 2
diff --git a/tests/auto/qml/parserstress/tests/ecma_2/RegExp/browser.js b/tests/auto/qml/parserstress/tests/ecma_2/RegExp/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/RegExp/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma_2/RegExp/constructor-001.js b/tests/auto/qml/parserstress/tests/ecma_2/RegExp/constructor-001.js
new file mode 100644
index 0000000000..f1dba13b06
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/RegExp/constructor-001.js
@@ -0,0 +1,99 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/RegExp/exec-001.js b/tests/auto/qml/parserstress/tests/ecma_2/RegExp/exec-001.js
new file mode 100644
index 0000000000..2d1bab472c
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/RegExp/exec-001.js
@@ -0,0 +1,73 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/RegExp/exec-002.js b/tests/auto/qml/parserstress/tests/ecma_2/RegExp/exec-002.js
new file mode 100644
index 0000000000..026f27d9d4
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/RegExp/exec-002.js
@@ -0,0 +1,221 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/RegExp/function-001.js b/tests/auto/qml/parserstress/tests/ecma_2/RegExp/function-001.js
new file mode 100644
index 0000000000..8b219b935b
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/RegExp/function-001.js
@@ -0,0 +1,99 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/RegExp/hex-001.js b/tests/auto/qml/parserstress/tests/ecma_2/RegExp/hex-001.js
new file mode 100644
index 0000000000..3e85ac7abf
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/RegExp/hex-001.js
@@ -0,0 +1,102 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/RegExp/multiline-001.js b/tests/auto/qml/parserstress/tests/ecma_2/RegExp/multiline-001.js
new file mode 100644
index 0000000000..102f91fcd4
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/RegExp/multiline-001.js
@@ -0,0 +1,101 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/RegExp/octal-001.js b/tests/auto/qml/parserstress/tests/ecma_2/RegExp/octal-001.js
new file mode 100644
index 0000000000..1c520750ce
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/RegExp/octal-001.js
@@ -0,0 +1,111 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/RegExp/octal-002.js b/tests/auto/qml/parserstress/tests/ecma_2/RegExp/octal-002.js
new file mode 100644
index 0000000000..b654e5e68a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/RegExp/octal-002.js
@@ -0,0 +1,126 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/RegExp/octal-003.js b/tests/auto/qml/parserstress/tests/ecma_2/RegExp/octal-003.js
new file mode 100644
index 0000000000..ee07ca602b
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/RegExp/octal-003.js
@@ -0,0 +1,120 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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'>, <nul>, <'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: <any-character>, <'\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/qml/parserstress/tests/ecma_2/RegExp/properties-001.js b/tests/auto/qml/parserstress/tests/ecma_2/RegExp/properties-001.js
new file mode 100644
index 0000000000..7d2913cc53
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/RegExp/properties-001.js
@@ -0,0 +1,124 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/RegExp/properties-002.js b/tests/auto/qml/parserstress/tests/ecma_2/RegExp/properties-002.js
new file mode 100644
index 0000000000..1fcfd8d219
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/RegExp/properties-002.js
@@ -0,0 +1,162 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/RegExp/regexp-enumerate-001.js b/tests/auto/qml/parserstress/tests/ecma_2/RegExp/regexp-enumerate-001.js
new file mode 100644
index 0000000000..c26a1216ea
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/RegExp/regexp-enumerate-001.js
@@ -0,0 +1,121 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/RegExp/regress-001.js b/tests/auto/qml/parserstress/tests/ecma_2/RegExp/regress-001.js
new file mode 100644
index 0000000000..219ce245ee
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/RegExp/regress-001.js
@@ -0,0 +1,78 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/RegExp/shell.js b/tests/auto/qml/parserstress/tests/ecma_2/RegExp/shell.js
new file mode 100644
index 0000000000..9b4657d963
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/RegExp/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'RegExp';
diff --git a/tests/auto/qml/parserstress/tests/ecma_2/RegExp/unicode-001.js b/tests/auto/qml/parserstress/tests/ecma_2/RegExp/unicode-001.js
new file mode 100644
index 0000000000..79a3212a2e
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/RegExp/unicode-001.js
@@ -0,0 +1,92 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Statements/browser.js b/tests/auto/qml/parserstress/tests/ecma_2/Statements/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Statements/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma_2/Statements/dowhile-001.js b/tests/auto/qml/parserstress/tests/ecma_2/Statements/dowhile-001.js
new file mode 100644
index 0000000000..8cfdc25dd6
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Statements/dowhile-001.js
@@ -0,0 +1,77 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Statements/dowhile-002.js b/tests/auto/qml/parserstress/tests/ecma_2/Statements/dowhile-002.js
new file mode 100644
index 0000000000..ca53dff899
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Statements/dowhile-002.js
@@ -0,0 +1,104 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Statements/dowhile-003.js b/tests/auto/qml/parserstress/tests/ecma_2/Statements/dowhile-003.js
new file mode 100644
index 0000000000..598f655f8d
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Statements/dowhile-003.js
@@ -0,0 +1,96 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Statements/dowhile-004.js b/tests/auto/qml/parserstress/tests/ecma_2/Statements/dowhile-004.js
new file mode 100644
index 0000000000..eb8e0c1b72
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Statements/dowhile-004.js
@@ -0,0 +1,100 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Statements/dowhile-005.js b/tests/auto/qml/parserstress/tests/ecma_2/Statements/dowhile-005.js
new file mode 100644
index 0000000000..e4096f0d25
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Statements/dowhile-005.js
@@ -0,0 +1,106 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Statements/dowhile-006.js b/tests/auto/qml/parserstress/tests/ecma_2/Statements/dowhile-006.js
new file mode 100644
index 0000000000..c8ad46f629
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Statements/dowhile-006.js
@@ -0,0 +1,122 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Statements/dowhile-007.js b/tests/auto/qml/parserstress/tests/ecma_2/Statements/dowhile-007.js
new file mode 100644
index 0000000000..5d148095d1
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Statements/dowhile-007.js
@@ -0,0 +1,130 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Statements/forin-001.js b/tests/auto/qml/parserstress/tests/ecma_2/Statements/forin-001.js
new file mode 100644
index 0000000000..0f20f6e953
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Statements/forin-001.js
@@ -0,0 +1,330 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Statements/forin-002.js b/tests/auto/qml/parserstress/tests/ecma_2/Statements/forin-002.js
new file mode 100644
index 0000000000..524bf38b9a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Statements/forin-002.js
@@ -0,0 +1,109 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Statements/if-001.js b/tests/auto/qml/parserstress/tests/ecma_2/Statements/if-001.js
new file mode 100644
index 0000000000..439410c9a6
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Statements/if-001.js
@@ -0,0 +1,75 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Statements/label-001.js b/tests/auto/qml/parserstress/tests/ecma_2/Statements/label-001.js
new file mode 100644
index 0000000000..07bdeb6b81
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Statements/label-001.js
@@ -0,0 +1,75 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Statements/label-002.js b/tests/auto/qml/parserstress/tests/ecma_2/Statements/label-002.js
new file mode 100644
index 0000000000..83b114d3f2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Statements/label-002.js
@@ -0,0 +1,89 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Statements/shell.js b/tests/auto/qml/parserstress/tests/ecma_2/Statements/shell.js
new file mode 100644
index 0000000000..7346f697a5
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Statements/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'Statements';
diff --git a/tests/auto/qml/parserstress/tests/ecma_2/Statements/switch-001.js b/tests/auto/qml/parserstress/tests/ecma_2/Statements/switch-001.js
new file mode 100644
index 0000000000..22ab0a7b60
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Statements/switch-001.js
@@ -0,0 +1,98 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Statements/switch-002.js b/tests/auto/qml/parserstress/tests/ecma_2/Statements/switch-002.js
new file mode 100644
index 0000000000..6cb5491beb
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Statements/switch-002.js
@@ -0,0 +1,96 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Statements/switch-003.js b/tests/auto/qml/parserstress/tests/ecma_2/Statements/switch-003.js
new file mode 100644
index 0000000000..27ed593bfe
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Statements/switch-003.js
@@ -0,0 +1,90 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Statements/switch-004.js b/tests/auto/qml/parserstress/tests/ecma_2/Statements/switch-004.js
new file mode 100644
index 0000000000..e7605222d6
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Statements/switch-004.js
@@ -0,0 +1,127 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Statements/try-001.js b/tests/auto/qml/parserstress/tests/ecma_2/Statements/try-001.js
new file mode 100644
index 0000000000..c7b430dabe
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Statements/try-001.js
@@ -0,0 +1,118 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Statements/try-003.js b/tests/auto/qml/parserstress/tests/ecma_2/Statements/try-003.js
new file mode 100644
index 0000000000..2c39aac243
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Statements/try-003.js
@@ -0,0 +1,115 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Statements/try-004.js b/tests/auto/qml/parserstress/tests/ecma_2/Statements/try-004.js
new file mode 100644
index 0000000000..d41903de18
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Statements/try-004.js
@@ -0,0 +1,87 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Statements/try-005.js b/tests/auto/qml/parserstress/tests/ecma_2/Statements/try-005.js
new file mode 100644
index 0000000000..0b9a055325
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Statements/try-005.js
@@ -0,0 +1,90 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Statements/try-006.js b/tests/auto/qml/parserstress/tests/ecma_2/Statements/try-006.js
new file mode 100644
index 0000000000..1cfbd28656
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Statements/try-006.js
@@ -0,0 +1,120 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Statements/try-007.js b/tests/auto/qml/parserstress/tests/ecma_2/Statements/try-007.js
new file mode 100644
index 0000000000..566166755c
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Statements/try-007.js
@@ -0,0 +1,125 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Statements/try-008.js b/tests/auto/qml/parserstress/tests/ecma_2/Statements/try-008.js
new file mode 100644
index 0000000000..016ab29a31
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Statements/try-008.js
@@ -0,0 +1,92 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Statements/try-009.js b/tests/auto/qml/parserstress/tests/ecma_2/Statements/try-009.js
new file mode 100644
index 0000000000..d6ce368638
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Statements/try-009.js
@@ -0,0 +1,99 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Statements/try-010.js b/tests/auto/qml/parserstress/tests/ecma_2/Statements/try-010.js
new file mode 100644
index 0000000000..27e712c895
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Statements/try-010.js
@@ -0,0 +1,106 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Statements/try-012.js b/tests/auto/qml/parserstress/tests/ecma_2/Statements/try-012.js
new file mode 100644
index 0000000000..79dfca2f03
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Statements/try-012.js
@@ -0,0 +1,128 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Statements/while-001.js b/tests/auto/qml/parserstress/tests/ecma_2/Statements/while-001.js
new file mode 100644
index 0000000000..467efe7f02
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Statements/while-001.js
@@ -0,0 +1,75 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Statements/while-002.js b/tests/auto/qml/parserstress/tests/ecma_2/Statements/while-002.js
new file mode 100644
index 0000000000..c89e195497
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Statements/while-002.js
@@ -0,0 +1,119 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Statements/while-003.js b/tests/auto/qml/parserstress/tests/ecma_2/Statements/while-003.js
new file mode 100644
index 0000000000..5fb734cce6
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Statements/while-003.js
@@ -0,0 +1,120 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/Statements/while-004.js b/tests/auto/qml/parserstress/tests/ecma_2/Statements/while-004.js
new file mode 100644
index 0000000000..c5e2472816
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/Statements/while-004.js
@@ -0,0 +1,250 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/String/browser.js b/tests/auto/qml/parserstress/tests/ecma_2/String/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/String/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma_2/String/match-001.js b/tests/auto/qml/parserstress/tests/ecma_2/String/match-001.js
new file mode 100644
index 0000000000..de2275b5d6
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/String/match-001.js
@@ -0,0 +1,139 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/String/match-002.js b/tests/auto/qml/parserstress/tests/ecma_2/String/match-002.js
new file mode 100644
index 0000000000..a57da2f77f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/String/match-002.js
@@ -0,0 +1,207 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/String/match-003.js b/tests/auto/qml/parserstress/tests/ecma_2/String/match-003.js
new file mode 100644
index 0000000000..cd3d80c919
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/String/match-003.js
@@ -0,0 +1,165 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/String/match-004.js b/tests/auto/qml/parserstress/tests/ecma_2/String/match-004.js
new file mode 100644
index 0000000000..5c26de8b61
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/String/match-004.js
@@ -0,0 +1,206 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/String/replace-001.js b/tests/auto/qml/parserstress/tests/ecma_2/String/replace-001.js
new file mode 100644
index 0000000000..f0ae3cdbfa
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/String/replace-001.js
@@ -0,0 +1,99 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/String/shell.js b/tests/auto/qml/parserstress/tests/ecma_2/String/shell.js
new file mode 100644
index 0000000000..7d850446cc
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/String/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'String';
diff --git a/tests/auto/qml/parserstress/tests/ecma_2/String/split-001.js b/tests/auto/qml/parserstress/tests/ecma_2/String/split-001.js
new file mode 100644
index 0000000000..bbab3b0428
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/String/split-001.js
@@ -0,0 +1,145 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/String/split-002.js b/tests/auto/qml/parserstress/tests/ecma_2/String/split-002.js
new file mode 100644
index 0000000000..9ae000790e
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/String/split-002.js
@@ -0,0 +1,303 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/String/split-003.js b/tests/auto/qml/parserstress/tests/ecma_2/String/split-003.js
new file mode 100644
index 0000000000..5029fc98f9
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/String/split-003.js
@@ -0,0 +1,156 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/browser.js b/tests/auto/qml/parserstress/tests/ecma_2/browser.js
new file mode 100644
index 0000000000..4cde9b0629
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/browser.js
@@ -0,0 +1,37 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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/qml/parserstress/tests/ecma_2/extensions/browser.js b/tests/auto/qml/parserstress/tests/ecma_2/extensions/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/extensions/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma_2/extensions/constructor-001.js b/tests/auto/qml/parserstress/tests/ecma_2/extensions/constructor-001.js
new file mode 100755
index 0000000000..cc7907d006
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/extensions/constructor-001.js
@@ -0,0 +1,74 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/extensions/function-001.js b/tests/auto/qml/parserstress/tests/ecma_2/extensions/function-001.js
new file mode 100755
index 0000000000..5153d25f9d
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/extensions/function-001.js
@@ -0,0 +1,74 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/extensions/instanceof-001.js b/tests/auto/qml/parserstress/tests/ecma_2/extensions/instanceof-001.js
new file mode 100755
index 0000000000..8ea446a248
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/extensions/instanceof-001.js
@@ -0,0 +1,144 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/extensions/instanceof-002.js b/tests/auto/qml/parserstress/tests/ecma_2/extensions/instanceof-002.js
new file mode 100755
index 0000000000..9cc837d8ef
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/extensions/instanceof-002.js
@@ -0,0 +1,160 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/extensions/instanceof-003-n.js b/tests/auto/qml/parserstress/tests/ecma_2/extensions/instanceof-003-n.js
new file mode 100755
index 0000000000..7a763a895c
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/extensions/instanceof-003-n.js
@@ -0,0 +1,121 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/extensions/instanceof-004-n.js b/tests/auto/qml/parserstress/tests/ecma_2/extensions/instanceof-004-n.js
new file mode 100755
index 0000000000..1662ae566b
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/extensions/instanceof-004-n.js
@@ -0,0 +1,121 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/extensions/instanceof-005-n.js b/tests/auto/qml/parserstress/tests/ecma_2/extensions/instanceof-005-n.js
new file mode 100755
index 0000000000..1a9b1b3437
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/extensions/instanceof-005-n.js
@@ -0,0 +1,122 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/extensions/instanceof-006.js b/tests/auto/qml/parserstress/tests/ecma_2/extensions/instanceof-006.js
new file mode 100755
index 0000000000..03c0f16fb9
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/extensions/instanceof-006.js
@@ -0,0 +1,119 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/extensions/shell.js b/tests/auto/qml/parserstress/tests/ecma_2/extensions/shell.js
new file mode 100644
index 0000000000..3f52cffbc0
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/extensions/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'extensions';
diff --git a/tests/auto/qml/parserstress/tests/ecma_2/instanceof/browser.js b/tests/auto/qml/parserstress/tests/ecma_2/instanceof/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/instanceof/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma_2/instanceof/instanceof-001.js b/tests/auto/qml/parserstress/tests/ecma_2/instanceof/instanceof-001.js
new file mode 100644
index 0000000000..39ae96fa5b
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/instanceof/instanceof-001.js
@@ -0,0 +1,67 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/instanceof/instanceof-002.js b/tests/auto/qml/parserstress/tests/ecma_2/instanceof/instanceof-002.js
new file mode 100644
index 0000000000..c35fcb0486
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/instanceof/instanceof-002.js
@@ -0,0 +1,84 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/instanceof/instanceof-003.js b/tests/auto/qml/parserstress/tests/ecma_2/instanceof/instanceof-003.js
new file mode 100644
index 0000000000..6c1279f865
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/instanceof/instanceof-003.js
@@ -0,0 +1,98 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_2/instanceof/regress-7635.js b/tests/auto/qml/parserstress/tests/ecma_2/instanceof/regress-7635.js
new file mode 100644
index 0000000000..c643920b04
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/instanceof/regress-7635.js
@@ -0,0 +1,88 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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/qml/parserstress/tests/ecma_2/instanceof/shell.js b/tests/auto/qml/parserstress/tests/ecma_2/instanceof/shell.js
new file mode 100644
index 0000000000..b390356c38
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/instanceof/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'instanceof';
diff --git a/tests/auto/qml/parserstress/tests/ecma_2/jsref.js b/tests/auto/qml/parserstress/tests/ecma_2/jsref.js
new file mode 100644
index 0000000000..e5a3ddfeed
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/jsref.js
@@ -0,0 +1,591 @@
+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/qml/parserstress/tests/ecma_2/shell.js b/tests/auto/qml/parserstress/tests/ecma_2/shell.js
new file mode 100644
index 0000000000..a83dd68ec2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/shell.js
@@ -0,0 +1,51 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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/qml/parserstress/tests/ecma_2/template.js b/tests/auto/qml/parserstress/tests/ecma_2/template.js
new file mode 100644
index 0000000000..83397ba7b3
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_2/template.js
@@ -0,0 +1,57 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_3/Array/15.4.4.11-01.js b/tests/auto/qml/parserstress/tests/ecma_3/Array/15.4.4.11-01.js
new file mode 100755
index 0000000000..0436b8c1e0
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Array/15.4.4.11-01.js
@@ -0,0 +1,61 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_3/Array/15.4.4.3-1.js b/tests/auto/qml/parserstress/tests/ecma_3/Array/15.4.4.3-1.js
new file mode 100644
index 0000000000..e3de6fb116
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Array/15.4.4.3-1.js
@@ -0,0 +1,88 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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/qml/parserstress/tests/ecma_3/Array/15.4.4.4-001.js b/tests/auto/qml/parserstress/tests/ecma_3/Array/15.4.4.4-001.js
new file mode 100644
index 0000000000..b87233ea97
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Array/15.4.4.4-001.js
@@ -0,0 +1,153 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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<UBound; i++)
+ {
+ reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
+ }
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Array/15.4.5.1-01.js b/tests/auto/qml/parserstress/tests/ecma_3/Array/15.4.5.1-01.js
new file mode 100755
index 0000000000..b55430b44e
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Array/15.4.5.1-01.js
@@ -0,0 +1,93 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient 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.5.1-01.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = "(none)";
+var summary = '15.4.5.1 - array.length coverage';
+var actual = '';
+var expect = '';
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ var a = [];
+
+ expect = 'RangeError: invalid array length';
+ actual = '';
+ try
+ {
+ a.length = -1;
+ }
+ catch(ex)
+ {
+ actual = ex + '';
+ }
+ reportCompare(expect, actual, summary);
+
+ actual = '';
+ try
+ {
+ a.length = 12345678901234567890;
+ }
+ catch(ex)
+ {
+ actual = ex + '';
+ }
+ reportCompare(expect, actual, summary);
+
+ actual = '';
+ try
+ {
+ a.length = 'a';
+ }
+ catch(ex)
+ {
+ actual = ex + '';
+ }
+ reportCompare(expect, actual, summary);
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Array/browser.js b/tests/auto/qml/parserstress/tests/ecma_3/Array/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Array/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Array/regress-101488.js b/tests/auto/qml/parserstress/tests/ecma_3/Array/regress-101488.js
new file mode 100644
index 0000000000..15a4556298
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Array/regress-101488.js
@@ -0,0 +1,172 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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):
+ * 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: 24 September 2001
+ *
+ * SUMMARY: Try assigning arr.length = new Number(n)
+ * From correspondence with Igor Bukanov <igor@icesoft.no>
+ * 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<UBound; i++)
+ {
+ reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
+ }
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Array/regress-130451.js b/tests/auto/qml/parserstress/tests/ecma_3/Array/regress-130451.js
new file mode 100644
index 0000000000..a738bf6356
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Array/regress-130451.js
@@ -0,0 +1,219 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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):
+ * brendan@mozilla.org, 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 Mar 2002
+ * SUMMARY: Array.prototype.sort() should not (re-)define .length
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=130451
+ *
+ * From the ECMA-262 Edition 3 Final spec:
+ *
+ * NOTE: 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.
+ *
+ * The interesting parts of this testcase are the contrasting expectations for
+ * Brendan's test below, when applied to Array objects vs. non-Array objects.
+ *
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-130451.js';
+var UBound = 0;
+var BUGNUMBER = 130451;
+var summary = 'Array.prototype.sort() should not (re-)define .length';
+var status = '';
+var statusitems = [];
+var actual = '';
+var actualvalues = [];
+var expect= '';
+var expectedvalues = [];
+var arr = [];
+var cmp = new Function();
+
+
+/*
+ * First: test Array.prototype.sort() on Array objects
+ */
+status = inSection(1);
+arr = [0,1,2,3];
+cmp = function(x,y) {return x-y;};
+actual = arr.sort(cmp).length;
+expect = 4;
+addThis();
+
+status = inSection(2);
+arr = [0,1,2,3];
+cmp = function(x,y) {return y-x;};
+actual = arr.sort(cmp).length;
+expect = 4;
+addThis();
+
+status = inSection(3);
+arr = [0,1,2,3];
+cmp = function(x,y) {return x-y;};
+arr.length = 1;
+actual = arr.sort(cmp).length;
+expect = 1;
+addThis();
+
+/*
+ * This test is by Brendan. Setting arr.length to
+ * 2 and then 4 should cause elements to be deleted.
+ */
+arr = [0,1,2,3];
+cmp = function(x,y) {return x-y;};
+arr.sort(cmp);
+
+status = inSection(4);
+actual = arr.join();
+expect = '0,1,2,3';
+addThis();
+
+status = inSection(5);
+actual = arr.length;
+expect = 4;
+addThis();
+
+status = inSection(6);
+arr.length = 2;
+actual = arr.join();
+expect = '0,1';
+addThis();
+
+status = inSection(7);
+arr.length = 4;
+actual = arr.join();
+expect = '0,1,,'; //<---- see how 2,3 have been lost
+addThis();
+
+
+
+/*
+ * Now test Array.prototype.sort() on non-Array objects
+ */
+status = inSection(8);
+var obj = new Object();
+obj.sort = Array.prototype.sort;
+obj.length = 4;
+obj[0] = 0;
+obj[1] = 1;
+obj[2] = 2;
+obj[3] = 3;
+cmp = function(x,y) {return x-y;};
+actual = obj.sort(cmp).length;
+expect = 4;
+addThis();
+
+
+/*
+ * Here again is Brendan's test. Unlike the array case
+ * above, the setting of obj.length to 2 and then 4
+ * should NOT cause elements to be deleted
+ */
+obj = new Object();
+obj.sort = Array.prototype.sort;
+obj.length = 4;
+obj[0] = 3;
+obj[1] = 2;
+obj[2] = 1;
+obj[3] = 0;
+cmp = function(x,y) {return x-y;};
+obj.sort(cmp); //<---- this is what triggered the buggy behavior below
+obj.join = Array.prototype.join;
+
+status = inSection(9);
+actual = obj.join();
+expect = '0,1,2,3';
+addThis();
+
+status = inSection(10);
+actual = obj.length;
+expect = 4;
+addThis();
+
+status = inSection(11);
+obj.length = 2;
+actual = obj.join();
+expect = '0,1';
+addThis();
+
+/*
+ * Before this bug was fixed, |actual| held the value '0,1,,'
+ * as in the Array-object case at top. This bug only occurred
+ * if Array.prototype.sort() had been applied to |obj|,
+ * as we have done higher up.
+ */
+status = inSection(12);
+obj.length = 4;
+actual = obj.join();
+expect = '0,1,2,3';
+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<UBound; i++)
+ {
+ reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
+ }
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Array/regress-322135-01.js b/tests/auto/qml/parserstress/tests/ecma_3/Array/regress-322135-01.js
new file mode 100755
index 0000000000..4e277e6da5
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Array/regress-322135-01.js
@@ -0,0 +1,73 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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): Joaquin Cuenca Abela
+ * 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-322135-01.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 322135;
+var summary = 'Array.prototype.push on Array with length 2^32-1';
+var actual = 'Completed';
+var expect = 'Completed';
+
+printBugNumber(BUGNUMBER);
+printStatus (summary);
+
+printStatus('This bug passes if it does not cause an out of memory error');
+printStatus('Other issues related to array length are not tested.');
+
+var length = 4294967295;
+var array = new Array(length);
+
+printStatus('before array.length = ' + array.length);
+
+try
+{
+ array.push('Kibo');
+}
+catch(ex)
+{
+ printStatus(ex.name + ': ' + ex.message);
+}
+reportCompare(expect, actual, summary);
+
+//expect = 'Kibo';
+//actual = array[length];
+//reportCompare(expect, actual, summary + ': element appended');
+
+//expect = length;
+//actual = array.length;
+//reportCompare(expect, actual, summary + ': array length unchanged');
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Array/regress-322135-02.js b/tests/auto/qml/parserstress/tests/ecma_3/Array/regress-322135-02.js
new file mode 100755
index 0000000000..ee426a0cec
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Array/regress-322135-02.js
@@ -0,0 +1,65 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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): Joaquin Cuenca Abela
+ * 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-322135-02.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 322135;
+var summary = 'Array.prototype.concat on Array with length 2^32-1';
+var actual = 'Completed';
+var expect = 'Completed';
+
+printBugNumber(BUGNUMBER);
+printStatus (summary);
+
+printStatus('This bug passes if it does not cause an out of memory error');
+printStatus('Other issues related to array length are not tested.');
+
+var length = 4294967295;
+var array1 = new Array(length);
+var array2 = ['Kibo'];
+var array;
+
+try
+{
+ array = array1.concat(array2);
+}
+catch(ex)
+{
+ printStatus(ex.name + ': ' + ex.message);
+}
+reportCompare(expect, actual, summary);
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Array/regress-322135-03.js b/tests/auto/qml/parserstress/tests/ecma_3/Array/regress-322135-03.js
new file mode 100755
index 0000000000..95ee7f7a92
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Array/regress-322135-03.js
@@ -0,0 +1,73 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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): Joaquin Cuenca Abela
+ * 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-322135-03.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 322135;
+var summary = 'Array.prototype.splice on Array with length 2^32-1';
+var actual = 'Completed';
+var expect = 'Completed';
+
+printBugNumber(BUGNUMBER);
+printStatus (summary);
+
+printStatus('This bug passes if it does not cause an out of memory error');
+printStatus('Other issues related to array length are not tested.');
+
+var length = 4294967295;
+var array = new Array(length);
+var array1 = ['Kibo'];
+var array;
+
+try
+{
+ array.splice(0, 0, array1);
+}
+catch(ex)
+{
+ printStatus(ex.name + ': ' + ex.message);
+}
+reportCompare(expect, actual, summary + ': RangeError');
+
+//expect = 'Kibo';
+//actual = array[0];
+//reportCompare(expect, actual, summary + ': element prepended');
+
+//expect = length;
+//actual = array.length;
+//reportCompare(expect, actual, summary + ': array length unchanged');
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Array/regress-322135-04.js b/tests/auto/qml/parserstress/tests/ecma_3/Array/regress-322135-04.js
new file mode 100755
index 0000000000..fe9f8fc71e
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Array/regress-322135-04.js
@@ -0,0 +1,71 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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): Joaquin Cuenca Abela
+ * 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-322135-04.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 322135;
+var summary = 'Array.prototype.unshift on Array with length 2^32-1';
+var actual = 'Completed';
+var expect = 'Completed';
+
+printBugNumber(BUGNUMBER);
+printStatus (summary);
+
+printStatus('This bug passes if it does not cause an out of memory error');
+printStatus('Other issues related to array length are not tested.');
+
+var length = 4294967295;
+var array = new Array(length);
+
+try
+{
+ array.unshift('Kibo');
+}
+catch(ex)
+{
+ printStatus(ex.name + ': ' + ex.message);
+}
+reportCompare(expect, actual, summary);
+
+//expect = 'Kibo';
+//actual = array[0];
+//reportCompare(expect, actual, summary + ': first prepended');
+
+//expect = length;
+//actual = array.length;
+//reportCompare(expect, actual, summary + ': array length unchanged');
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Array/regress-387501.js b/tests/auto/qml/parserstress/tests/ecma_3/Array/regress-387501.js
new file mode 100755
index 0000000000..36cf1478d2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Array/regress-387501.js
@@ -0,0 +1,94 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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 ***** */
+
+var gTestfile = 'regress-387501.js';
+
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 387501;
+var summary = 'Array.prototype.toString|toSource|toLocaleString is not generic';
+var actual = '';
+var expect = '';
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ try
+ {
+ expect = 'TypeError: Array.prototype.toString called on incompatible String';
+ actual = Array.prototype.toString.call((new String('foo')));
+ }
+ catch(ex)
+ {
+ actual = ex + '';
+ }
+ reportCompare(expect, actual, summary);
+
+ try
+ {
+ expect = 'TypeError: Array.prototype.toLocaleString called on incompatible String';
+ actual = Array.prototype.toLocaleString.call((new String('foo')));
+ }
+ catch(ex)
+ {
+ actual = ex + '';
+ }
+ reportCompare(expect, actual, summary);
+
+ if (typeof Array.prototype.toSource != 'undefined')
+ {
+ try
+ {
+ expect = 'TypeError: Array.prototype.toSource called on incompatible String';
+ actual = Array.prototype.toSource.call((new String('foo')));
+ }
+ catch(ex)
+ {
+ actual = ex + '';
+ }
+ reportCompare(expect, actual, summary);
+ }
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Array/regress-421325.js b/tests/auto/qml/parserstress/tests/ecma_3/Array/regress-421325.js
new file mode 100755
index 0000000000..c869d7bff4
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Array/regress-421325.js
@@ -0,0 +1,67 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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): 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-421325.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 421325;
+var summary = 'Dense Arrays and holes';
+var actual = '';
+var expect = '';
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ Array.prototype[1] = 'bar';
+
+ var a = [];
+ a[0]='foo';
+ a[2] = 'baz';
+ expect = 'foo,bar,baz';
+ actual = a + '';
+
+ reportCompare(expect, actual, summary);
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Array/regress-430717.js b/tests/auto/qml/parserstress/tests/ecma_3/Array/regress-430717.js
new file mode 100755
index 0000000000..f750ffb449
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Array/regress-430717.js
@@ -0,0 +1,65 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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): Mike Shaver
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient 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-430717.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 430717;
+var summary = 'Dense Arrays should inherit deleted elements from Array.prototype';
+var actual = '';
+var expect = '';
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ Array.prototype[2] = "two";
+ var a = [0,1,2,3];
+ delete a[2];
+
+ expect = 'two';
+ actual = a[2];
+ reportCompare(expect, actual, summary);
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Array/shell.js b/tests/auto/qml/parserstress/tests/ecma_3/Array/shell.js
new file mode 100644
index 0000000000..9480d9e77d
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Array/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'Array';
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Date/15.9.1.2-01.js b/tests/auto/qml/parserstress/tests/ecma_3/Date/15.9.1.2-01.js
new file mode 100755
index 0000000000..61b1de6ef1
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Date/15.9.1.2-01.js
@@ -0,0 +1,62 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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 ***** */
+
+var gTestfile = '15.9.1.2-01.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 264727;
+var summary = '15.9.1.2 - TimeWithinDay(TIME_1900) == 0';
+var actual = '';
+var expect = '';
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ expect = 0;
+ actual = TimeWithinDay(TIME_1900);
+
+ reportCompare(expect, actual, summary);
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Date/15.9.3.2-1.js b/tests/auto/qml/parserstress/tests/ecma_3/Date/15.9.3.2-1.js
new file mode 100755
index 0000000000..d79b60b996
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Date/15.9.3.2-1.js
@@ -0,0 +1,91 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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): 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 = '15.9.3.2-1.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 273292;
+var summary = '15.9.3.2 new Date(value)';
+var actual = '';
+var expect = '';
+var date1;
+var date2;
+var i;
+var validDateStrings = [
+ "11/69/2004",
+ "11/70/2004",
+ "69/69/2004",
+ "69/69/69",
+ "69/69/1969",
+ "70/69/70",
+ "70/69/1970",
+ "70/69/2004"
+ ];
+
+var invalidDateStrings = [
+ "70/70/70",
+ "70/70/1970",
+ "70/70/2004"
+ ];
+
+printBugNumber(BUGNUMBER);
+printStatus (summary);
+
+expect = 0;
+
+for (i = 0; i < validDateStrings.length; i++)
+{
+ date1 = new Date(validDateStrings[i]);
+ date2 = new Date(date1.toDateString());
+ actual = date2 - date1;
+
+ reportCompare(expect, actual, inSection(i) + ' ' +
+ validDateStrings[i]);
+}
+
+expect = true;
+
+var offset = validDateStrings.length;
+
+for (i = 0; i < invalidDateStrings.length; i++)
+{
+ date1 = new Date(invalidDateStrings[i]);
+ actual = isNaN(date1);
+
+ reportCompare(expect, actual, inSection(i + offset) + ' ' +
+ invalidDateStrings[i] + ' is invalid.');
+}
+
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Date/15.9.4.3.js b/tests/auto/qml/parserstress/tests/ecma_3/Date/15.9.4.3.js
new file mode 100755
index 0000000000..b197dcb9c2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Date/15.9.4.3.js
@@ -0,0 +1,233 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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): nanto_vi (TOYAMA Nao)
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient 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.9.4.3.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 363578;
+var summary = '15.9.4.3 - Date.UTC edge-case arguments.';
+var actual = '';
+var expect = '';
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ //
+
+ expect = 31;
+ actual = (new Date(Date.UTC(2006, 0, 0)).getUTCDate());
+ reportCompare(expect, actual, summary + ': date 0');
+
+ expect = 0;
+ actual = (new Date(Date.UTC(2006, 0, 0, 0)).getUTCHours());
+ reportCompare(expect, actual, summary + ': hours 0');
+
+ expect = 0;
+ actual = (new Date(Date.UTC(2006, 0, 0, 0, 0)).getUTCMinutes());
+ reportCompare(expect, actual, summary + ': minutes 0');
+
+ expect = 0;
+ actual = (new Date(Date.UTC(2006, 0, 0, 0, 0, 0)).getUTCSeconds());
+ reportCompare(expect, actual, summary + ': seconds 0');
+
+ expect = 0;
+ actual = (new Date(Date.UTC(2006, 0, 0, 0, 0, 0, 0)).getUTCMilliseconds());
+ reportCompare(expect, actual, summary + ': milliseconds 0');
+
+ //
+
+ expect = 30;
+ actual = (new Date(Date.UTC(2006, 0, -1)).getUTCDate());
+ reportCompare(expect, actual, summary + ': date -1');
+
+ expect = 23;
+ actual = (new Date(Date.UTC(2006, 0, 0, -1)).getUTCHours());
+ reportCompare(expect, actual, summary + ': hours -1');
+
+ expect = 59;
+ actual = (new Date(Date.UTC(2006, 0, 0, 0, -1)).getUTCMinutes());
+ reportCompare(expect, actual, summary + ': minutes -1');
+
+ expect = 59;
+ actual = (new Date(Date.UTC(2006, 0, 0, 0, 0, -1)).getUTCSeconds());
+ reportCompare(expect, actual, summary + ': seconds -1');
+
+ expect = 999;
+ actual = (new Date(Date.UTC(2006, 0, 0, 0, 0, 0, -1)).getUTCMilliseconds());
+ reportCompare(expect, actual, summary + ': milliseconds -1');
+
+ //
+
+ expect = true;
+ actual = isNaN(new Date(Date.UTC(2006, 0, undefined)).getUTCDate());
+ reportCompare(expect, actual, summary + ': date undefined');
+
+ expect = true;
+ actual = isNaN(new Date(Date.UTC(2006, 0, 0, undefined)).getUTCHours());
+ reportCompare(expect, actual, summary + ': hours undefined');
+
+ expect = true;
+ actual = isNaN(new Date(Date.UTC(2006, 0, 0, 0, undefined)).getUTCMinutes());
+ reportCompare(expect, actual, summary + ': minutes undefined');
+
+ expect = true;
+ actual = isNaN(new Date(Date.UTC(2006, 0, 0, 0, 0, undefined)).getUTCSeconds());
+ reportCompare(expect, actual, summary + ': seconds undefined');
+
+ expect = true;
+ actual = isNaN(new Date(Date.UTC(2006, 0, 0, 0, 0, 0, undefined)).getUTCMilliseconds());
+ reportCompare(expect, actual, summary + ': milliseconds undefined');
+
+ //
+
+ expect = true;
+ actual = isNaN(new Date(Date.UTC(2006, 0, {})).getUTCDate());
+ reportCompare(expect, actual, summary + ': date {}');
+
+ expect = true;
+ actual = isNaN(new Date(Date.UTC(2006, 0, 0, {})).getUTCHours());
+ reportCompare(expect, actual, summary + ': hours {}');
+
+ expect = true;
+ actual = isNaN(new Date(Date.UTC(2006, 0, 0, 0, {})).getUTCMinutes());
+ reportCompare(expect, actual, summary + ': minutes {}');
+
+ expect = true;
+ actual = isNaN(new Date(Date.UTC(2006, 0, 0, 0, 0, {})).getUTCSeconds());
+ reportCompare(expect, actual, summary + ': seconds {}');
+
+ expect = true;
+ actual = isNaN(new Date(Date.UTC(2006, 0, 0, 0, 0, 0, {})).getUTCMilliseconds());
+ reportCompare(expect, actual, summary + ': milliseconds {}');
+
+ //
+
+ expect = 31;
+ actual = (new Date(Date.UTC(2006, 0, null)).getUTCDate());
+ reportCompare(expect, actual, summary + ': date null');
+
+ expect = 0;
+ actual = (new Date(Date.UTC(2006, 0, 0, null)).getUTCHours());
+ reportCompare(expect, actual, summary + ': hours null');
+
+ expect = 0;
+ actual = (new Date(Date.UTC(2006, 0, 0, 0, null)).getUTCMinutes());
+ reportCompare(expect, actual, summary + ': minutes null');
+
+ expect = 0;
+ actual = (new Date(Date.UTC(2006, 0, 0, 0, 0, null)).getUTCSeconds());
+ reportCompare(expect, actual, summary + ': seconds null');
+
+ expect = 0;
+ actual = (new Date(Date.UTC(2006, 0, 0, 0, 0, 0, null)).getUTCMilliseconds());
+ reportCompare(expect, actual, summary + ': milliseconds null');
+
+ //
+
+ expect = true;
+ actual = isNaN(new Date(Date.UTC(2006, 0, Infinity)).getUTCDate());
+ reportCompare(expect, actual, summary + ': date Infinity');
+
+ expect = true;
+ actual = isNaN(new Date(Date.UTC(2006, 0, 0, Infinity)).getUTCHours());
+ reportCompare(expect, actual, summary + ': hours Infinity');
+
+ expect = true;
+ actual = isNaN(new Date(Date.UTC(2006, 0, 0, 0, Infinity)).getUTCMinutes());
+ reportCompare(expect, actual, summary + ': minutes Infinity');
+
+ expect = true;
+ actual = isNaN(new Date(Date.UTC(2006, 0, 0, 0, 0, Infinity)).getUTCSeconds());
+ reportCompare(expect, actual, summary + ': seconds Infinity');
+
+ expect = true;
+ actual = isNaN(new Date(Date.UTC(2006, 0, 0, 0, 0, 0, Infinity)).getUTCMilliseconds());
+ reportCompare(expect, actual, summary + ': milliseconds Infinity');
+
+ //
+
+ expect = 31;
+ actual = (new Date(Date.UTC(2006, 0, -Infinity)).getUTCDate());
+ reportCompare(expect, actual, summary + ': date -Infinity');
+
+ expect = 0;
+ actual = (new Date(Date.UTC(2006, 0, 0, -Infinity)).getUTCHours());
+ reportCompare(expect, actual, summary + ': hours -Infinity');
+
+ expect = 0;
+ actual = (new Date(Date.UTC(2006, 0, 0, 0, -Infinity)).getUTCMinutes());
+ reportCompare(expect, actual, summary + ': minutes -Infinity');
+
+ expect = 0;
+ actual = (new Date(Date.UTC(2006, 0, 0, 0, 0, -Infinity)).getUTCSeconds());
+ reportCompare(expect, actual, summary + ': seconds -Infinity');
+
+ expect = 0;
+ actual = (new Date(Date.UTC(2006, 0, 0, 0, 0, 0, -Infinity)).getUTCMilliseconds());
+ reportCompare(expect, actual, summary + ': milliseconds -Infinity');
+
+ //
+
+ expect = true;
+ actual = isNaN(new Date(Date.UTC(2006, 0, NaN)).getUTCDate());
+ reportCompare(expect, actual, summary + ': date NaN');
+
+ expect = true;
+ actual = isNaN(new Date(Date.UTC(2006, 0, 0, NaN)).getUTCHours());
+ reportCompare(expect, actual, summary + ': hours NaN');
+
+ expect = true;
+ actual = isNaN(new Date(Date.UTC(2006, 0, 0, 0, NaN)).getUTCMinutes());
+ reportCompare(expect, actual, summary + ': minutes NaN');
+
+ expect = true;
+ actual = isNaN(new Date(Date.UTC(2006, 0, 0, 0, 0, NaN)).getUTCSeconds());
+ reportCompare(expect, actual, summary + ': seconds NaN');
+
+ expect = true;
+ actual = isNaN(new Date(Date.UTC(2006, 0, 0, 0, 0, 0, NaN)).getUTCMilliseconds());
+ reportCompare(expect, actual, summary + ': milliseconds NaN');
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Date/15.9.5.3.js b/tests/auto/qml/parserstress/tests/ecma_3/Date/15.9.5.3.js
new file mode 100644
index 0000000000..6704f1fcad
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Date/15.9.5.3.js
@@ -0,0 +1,152 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/**
+ File Name: 15.9.5.3.js
+ ECMA Section: 15.9.5.3 Date.prototype.toDateString()
+ Description:
+ This function returns a string value. The contents of the string are
+ implementation dependent, but are intended to represent the "date"
+ portion of the Date in the current time zone in a convenient,
+ human-readable form. We can't test the content of the string,
+ but can verify that the string is parsable by Date.parse
+
+ The toDateString 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: pschwartau@netscape.com
+ Date: 14 november 2000 (adapted from ecma/Date/15.9.5.2.js)
+*/
+
+var gTestfile = '15.9.5.3.js';
+var SECTION = "15.9.5.3";
+var VERSION = "ECMA_3";
+var TITLE = "Date.prototype.toDateString()";
+
+var status = '';
+var actual = '';
+var expect = '';
+
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+// first, some generic tests -
+
+status = "typeof (now.toDateString())";
+actual = typeof (now.toDateString());
+expect = "string";
+addTestCase();
+
+status = "Date.prototype.toDateString.length";
+actual = Date.prototype.toDateString.length;
+expect = 0;
+addTestCase();
+
+/*
+ * Date.parse is accurate to the second; valueOf() to the millisecond.
+ * Here we expect them to coincide, as we expect a time of exactly
+ * midnight -
+ */
+status = "(Date.parse(now.toDateString()) - (midnight(now)).valueOf()) == 0";
+actual = (Date.parse(now.toDateString()) - (midnight(now)).valueOf()) == 0;
+expect = true;
+addTestCase();
+
+
+
+// 1970
+addDateTestCase(0);
+addDateTestCase(TZ_ADJUST);
+
+
+// 1900
+addDateTestCase(TIME_1900);
+addDateTestCase(TIME_1900 - TZ_ADJUST);
+
+
+// 2000
+addDateTestCase(TIME_2000);
+addDateTestCase(TIME_2000 - TZ_ADJUST);
+
+
+// 29 Feb 2000
+addDateTestCase(UTC_29_FEB_2000);
+addDateTestCase(UTC_29_FEB_2000 - 1000);
+addDateTestCase(UTC_29_FEB_2000 - TZ_ADJUST);
+
+
+// 2005
+addDateTestCase(UTC_1_JAN_2005);
+addDateTestCase(UTC_1_JAN_2005 - 1000);
+addDateTestCase(UTC_1_JAN_2005 - TZ_ADJUST);
+
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+
+function addTestCase()
+{
+ new TestCase(
+ SECTION,
+ status,
+ expect,
+ actual);
+}
+
+function addDateTestCase(date_given_in_milliseconds)
+{
+ var givenDate = new Date(date_given_in_milliseconds);
+
+ status = 'Date.parse(' + givenDate + ').toDateString())';
+ actual = Date.parse(givenDate.toDateString());
+ expect = Date.parse(midnight(givenDate));
+ addTestCase();
+}
+
+
+function midnight(givenDate)
+{
+ // midnight on the given date -
+ return new Date(givenDate.getFullYear(), givenDate.getMonth(), givenDate.getDate());
+}
+
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Date/15.9.5.4.js b/tests/auto/qml/parserstress/tests/ecma_3/Date/15.9.5.4.js
new file mode 100644
index 0000000000..a2643bfe3c
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Date/15.9.5.4.js
@@ -0,0 +1,185 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/**
+ File Name: 15.9.5.4.js
+ ECMA Section: 15.9.5.4 Date.prototype.toTimeString()
+ Description:
+ This function returns a string value. The contents of the string are
+ implementation dependent, but are intended to represent the "time"
+ portion of the Date in the current time zone in a convenient,
+ human-readable form. We test the content of the string by checking
+ that d.toDateString() + d.toTimeString() == d.toString()
+
+ Author: pschwartau@netscape.com
+ Date: 14 november 2000
+ Revised: 07 january 2002 because of a change in JS Date format:
+
+ See http://bugzilla.mozilla.org/show_bug.cgi?id=118266 (SpiderMonkey)
+ See http://bugzilla.mozilla.org/show_bug.cgi?id=118636 (Rhino)
+*/
+//-----------------------------------------------------------------------------
+var gTestfile = '15.9.5.4.js';
+var SECTION = "15.9.5.4";
+var VERSION = "ECMA_3";
+var TITLE = "Date.prototype.toTimeString()";
+
+var status = '';
+var actual = '';
+var expect = '';
+var givenDate;
+var year = '';
+var regexp = '';
+var reducedDateString = '';
+var hopeThisIsTimeString = '';
+var cnEmptyString = '';
+var cnERR ='OOPS! FATAL ERROR: no regexp match in extractTimeString()';
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+// first, a couple of generic tests -
+
+status = "typeof (now.toTimeString())";
+actual = typeof (now.toTimeString());
+expect = "string";
+addTestCase();
+
+status = "Date.prototype.toTimeString.length";
+actual = Date.prototype.toTimeString.length;
+expect = 0;
+addTestCase();
+
+// 1970
+addDateTestCase(0);
+addDateTestCase(TZ_ADJUST);
+
+
+// 1900
+addDateTestCase(TIME_1900);
+addDateTestCase(TIME_1900 - TZ_ADJUST);
+
+
+// 2000
+addDateTestCase(TIME_2000);
+addDateTestCase(TIME_2000 - TZ_ADJUST);
+
+
+// 29 Feb 2000
+addDateTestCase(UTC_29_FEB_2000);
+addDateTestCase(UTC_29_FEB_2000 - 1000);
+addDateTestCase(UTC_29_FEB_2000 - TZ_ADJUST);
+
+
+// Now
+addDateTestCase( TIME_NOW);
+addDateTestCase( TIME_NOW - TZ_ADJUST);
+
+
+// 2005
+addDateTestCase(UTC_1_JAN_2005);
+addDateTestCase(UTC_1_JAN_2005 - 1000);
+addDateTestCase(UTC_1_JAN_2005 - TZ_ADJUST);
+
+//-----------------------------------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------------------------------
+
+function addTestCase()
+{
+ new TestCase(
+ SECTION,
+ status,
+ expect,
+ actual);
+}
+
+function addDateTestCase(date_given_in_milliseconds)
+{
+ givenDate = new Date(date_given_in_milliseconds);
+
+ status = '(' + givenDate + ').toTimeString()';
+ actual = givenDate.toTimeString();
+ expect = extractTimeString(givenDate);
+ addTestCase();
+}
+
+
+/*
+ * As of 2002-01-07, the format for JavaScript dates changed.
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=118266 (SpiderMonkey)
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=118636 (Rhino)
+ *
+ * WAS: Mon Jan 07 13:40:34 GMT-0800 (Pacific Standard Time) 2002
+ * NOW: Mon Jan 07 2002 13:40:34 GMT-0800 (Pacific Standard Time)
+ *
+ * Thus, use a regexp of the form /date.toDateString()(.*)$/
+ * to capture the TimeString into the first backreference -
+ */
+function extractTimeString(date)
+{
+ regexp = new RegExp(date.toDateString() + '(.*)' + '$');
+
+ try
+ {
+ hopeThisIsTimeString = date.toString().match(regexp)[1];
+ }
+ catch(e)
+ {
+ return cnERR;
+ }
+
+ // trim any leading or trailing spaces -
+ return trimL(trimR(hopeThisIsTimeString));
+}
+
+
+function trimL(s)
+{
+ if (!s) {return cnEmptyString;};
+ for (var i = 0; i!=s.length; i++) {if (s[i] != ' ') {break;}}
+ return s.substring(i);
+}
+
+
+function trimR(s)
+{
+ if (!s) {return cnEmptyString;};
+ for (var i = (s.length - 1); i!=-1; i--) {if (s[i] != ' ') {break;}}
+ return s.substring(0, i+1);
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Date/15.9.5.5-02.js b/tests/auto/qml/parserstress/tests/ecma_3/Date/15.9.5.5-02.js
new file mode 100755
index 0000000000..e3b073e7ec
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Date/15.9.5.5-02.js
@@ -0,0 +1,88 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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 ***** */
+
+var gTestfile = '15.9.5.5-02.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 398485;
+var summary = 'Date.prototype.toLocaleString should not clamp year';
+var actual = '';
+var expect = '';
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ var d;
+ var y;
+ var l;
+ var maxms = 8640000000000000;
+
+ d = new Date(-maxms );
+ y = d.getFullYear();
+ l = d.toLocaleString();
+ print(l);
+
+ actual = y;
+ expect = -271821;
+ reportCompare(expect, actual, summary + ': check year');
+
+ actual = l.match(new RegExp(y)) + '';
+ expect = y + '';
+ reportCompare(expect, actual, summary + ': check toLocaleString');
+
+ d = new Date(maxms );
+ y = d.getFullYear();
+ l = d.toLocaleString();
+ print(l);
+
+ actual = y;
+ expect = 275760;
+ reportCompare(expect, actual, summary + ': check year');
+
+ actual = l.match(new RegExp(y)) + '';
+ expect = y + '';
+ reportCompare(expect, actual, summary + ': check toLocaleString');
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Date/15.9.5.5.js b/tests/auto/qml/parserstress/tests/ecma_3/Date/15.9.5.5.js
new file mode 100644
index 0000000000..2b76fdcfc2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Date/15.9.5.5.js
@@ -0,0 +1,144 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient 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.9.5.5.js';
+
+/**
+ File Name: 15.9.5.5.js
+ ECMA Section: 15.9.5.5 Date.prototype.toLocaleString()
+ Description:
+ This function returns a string value. The contents of the string are
+ implementation dependent, but are intended to represent the "date"
+ portion of the Date in the current time zone in a convenient,
+ human-readable form. We can't test the content of the string,
+ but can verify that the string is parsable by Date.parse
+
+ The toLocaleString 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.
+
+ Note: This test isn't supposed to work with a non-English locale per spec.
+
+ Author: pschwartau@netscape.com
+ Date: 14 november 2000
+*/
+
+var SECTION = "15.9.5.5";
+var VERSION = "ECMA_3";
+var TITLE = "Date.prototype.toLocaleString()";
+
+var status = '';
+var actual = '';
+var expect = '';
+
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+// first, some generic tests -
+
+status = "typeof (now.toLocaleString())";
+actual = typeof (now.toLocaleString());
+expect = "string";
+addTestCase();
+
+status = "Date.prototype.toLocaleString.length";
+actual = Date.prototype.toLocaleString.length;
+expect = 0;
+addTestCase();
+
+// Date.parse is accurate to the second; valueOf() to the millisecond -
+status = "Math.abs(Date.parse(now.toLocaleString()) - now.valueOf()) < 1000";
+actual = Math.abs(Date.parse(now.toLocaleString()) - now.valueOf()) < 1000;
+expect = true;
+addTestCase();
+
+
+
+// 1970
+addDateTestCase(0);
+addDateTestCase(TZ_ADJUST);
+
+
+// 1900
+addDateTestCase(TIME_1900);
+addDateTestCase(TIME_1900 -TZ_ADJUST);
+
+
+// 2000
+addDateTestCase(TIME_2000);
+addDateTestCase(TIME_2000 -TZ_ADJUST);
+
+
+// 29 Feb 2000
+addDateTestCase(UTC_29_FEB_2000);
+addDateTestCase(UTC_29_FEB_2000 - 1000);
+addDateTestCase(UTC_29_FEB_2000 - TZ_ADJUST);
+
+
+// 2005
+addDateTestCase(UTC_1_JAN_2005);
+addDateTestCase(UTC_1_JAN_2005 - 1000);
+addDateTestCase(UTC_1_JAN_2005-TZ_ADJUST);
+
+
+
+//-----------------------------------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------------------------------
+
+
+function addTestCase()
+{
+ AddTestCase(
+ status,
+ expect,
+ actual);
+}
+
+
+function addDateTestCase(date_given_in_milliseconds)
+{
+ var givenDate = new Date(date_given_in_milliseconds);
+
+ status = 'Date.parse(' + givenDate + ').toLocaleString())';
+ actual = Date.parse(givenDate.toLocaleString());
+ expect = date_given_in_milliseconds;
+ addTestCase();
+}
+
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Date/15.9.5.6.js b/tests/auto/qml/parserstress/tests/ecma_3/Date/15.9.5.6.js
new file mode 100644
index 0000000000..004fbce2e0
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Date/15.9.5.6.js
@@ -0,0 +1,153 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient 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.9.5.6.js';
+
+/**
+ File Name: 15.9.5.6.js
+ ECMA Section: 15.9.5.6 Date.prototype.toLocaleDateString()
+ Description:
+ This function returns a string value. The contents of the string are
+ implementation dependent, but are intended to represent the "date"
+ portion of the Date in the current time zone in a convenient,
+ human-readable form. We can't test the content of the string,
+ but can verify that the string is parsable by Date.parse
+
+ The toLocaleDateString 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.
+
+ Note: This test isn't supposed to work with a non-English locale per spec.
+
+ Author: pschwartau@netscape.com
+ Date: 14 november 2000
+*/
+
+var SECTION = "15.9.5.6";
+var VERSION = "ECMA_3";
+var TITLE = "Date.prototype.toLocaleDateString()";
+
+var status = '';
+var actual = '';
+var expect = '';
+
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+// first, some generic tests -
+
+status = "typeof (now.toLocaleDateString())";
+actual = typeof (now.toLocaleDateString());
+expect = "string";
+addTestCase();
+
+status = "Date.prototype.toLocaleDateString.length";
+actual = Date.prototype.toLocaleDateString.length;
+expect = 0;
+addTestCase();
+
+/* Date.parse is accurate to the second; valueOf() to the millisecond.
+ Here we expect them to coincide, as we expect a time of exactly midnight - */
+status = "(Date.parse(now.toLocaleDateString()) - (midnight(now)).valueOf()) == 0";
+actual = (Date.parse(now.toLocaleDateString()) - (midnight(now)).valueOf()) == 0;
+expect = true;
+addTestCase();
+
+
+
+// 1970
+addDateTestCase(0);
+addDateTestCase(TZ_ADJUST);
+
+
+// 1900
+addDateTestCase(TIME_1900);
+addDateTestCase(TIME_1900 - TZ_ADJUST);
+
+
+// 2000
+addDateTestCase(TIME_2000);
+addDateTestCase(TIME_2000 - TZ_ADJUST);
+
+
+// 29 Feb 2000
+addDateTestCase(UTC_29_FEB_2000);
+addDateTestCase(UTC_29_FEB_2000 - 1000);
+addDateTestCase(UTC_29_FEB_2000 - TZ_ADJUST);
+
+
+// 2005
+addDateTestCase(UTC_1_JAN_2005);
+addDateTestCase(UTC_1_JAN_2005 - 1000);
+addDateTestCase(UTC_1_JAN_2005 - TZ_ADJUST);
+
+
+
+//-----------------------------------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------------------------------
+
+
+function addTestCase()
+{
+ new TestCase(
+ gTestfile,
+ status,
+ expect,
+ actual);
+}
+
+
+function addDateTestCase(date_given_in_milliseconds)
+{
+ var givenDate = new Date(date_given_in_milliseconds);
+
+ status = 'Date.parse(' + givenDate + ').toLocaleDateString())';
+ actual = Date.parse(givenDate.toLocaleDateString());
+ expect = Date.parse(midnight(givenDate));
+ addTestCase();
+}
+
+
+function midnight(givenDate)
+{
+ // midnight on the given date -
+ return new Date(givenDate.getFullYear(), givenDate.getMonth(), givenDate.getDate());
+}
+
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Date/15.9.5.7.js b/tests/auto/qml/parserstress/tests/ecma_3/Date/15.9.5.7.js
new file mode 100644
index 0000000000..00d2541803
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Date/15.9.5.7.js
@@ -0,0 +1,142 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/**
+ File Name: 15.9.5.7.js
+ ECMA Section: 15.9.5.7 Date.prototype.toLocaleTimeString()
+ Description:
+ This function returns a string value. The contents of the string are
+ implementation dependent, but are intended to represent the "time"
+ portion of the Date in the current time zone in a convenient,
+ human-readable form. We test the content of the string by checking
+ that
+
+ new Date(d.toDateString() + " " + d.toLocaleTimeString()) == d
+
+ Author: pschwartau@netscape.com
+ Date: 14 november 2000
+ Revised: 07 january 2002 because of a change in JS Date format:
+ Revised: 21 November 2005 since the string comparison stuff is horked.
+ bclary
+
+ See http://bugzilla.mozilla.org/show_bug.cgi?id=118266 (SpiderMonkey)
+ See http://bugzilla.mozilla.org/show_bug.cgi?id=118636 (Rhino)
+*/
+//-----------------------------------------------------------------------------
+var gTestfile = '15.9.5.7.js';
+var SECTION = "15.9.5.7";
+var VERSION = "ECMA_3";
+var TITLE = "Date.prototype.toLocaleTimeString()";
+
+var status = '';
+var actual = '';
+var expect = '';
+var givenDate;
+var year = '';
+var regexp = '';
+var TimeString = '';
+var reducedDateString = '';
+var hopeThisIsLocaleTimeString = '';
+var cnERR ='OOPS! FATAL ERROR: no regexp match in extractLocaleTimeString()';
+
+startTest();
+writeHeaderToLog( SECTION + " "+ TITLE);
+
+// first, a couple generic tests -
+
+status = "typeof (now.toLocaleTimeString())";
+actual = typeof (now.toLocaleTimeString());
+expect = "string";
+addTestCase();
+
+status = "Date.prototype.toLocaleTimeString.length";
+actual = Date.prototype.toLocaleTimeString.length;
+expect = 0;
+addTestCase();
+
+// 1970
+addDateTestCase(0);
+addDateTestCase(TZ_ADJUST);
+
+// 1900
+addDateTestCase(TIME_1900);
+addDateTestCase(TIME_1900 - TZ_ADJUST);
+
+// 2000
+addDateTestCase(TIME_2000);
+addDateTestCase(TIME_2000 - TZ_ADJUST);
+
+// 29 Feb 2000
+addDateTestCase(UTC_29_FEB_2000);
+addDateTestCase(UTC_29_FEB_2000 - 1000);
+addDateTestCase(UTC_29_FEB_2000 - TZ_ADJUST);
+
+// Now
+addDateTestCase( TIME_NOW);
+addDateTestCase( TIME_NOW - TZ_ADJUST);
+
+// 2005
+addDateTestCase(UTC_1_JAN_2005);
+addDateTestCase(UTC_1_JAN_2005 - 1000);
+addDateTestCase(UTC_1_JAN_2005 - TZ_ADJUST);
+
+test();
+
+function addTestCase()
+{
+ new TestCase(
+ SECTION,
+ status,
+ expect,
+ actual);
+}
+
+
+function addDateTestCase(date_given_in_milliseconds)
+{
+ var s = 'new Date(' + date_given_in_milliseconds + ')';
+ givenDate = new Date(date_given_in_milliseconds);
+
+ status = 'd = ' + s +
+ '; d == new Date(d.toDateString() + " " + d.toLocaleTimeString())';
+ expect = givenDate.toString();
+ actual = new Date(givenDate.toDateString() +
+ ' ' + givenDate.toLocaleTimeString()).toString();
+ addTestCase();
+}
+
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Date/browser.js b/tests/auto/qml/parserstress/tests/ecma_3/Date/browser.js
new file mode 100644
index 0000000000..4cde9b0629
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Date/browser.js
@@ -0,0 +1,37 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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/qml/parserstress/tests/ecma_3/Date/shell.js b/tests/auto/qml/parserstress/tests/ecma_3/Date/shell.js
new file mode 100644
index 0000000000..6111c3b934
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Date/shell.js
@@ -0,0 +1,564 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by the Initial Developer are Copyright (C) 1998
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+gTestsubsuite = 'Date';
+
+/*
+ * 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 TIME_1970 = 0;
+var TIME_2000 = 946684800000;
+var TIME_1900 = -2208988800000;
+var UTC_29_FEB_2000 = TIME_2000 + 31*msPerDay + 28*msPerDay;
+var UTC_1_JAN_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 ) {
+
+ var r = t % msPerDay;
+
+ if (r < 0)
+ {
+ r += msPerDay;
+ }
+ return r;
+
+}
+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 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 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/qml/parserstress/tests/ecma_3/Exceptions/15.11.1.1.js b/tests/auto/qml/parserstress/tests/ecma_3/Exceptions/15.11.1.1.js
new file mode 100644
index 0000000000..6910d76f15
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Exceptions/15.11.1.1.js
@@ -0,0 +1,137 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_3/Exceptions/15.11.4.4-1.js b/tests/auto/qml/parserstress/tests/ecma_3/Exceptions/15.11.4.4-1.js
new file mode 100644
index 0000000000..00f9503041
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Exceptions/15.11.4.4-1.js
@@ -0,0 +1,174 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_3/Exceptions/15.11.7.6-001.js b/tests/auto/qml/parserstress/tests/ecma_3/Exceptions/15.11.7.6-001.js
new file mode 100644
index 0000000000..c6248cc7c1
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Exceptions/15.11.7.6-001.js
@@ -0,0 +1,130 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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<UBound; i++)
+ {
+ reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
+ }
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Exceptions/15.11.7.6-002.js b/tests/auto/qml/parserstress/tests/ecma_3/Exceptions/15.11.7.6-002.js
new file mode 100644
index 0000000000..a9da1c4e4e
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Exceptions/15.11.7.6-002.js
@@ -0,0 +1,132 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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 DontDelete
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=201989
+ *
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = '15.11.7.6-002.js';
+var UBound = 0;
+var BUGNUMBER = 201989;
+var summary = 'Prototype of predefined error objects should be DontDelete';
+var status = '';
+var statusitems = [];
+var actual = '';
+var actualvalues = [];
+var expect= '';
+var expectedvalues = [];
+
+
+/*
+ * Tests that |F.prototype| is DontDelete
+ */
+function testDontDelete(F)
+{
+ var e;
+ var orig = F.prototype;
+ try
+ {
+ delete F.prototype;
+ }
+ catch (e)
+ {
+ }
+ return F.prototype === orig;
+}
+
+
+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 DontDelete attribute of |' + list[i] + '.prototype|';
+ actual = testDontDelete(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<UBound; i++)
+ {
+ reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
+ }
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Exceptions/15.11.7.6-003.js b/tests/auto/qml/parserstress/tests/ecma_3/Exceptions/15.11.7.6-003.js
new file mode 100644
index 0000000000..af45b2112d
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Exceptions/15.11.7.6-003.js
@@ -0,0 +1,132 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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 ReadOnly
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=201989
+ *
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = '15.11.7.6-003.js';
+var UBound = 0;
+var BUGNUMBER = 201989;
+var summary = 'Prototype of predefined error objects should be ReadOnly';
+var status = '';
+var statusitems = [];
+var actual = '';
+var actualvalues = [];
+var expect= '';
+var expectedvalues = [];
+
+
+/*
+ * Tests that |F.prototype| is ReadOnly
+ */
+function testReadOnly(F)
+{
+ var e;
+ var orig = F.prototype;
+ try
+ {
+ F.prototype = new Object();
+ }
+ catch (e)
+ {
+ }
+ return F.prototype === orig;
+}
+
+
+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 ReadOnly attribute of |' + list[i] + '.prototype|';
+ actual = testReadOnly(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<UBound; i++)
+ {
+ reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
+ }
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Exceptions/binding-001.js b/tests/auto/qml/parserstress/tests/ecma_3/Exceptions/binding-001.js
new file mode 100644
index 0000000000..ea2dd6042f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Exceptions/binding-001.js
@@ -0,0 +1,128 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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):
+ * brendan@mozilla.org, 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-08-27
+ *
+ * SUMMARY: Testing binding of function names
+ *
+ * Brendan:
+ *
+ * "... the question is, does Rhino bind 'sum' in the global object
+ * for the following test? If it does, it's buggy.
+ *
+ * var f = function sum(){};
+ * print(sum); // should fail with 'sum is not defined' "
+ *
+ */
+
+//-----------------------------------------------------------------------------
+var gTestfile = 'binding-001.js';
+var UBound = 0;
+var BUGNUMBER = '(none)';
+var summary = 'Testing binding of function names';
+var ERR_REF_YES = 'ReferenceError';
+var ERR_REF_NO = 'did NOT generate a ReferenceError';
+var statusitems = [];
+var actualvalues = [];
+var expectedvalues = [];
+var status = summary;
+var actual = ERR_REF_NO;
+var expect= ERR_REF_YES;
+
+
+try
+{
+ var f = function sum(){};
+ print(sum);
+}
+catch (e)
+{
+ status = 'Section 1 of test';
+ actual = e instanceof ReferenceError;
+ expect = true;
+ addThis();
+
+
+ /*
+ * This test is more literal, and one day may not be valid.
+ * 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? ERR_REF_YES : ERR_REF_NO;
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Exceptions/browser.js b/tests/auto/qml/parserstress/tests/ecma_3/Exceptions/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Exceptions/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Exceptions/regress-181654.js b/tests/auto/qml/parserstress/tests/ecma_3/Exceptions/regress-181654.js
new file mode 100644
index 0000000000..3fe80f15ac
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Exceptions/regress-181654.js
@@ -0,0 +1,155 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_3/Exceptions/regress-181914.js b/tests/auto/qml/parserstress/tests/ecma_3/Exceptions/regress-181914.js
new file mode 100644
index 0000000000..f4d1f224c8
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Exceptions/regress-181914.js
@@ -0,0 +1,194 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_3/Exceptions/regress-58946.js b/tests/auto/qml/parserstress/tests/ecma_3/Exceptions/regress-58946.js
new file mode 100644
index 0000000000..97212c88a0
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Exceptions/regress-58946.js
@@ -0,0 +1,71 @@
+/* -*- 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/qml/parserstress/tests/ecma_3/Exceptions/regress-95101.js b/tests/auto/qml/parserstress/tests/ecma_3/Exceptions/regress-95101.js
new file mode 100644
index 0000000000..b7ef074350
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Exceptions/regress-95101.js
@@ -0,0 +1,118 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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/qml/parserstress/tests/ecma_3/Exceptions/shell.js b/tests/auto/qml/parserstress/tests/ecma_3/Exceptions/shell.js
new file mode 100644
index 0000000000..6c671f1eea
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Exceptions/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'Exceptions';
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/10.1.3-1.js b/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/10.1.3-1.js
new file mode 100644
index 0000000000..1e7e0254bf
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/10.1.3-1.js
@@ -0,0 +1,201 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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<arguments.length; i++)
+ ret.push(arguments[i]);
+
+ return ret.toString();
+}
+status = inSection(6);
+actual = f6(1,2,3,4);
+expect = '1,2,3,4';
+addThis();
+
+
+/*
+ * This variation (assigning to x inside f) is from nboyd@atg.com
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=124900
+ */
+function f7(x,x,x,x)
+{
+ x = 999;
+ var ret = [];
+
+ for (var i=0; i<arguments.length; i++)
+ ret.push(arguments[i]);
+
+ return ret.toString();
+}
+status = inSection(7);
+actual = f7(1,2,3,4);
+expect = '1,2,3,999';
+addThis();
+
+
+/*
+ * Same as above, but with |var| keyword added -
+ */
+function f8(x,x,x,x)
+{
+ var x = 999;
+ var ret = [];
+
+ for (var i=0; i<arguments.length; i++)
+ ret.push(arguments[i]);
+
+ return ret.toString();
+}
+status = inSection(8);
+actual = f8(1,2,3,4);
+expect = '1,2,3,999';
+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<UBound; i++)
+ {
+ reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
+ }
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/10.1.3-2.js b/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/10.1.3-2.js
new file mode 100644
index 0000000000..b2e22e6c55
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/10.1.3-2.js
@@ -0,0 +1,70 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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 = '10.1.3-2.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 395907;
+var summary = 'eval of function declaration should change existing variable';
+var actual = '';
+var expect = '';
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ expect = 'typeof x: number, typeof x: function, x(): true';
+ var x = "string";
+ function f () {
+ var x = 0;
+ actual += 'typeof x: ' + (typeof x) + ', ';
+ eval('function x() { return true; }');
+ actual += 'typeof x: ' + (typeof x) + ', ';
+ actual += 'x(): ' + x();
+ }
+ f();
+
+ reportCompare(expect, actual, summary);
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/10.1.3.js b/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/10.1.3.js
new file mode 100644
index 0000000000..45a81f1f3a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/10.1.3.js
@@ -0,0 +1,73 @@
+/* -*- 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 = '10.1.3.js';
+
+/**
+ ECMA Section: 10.1.3: Variable Instantiation
+ FunctionDeclarations are processed before VariableDeclarations, and
+ VariableDeclarations don't replace existing values with undefined
+*/
+
+test();
+
+function f()
+{
+ var x;
+
+ return typeof x;
+
+ function x()
+ {
+ return 7;
+ }
+}
+
+function test()
+{
+ enterFunc ("test");
+
+ printStatus ("ECMA Section: 10.1.3: Variable Instantiation.");
+ printBugNumber (17290);
+
+ reportCompare ("function", f(), "Declaration precedence test");
+
+ exitFunc("test");
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/10.1.4-1.js b/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/10.1.4-1.js
new file mode 100644
index 0000000000..896841fa29
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/10.1.4-1.js
@@ -0,0 +1,85 @@
+/* -*- 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 = '10.1.4-1.js';
+
+/**
+ ECMA Section: 10.1.4.1 Entering An Execution Context
+ ECMA says:
+ * Global Code, Function Code
+ Variable instantiation is performed using the global object as the
+ variable object and using property attributes { DontDelete }.
+
+ * Eval Code
+ Variable instantiation is performed using the calling context's
+ variable object and using empty property attributes.
+*/
+
+var BUGNUMBER = '(none)';
+var summary = '10.1.4.1 Entering An Execution Context';
+var actual = '';
+var expect = '';
+
+test();
+
+function test()
+{
+ enterFunc ("test");
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ var y;
+ eval("var x = 1");
+
+ if (delete y)
+ reportCompare('PASS', 'FAIL', "Expected *NOT* to be able to delete y");
+
+ if (typeof x == "undefined")
+ reportCompare('PASS', 'FAIL', "x did not remain defined after eval()");
+ else if (x != 1)
+ reportCompare('PASS', 'FAIL', "x did not retain it's value after eval()");
+
+ if (!delete x)
+ reportCompare('PASS', 'FAIL', "Expected to be able to delete x");
+
+ reportCompare('PASS', 'PASS', '10.1.4.1 Entering An Execution Context');
+
+ exitFunc("test");
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/10.6.1-01.js b/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/10.6.1-01.js
new file mode 100755
index 0000000000..6fbe85e19f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/10.6.1-01.js
@@ -0,0 +1,136 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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 = '10.6.1-01.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 290774;
+var summary = 'activation object never delegates to Object.prototype';
+var actual = '';
+var expect = '';
+
+printBugNumber(BUGNUMBER);
+printStatus (summary);
+
+var toStringResult;
+var evalResult;
+var watchResult;
+var parseIntResult;
+
+var eval = 'fooEval';
+var watch = undefined;
+var parseInt = 'fooParseInt';
+
+
+function toString()
+{
+ return 'fooString';
+}
+
+function normal()
+{
+ toStringResult = toString;
+ evalResult = eval;
+ watchResult = watch;
+ parseIntResult = parseInt;
+}
+
+function outerinnervar()
+{
+ toStringResult = toString;
+ evalResult = eval;
+ watchResult = watch;
+ parseIntResult = parseInt;
+ function inner()
+ {
+ // addition of any statement
+ // which accesses a variable
+ // from the outer scope causes the bug
+ printStatus(toString);
+ }
+}
+
+expect = true;
+
+printStatus('normal');
+printStatus('======');
+normal();
+
+printStatus('toStringResult ' + toStringResult);
+printStatus('toString ' + toString);
+actual = ((toStringResult + '') == (toString + ''));
+reportCompare(expect, actual, inSection(1));
+
+printStatus('evalResult ' + evalResult);
+printStatus('eval ' + eval);
+actual = ((evalResult + '') == (eval + ''));
+reportCompare(expect, actual, inSection(2));
+
+printStatus('watchResult ' + watchResult);
+printStatus('watch ' + watch);
+actual = ((watchResult + '') == (watch + ''));
+reportCompare(expect, actual, inSection(3));
+
+printStatus('parseIntResult ' + parseIntResult);
+printStatus('parseInt ' + parseInt);
+actual = ((parseIntResult + '') == (parseInt + ''));
+reportCompare(expect, actual, inSection(4));
+
+printStatus('outerinner');
+printStatus('==========');
+
+outerinnervar();
+
+printStatus('toStringResult ' + toStringResult);
+printStatus('toString ' + toString);
+actual = ((toStringResult + '') == (toString + ''));
+reportCompare(expect, actual, inSection(5));
+
+
+printStatus('evalResult ' + evalResult);
+printStatus('eval ' + eval);
+actual = ((evalResult + '') == (eval + ''));
+reportCompare(expect, actual, inSection(6));
+
+printStatus('watchResult ' + watchResult);
+printStatus('watch ' + watch);
+actual = ((watchResult + '') == (watch + ''));
+reportCompare(expect, actual, inSection(7));
+
+printStatus('parseIntResult ' + parseIntResult);
+printStatus('parseInt ' + parseInt);
+actual = ((parseIntResult + '') == (parseInt + ''));
+reportCompare(expect, actual, inSection(8));
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/browser.js b/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/regress-23346.js b/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/regress-23346.js
new file mode 100644
index 0000000000..6283d886f0
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/regress-23346.js
@@ -0,0 +1,71 @@
+/* -*- 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 = 'regress-23346.js';
+
+var CALL_CALLED = "PASSED";
+
+test();
+
+function f(x)
+{
+ if (x)
+ return call();
+
+ return "FAILED!";
+}
+
+function call()
+{
+ return CALL_CALLED;
+}
+
+function test()
+{
+ enterFunc ("test");
+
+ printStatus ("ECMA Section: 10.1.3: Variable Instantiation.");
+ printBugNumber (23346);
+
+ reportCompare ("PASSED", f(true),
+ "Unqualified reference should not see Function.prototype");
+
+ exitFunc("test");
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/regress-448595-01.js b/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/regress-448595-01.js
new file mode 100755
index 0000000000..f303199b51
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/regress-448595-01.js
@@ -0,0 +1,91 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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): Oliver Hunt
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient 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-448595-01.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 448595;
+var summary = 'scope chain var declaration with initialiser in |with| clauses';
+var actual = '';
+var expect = '';
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ var f;
+
+ expect = 'bar';
+
+ f = function(){
+ var e = "bar";
+ with({e:"foo"}) {
+ var e = "wibble";
+ };
+
+ actual = e;
+ }
+
+ f();
+
+ reportCompare(expect, actual, summary + ': with');
+
+ f = function(){
+ var e = "bar";
+ try
+ {
+ throw {e:"foo"};
+ }
+ catch(e) {
+ var e = "wibble";
+ };
+
+ actual = e;
+ }
+
+ f();
+
+ reportCompare(expect, actual, summary + ': catch');
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/shell.js b/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/shell.js
new file mode 100644
index 0000000000..1d353cff74
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/ExecutionContexts/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'ExecutionContexts';
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Expressions/11.10-01.js b/tests/auto/qml/parserstress/tests/ecma_3/Expressions/11.10-01.js
new file mode 100755
index 0000000000..fd47d5d86b
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Expressions/11.10-01.js
@@ -0,0 +1,76 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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.10-01.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 396969;
+var summary = '11.10 - & 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 = 2;
+
+ 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/qml/parserstress/tests/ecma_3/Expressions/11.10-02.js b/tests/auto/qml/parserstress/tests/ecma_3/Expressions/11.10-02.js
new file mode 100755
index 0000000000..8f387c1349
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Expressions/11.10-02.js
@@ -0,0 +1,76 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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.10-02.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 396969;
+var summary = '11.10 - ^ 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 = 40;
+
+ 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/qml/parserstress/tests/ecma_3/Expressions/11.10-03.js b/tests/auto/qml/parserstress/tests/ecma_3/Expressions/11.10-03.js
new file mode 100755
index 0000000000..99af0f87c5
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Expressions/11.10-03.js
@@ -0,0 +1,76 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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.10-03.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 396969;
+var summary = '11.10 - | 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 = 42;
+
+ 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/qml/parserstress/tests/ecma_3/Expressions/11.6.1-1.js b/tests/auto/qml/parserstress/tests/ecma_3/Expressions/11.6.1-1.js
new file mode 100644
index 0000000000..8854c499f2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Expressions/11.6.1-1.js
@@ -0,0 +1,176 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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):
+ * bzbarsky@mit.edu, 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 Mar 2003
+ * SUMMARY: Testing left-associativity of the + operator
+ *
+ * See ECMA-262 Ed.3, Section 11.6.1, "The Addition operator"
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=196290
+ *
+ * The upshot: |a + b + c| should always equal |(a + b) + c|
+ *
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = '11.6.1-1.js';
+var UBound = 0;
+var BUGNUMBER = 196290;
+var summary = 'Testing left-associativity of the + operator';
+var status = '';
+var statusitems = [];
+var actual = '';
+var actualvalues = [];
+var expect= '';
+var expectedvalues = [];
+
+
+status = inSection(1);
+actual = 1 + 1 + 'px';
+expect = '2px';
+addThis();
+
+status = inSection(2);
+actual = 'px' + 1 + 1;
+expect = 'px11';
+addThis();
+
+status = inSection(3);
+actual = 1 + 1 + 1 + 'px';
+expect = '3px';
+addThis();
+
+status = inSection(4);
+actual = 1 + 1 + 'a' + 1 + 1 + 'b';
+expect = '2a11b';
+addThis();
+
+/*
+ * The next sections test the + operator via eval()
+ */
+status = inSection(5);
+actual = sumThese(1, 1, 'a', 1, 1, 'b');
+expect = '2a11b';
+addThis();
+
+status = inSection(6);
+actual = sumThese(new Number(1), new Number(1), 'a');
+expect = '2a';
+addThis();
+
+status = inSection(7);
+actual = sumThese('a', new Number(1), new Number(1));
+expect = 'a11';
+addThis();
+
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+
+
+function addThis()
+{
+ statusitems[UBound] = status;
+ actualvalues[UBound] = actual;
+ expectedvalues[UBound] = expect;
+ UBound++;
+}
+
+/*
+ * Applies the + operator to the provided arguments via eval().
+ *
+ * Form an eval string of the form 'arg1 + arg2 + arg3', but
+ * remember to add double-quotes inside the eval string around
+ * any argument that is of string type. For example, suppose the
+ * arguments were 11, 'a', 22. Then the eval string should be
+ *
+ * arg1 + quoteThis(arg2) + arg3
+ *
+ * If we didn't put double-quotes around the string argument,
+ * we'd get this for an eval string:
+ *
+ * '11 + a + 22'
+ *
+ * If we eval() this, we get 'ReferenceError: a is not defined'.
+ * With proper quoting, we get eval('11 + "a" + 22') as desired.
+ */
+function sumThese()
+{
+ var sEval = '';
+ var arg;
+ var i;
+
+ var L = arguments.length;
+ for (i=0; i<L; i++)
+ {
+ arg = arguments[i];
+ if (typeof arg === 'string')
+ arg = quoteThis(arg);
+
+ if (i < L-1)
+ sEval += arg + ' + ';
+ else
+ sEval += arg;
+ }
+
+ return eval(sEval);
+}
+
+
+function quoteThis(x)
+{
+ return '"' + x + '"';
+}
+
+
+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/qml/parserstress/tests/ecma_3/Expressions/11.7.1-01.js b/tests/auto/qml/parserstress/tests/ecma_3/Expressions/11.7.1-01.js
new file mode 100755
index 0000000000..05f9622ce2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Expressions/11.7.1-01.js
@@ -0,0 +1,76 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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.1-01.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 396969;
+var summary = '11.7.1 - << 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 = 168;
+
+ 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/qml/parserstress/tests/ecma_3/Expressions/11.7.2-01.js b/tests/auto/qml/parserstress/tests/ecma_3/Expressions/11.7.2-01.js
new file mode 100755
index 0000000000..64e426888a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Expressions/11.7.2-01.js
@@ -0,0 +1,76 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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.2-01.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 396969;
+var summary = '11.7.2 - >> 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/qml/parserstress/tests/ecma_3/Expressions/11.7.3-01.js b/tests/auto/qml/parserstress/tests/ecma_3/Expressions/11.7.3-01.js
new file mode 100755
index 0000000000..d5af3b86d4
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Expressions/11.7.3-01.js
@@ -0,0 +1,76 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_3/Expressions/11.9.6-1.js b/tests/auto/qml/parserstress/tests/ecma_3/Expressions/11.9.6-1.js
new file mode 100644
index 0000000000..1e8f59e400
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Expressions/11.9.6-1.js
@@ -0,0 +1,213 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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<arr.length; i++)
+ {
+ elt = arr[i];
+
+ switch(true)
+ {
+ case (elt === null) :
+ res = true;
+ break;
+
+ default:
+ // do nothing
+ }
+ }
+
+ return res;
+}
+
+var arr = Array('a', undefined);
+actual = f4(arr);
+expect = false;
+addThis();
+
+
+
+status = inSection(5);
+function f5(arr)
+{
+ var len = arr.length;
+
+ for(var i=0; (arr[i]===undefined) && (i<len); i++)
+ ; //do nothing
+
+ return i;
+}
+
+/*
+ * An array of 5 undefined elements. Note:
+ *
+ * The return value of eval(a STATEMENT) is undefined.
+ * A non-existent PROPERTY is undefined, not a ReferenceError.
+ * No undefined element exists AFTER trailing comma at end.
+ *
+ */
+var arrUndef = [ , undefined, eval('var x = 0'), this.NOT_A_PROPERTY, , ];
+actual = f5(arrUndef);
+expect = 5;
+addThis();
+
+
+
+status = inSection(6);
+function f6(arr)
+{
+ var len = arr.length;
+
+ for(var i=0; (arr[i]===null) && (i<len); i++)
+ ; //do nothing
+
+ return i;
+}
+
+/*
+ * Use same array as above. This time we're comparing to |null|, so we expect 0
+ */
+actual = f6(arrUndef);
+expect = 0;
+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<UBound; i++)
+ {
+ reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
+ }
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Expressions/browser.js b/tests/auto/qml/parserstress/tests/ecma_3/Expressions/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Expressions/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Expressions/shell.js b/tests/auto/qml/parserstress/tests/ecma_3/Expressions/shell.js
new file mode 100644
index 0000000000..8f5d1129d5
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Expressions/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'Expressions';
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/FunExpr/browser.js b/tests/auto/qml/parserstress/tests/ecma_3/FunExpr/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/FunExpr/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/FunExpr/fe-001-n.js b/tests/auto/qml/parserstress/tests/ecma_3/FunExpr/fe-001-n.js
new file mode 100644
index 0000000000..71ed2fbb08
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/FunExpr/fe-001-n.js
@@ -0,0 +1,58 @@
+/* -*- 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 = 'fe-001-n.js';
+
+DESCRIPTION = "Previous statement should have thrown a ReferenceError";
+EXPECTED = "error";
+
+test();
+
+function test()
+{
+ enterFunc ("test");
+ printStatus ("Function Expression test.");
+
+ var x = function f(){return "inner";}();
+ var y = f();
+ reportCompare('PASS', 'FAIL', "Previous statement should have thrown a ReferenceError");
+
+ exitFunc ("test");
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/FunExpr/fe-001.js b/tests/auto/qml/parserstress/tests/ecma_3/FunExpr/fe-001.js
new file mode 100644
index 0000000000..366c5fd472
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/FunExpr/fe-001.js
@@ -0,0 +1,57 @@
+/* -*- 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 = 'fe-001.js';
+
+if (1) function f() {return 1;}
+if (0) function f() {return 0;}
+
+function test()
+{
+ enterFunc ("test");
+
+ printStatus ("Function Expression Statements basic test.");
+
+ reportCompare (1, f(), "Both functions were defined.");
+
+ exitFunc ("test");
+}
+
+test();
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/FunExpr/fe-002.js b/tests/auto/qml/parserstress/tests/ecma_3/FunExpr/fe-002.js
new file mode 100644
index 0000000000..d602b01b09
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/FunExpr/fe-002.js
@@ -0,0 +1,61 @@
+/* -*- 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 = 'fe-002.js';
+
+function f()
+{
+ return "outer";
+}
+
+function test()
+{
+ enterFunc ("test");
+ printStatus ("Function Expression test.");
+
+ var x = function f(){return "inner";}();
+
+ reportCompare ("outer", f(),
+ "Inner function statement should not have been called.");
+
+ exitFunc ("test");
+}
+
+test();
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/FunExpr/shell.js b/tests/auto/qml/parserstress/tests/ecma_3/FunExpr/shell.js
new file mode 100644
index 0000000000..ecf5f4798f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/FunExpr/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'FunExpr';
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Function/15.3.4.3-1.js b/tests/auto/qml/parserstress/tests/ecma_3/Function/15.3.4.3-1.js
new file mode 100644
index 0000000000..ef51379e4f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Function/15.3.4.3-1.js
@@ -0,0 +1,210 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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):
+ * igor3@apochta.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: 21 May 2002
+ * SUMMARY: ECMA conformance of Function.prototype.apply
+ *
+ * Function.prototype.apply(thisArg, argArray)
+ *
+ * See ECMA-262 Edition 3 Final, Section 15.3.4.3
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = '15.3.4.3-1.js';
+var UBound = 0;
+var BUGNUMBER = 145791;
+var summary = 'Testing ECMA conformance of Function.prototype.apply';
+var status = '';
+var statusitems = [];
+var actual = '';
+var actualvalues = [];
+var expect= '';
+var expectedvalues = [];
+
+
+function F0(a)
+{
+ return "" + this + arguments.length;
+}
+
+function F1(a)
+{
+ return "" + this + a;
+}
+
+function F2()
+{
+ return "" + this;
+}
+
+
+
+/*
+ * Function.prototype.apply.length should return 2
+ */
+status = inSection(1);
+actual = Function.prototype.apply.length;
+expect = 2;
+addThis();
+
+
+/*
+ * When |thisArg| is not provided to the apply() method, the
+ * called function must be passed the global object as |this|
+ */
+status = inSection(2);
+actual = F0.apply();
+expect = "" + this + 0;
+addThis();
+
+
+/*
+ * If |argArray| is not provided to the apply() method, the
+ * called function should be invoked with an empty argument list
+ */
+status = inSection(3);
+actual = F0.apply("");
+expect = "" + "" + 0;
+addThis();
+
+status = inSection(4);
+actual = F0.apply(true);
+expect = "" + true + 0;
+addThis();
+
+
+/*
+ * Function.prototype.apply(x) and
+ * Function.prototype.apply(x, undefined) should return the same result
+ */
+status = inSection(5);
+actual = F1.apply(0, undefined);
+expect = F1.apply(0);
+addThis();
+
+status = inSection(6);
+actual = F1.apply("", undefined);
+expect = F1.apply("");
+addThis();
+
+status = inSection(7);
+actual = F1.apply(null, undefined);
+expect = F1.apply(null);
+addThis();
+
+status = inSection(8);
+actual = F1.apply(undefined, undefined);
+expect = F1.apply(undefined);
+addThis();
+
+
+/*
+ * Function.prototype.apply(x) and
+ * Function.prototype.apply(x, null) should return the same result
+ */
+status = inSection(9);
+actual = F1.apply(0, null);
+expect = F1.apply(0);
+addThis();
+
+status = inSection(10);
+actual = F1.apply("", null);
+expect = F1.apply("");
+addThis();
+
+status = inSection(11);
+actual = F1.apply(null, null);
+expect = F1.apply(null);
+addThis();
+
+status = inSection(12);
+actual = F1.apply(undefined, null);
+expect = F1.apply(undefined);
+addThis();
+
+
+/*
+ * Function.prototype.apply() and
+ * Function.prototype.apply(undefined) should return the same result
+ */
+status = inSection(13);
+actual = F2.apply(undefined);
+expect = F2.apply();
+addThis();
+
+
+/*
+ * Function.prototype.apply() and
+ * Function.prototype.apply(null) should return the same result
+ */
+status = inSection(14);
+actual = F2.apply(null);
+expect = F2.apply();
+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<UBound; i++)
+ {
+ reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
+ }
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Function/15.3.4.4-1.js b/tests/auto/qml/parserstress/tests/ecma_3/Function/15.3.4.4-1.js
new file mode 100644
index 0000000000..d27b8487b7
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Function/15.3.4.4-1.js
@@ -0,0 +1,185 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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):
+ * igor3@apochta.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: 21 May 2002
+ * SUMMARY: ECMA conformance of Function.prototype.call
+ *
+ * Function.prototype.call(thisArg [,arg1 [,arg2, ...]])
+ *
+ * See ECMA-262 Edition 3 Final, Section 15.3.4.4
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = '15.3.4.4-1.js';
+var UBound = 0;
+var BUGNUMBER = 145791;
+var summary = 'Testing ECMA conformance of Function.prototype.call';
+var status = '';
+var statusitems = [];
+var actual = '';
+var actualvalues = [];
+var expect= '';
+var expectedvalues = [];
+
+
+function F0(a)
+{
+ return "" + this + arguments.length;
+}
+
+function F1(a)
+{
+ return "" + this + a;
+}
+
+function F2()
+{
+ return "" + this;
+}
+
+
+
+/*
+ * Function.prototype.call.length should return 1
+ */
+status = inSection(1);
+actual = Function.prototype.call.length;
+expect = 1;
+addThis();
+
+
+/*
+ * When |thisArg| is not provided to the call() method, the
+ * called function must be passed the global object as |this|
+ */
+status = inSection(2);
+actual = F0.call();
+expect = "" + this + 0;
+addThis();
+
+
+/*
+ * If [,arg1 [,arg2, ...]] are not provided to the call() method,
+ * the called function should be invoked with an empty argument list
+ */
+status = inSection(3);
+actual = F0.call("");
+expect = "" + "" + 0;
+addThis();
+
+status = inSection(4);
+actual = F0.call(true);
+expect = "" + true + 0;
+addThis();
+
+
+/*
+ * Function.prototype.call(x) and
+ * Function.prototype.call(x, undefined) should return the same result
+ */
+status = inSection(5);
+actual = F1.call(0, undefined);
+expect = F1.call(0);
+addThis();
+
+status = inSection(6);
+actual = F1.call("", undefined);
+expect = F1.call("");
+addThis();
+
+status = inSection(7);
+actual = F1.call(null, undefined);
+expect = F1.call(null);
+addThis();
+
+status = inSection(8);
+actual = F1.call(undefined, undefined);
+expect = F1.call(undefined);
+addThis();
+
+
+/*
+ * Function.prototype.call() and
+ * Function.prototype.call(undefined) should return the same result
+ */
+status = inSection(9);
+actual = F2.call(undefined);
+expect = F2.call();
+addThis();
+
+
+/*
+ * Function.prototype.call() and
+ * Function.prototype.call(null) should return the same result
+ */
+status = inSection(10);
+actual = F2.call(null);
+expect = F2.call();
+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<UBound; i++)
+ {
+ reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
+ }
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Function/arguments-001.js b/tests/auto/qml/parserstress/tests/ecma_3/Function/arguments-001.js
new file mode 100644
index 0000000000..2dbd603e02
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Function/arguments-001.js
@@ -0,0 +1,169 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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):
+ * brendan@mozilla.org, 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: 07 May 2001
+ *
+ * SUMMARY: Testing the arguments object
+ *
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=72884
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'arguments-001.js';
+var UBound = 0;
+var BUGNUMBER = 72884;
+var summary = 'Testing the arguments object';
+var status = '';
+var statusitems = [ ];
+var actual = '';
+var actualvalues = [ ];
+var expect= '';
+var expectedvalues = [ ];
+var a = '';
+
+
+status = inSection(1);
+function f()
+{
+ delete arguments.length;
+ return arguments;
+}
+
+a = f();
+actual = a instanceof Object;
+expect = true;
+addThis();
+
+actual = a instanceof Array;
+expect = false;
+addThis();
+
+actual = a.length;
+expect = undefined;
+addThis();
+
+
+
+status = inSection(2);
+a = f(1,2,3);
+actual = a instanceof Object;
+expect = true;
+addThis();
+
+actual = a instanceof Array;
+expect = false;
+addThis();
+
+actual = a.length;
+expect = undefined;
+addThis();
+
+actual = a[0];
+expect = 1;
+addThis();
+
+actual = a[1];
+expect = 2;
+addThis();
+
+actual = a[2];
+expect = 3;
+addThis();
+
+
+
+status = inSection(3);
+/*
+ * Brendan:
+ *
+ * Note that only callee and length can be overridden, so deleting an indexed
+ * property and asking for it again causes it to be recreated by args_resolve:
+ *
+ * function g(){delete arguments[0]; return arguments[0]}
+ * g(42) // should this print 42?
+ *
+ * I'm not positive this violates ECMA, which allows in chapter 16 for extensions
+ * including properties (does it allow for magically reappearing properties?). The
+ * delete operator successfully deletes arguments[0] and results in true, but that
+ * is not distinguishable from the case where arguments[0] was delegated to
+ * Arguments.prototype[0], which was how the bad old code worked.
+ *
+ * I'll ponder this last detail...
+ *
+ * UPDATE: Per ECMA-262, delete on an arguments[i] should succeed
+ * and remove that property from the arguments object, leaving any get
+ * of it after the delete to evaluate to undefined.
+ */
+function g()
+{
+ delete arguments[0];
+ return arguments[0];
+}
+actual = g(42);
+expect = undefined; // not 42...
+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 < UBound; i++)
+ {
+ reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
+ }
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Function/arguments-002.js b/tests/auto/qml/parserstress/tests/ecma_3/Function/arguments-002.js
new file mode 100755
index 0000000000..78005560a7
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Function/arguments-002.js
@@ -0,0 +1,73 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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 = 'arguments-002.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 383269;
+var summary = 'Allow override of arguments';
+var actual = '';
+var expect = '';
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ var expect1 = '33,42';
+ var expect2 = 33;
+ var actual1 = '';
+ var actual2 = '';
+
+ function f(){
+ var a=arguments; actual1 = a[0]; arguments=42; actual1 += ',' + arguments; return a;
+ }
+
+ actual2 = f(33)[0];
+
+ expect = expect1 + ':' + expect2;
+ actual = actual1 + ':' + actual2;
+
+ reportCompare(expect, actual, summary);
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Function/browser.js b/tests/auto/qml/parserstress/tests/ecma_3/Function/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Function/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Function/call-001.js b/tests/auto/qml/parserstress/tests/ecma_3/Function/call-001.js
new file mode 100644
index 0000000000..61ab3b930b
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Function/call-001.js
@@ -0,0 +1,153 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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-13
+ *
+ * SUMMARY: Applying Function.prototype.call to the Function object itself
+ *
+ *
+ * ECMA-262 15.3.4.4 Function.prototype.call (thisArg [,arg1 [,arg2,…] ] )
+ *
+ * When applied to the Function object itself, thisArg should be ignored.
+ * As explained by Waldemar (waldemar@netscape.com):
+ *
+ * Function.call(obj, "print(this)") is equivalent to invoking
+ * Function("print(this)") with this set to obj. Now, Function("print(this)")
+ * is equivalent to new Function("print(this)") (see 15.3.1.1), and the latter
+ * ignores the this value that you passed it and constructs a function
+ * (which we'll call F) which will print the value of the this that will be
+ * passed in when F will be invoked.
+ *
+ * With the last set of () you're invoking F(), which means you're calling it
+ * with no this value. When you don't provide a this value, it defaults to the
+ * global object.
+ *
+ */
+
+//-----------------------------------------------------------------------------
+var gTestfile = 'call-001.js';
+var UBound = 0;
+var BUGNUMBER = '(none)';
+var summary = 'Applying Function.prototype.call to the Function object itself';
+var status = '';
+var statusitems = [];
+var actual = '';
+var actualvalues = [];
+var expect= '';
+var expectedvalues = [];
+var self = this; // capture a reference to the global object
+var cnOBJECT_GLOBAL = self.toString();
+var cnOBJECT_OBJECT = (new Object).toString();
+var cnHello = 'Hello';
+var cnRed = 'red';
+var objTEST = {color:cnRed};
+var f = new Function();
+var g = new Function();
+
+
+f = Function.call(self, 'return cnHello');
+g = Function.call(objTEST, 'return cnHello');
+
+status = 'Section A of test';
+actual = f();
+expect = cnHello;
+captureThis();
+
+status = 'Section B of test';
+actual = g();
+expect = cnHello;
+captureThis();
+
+
+f = Function.call(self, 'return this.toString()');
+g = Function.call(objTEST, 'return this.toString()');
+
+status = 'Section C of test';
+actual = f();
+expect = cnOBJECT_GLOBAL;
+captureThis();
+
+status = 'Section D of test';
+actual = g();
+expect = cnOBJECT_GLOBAL;
+captureThis();
+
+
+f = Function.call(self, 'return this.color');
+g = Function.call(objTEST, 'return this.color');
+
+status = 'Section E of test';
+actual = f();
+expect = undefined;
+captureThis();
+
+status = 'Section F of test';
+actual = g();
+expect = undefined;
+captureThis();
+
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+
+function captureThis()
+{
+ 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/qml/parserstress/tests/ecma_3/Function/regress-131964.js b/tests/auto/qml/parserstress/tests/ecma_3/Function/regress-131964.js
new file mode 100644
index 0000000000..f3998db91c
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Function/regress-131964.js
@@ -0,0 +1,196 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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: 19 Mar 2002
+ * SUMMARY: Function declarations in global or function scope are {DontDelete}.
+ * Function declarations in eval scope are not {DontDelete}.
+ *
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=131964
+ *
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-131964.js';
+var UBound = 0;
+var BUGNUMBER = 131964;
+var summary = 'Functions defined in global or function scope are {DontDelete}';
+var status = '';
+var statusitems = [];
+var actual = '';
+var actualvalues = [];
+var expect= '';
+var expectedvalues = [];
+
+
+status = inSection(1);
+function f()
+{
+ return 'f lives!';
+}
+delete f;
+
+try
+{
+ actual = f();
+}
+catch(e)
+{
+ actual = 'f was deleted';
+}
+
+expect = 'f lives!';
+addThis();
+
+
+
+/*
+ * Try the same test in function scope -
+ */
+status = inSection(2);
+function g()
+{
+ function f()
+ {
+ return 'f lives!';
+ }
+ delete f;
+
+ try
+ {
+ actual = f();
+ }
+ catch(e)
+ {
+ actual = 'f was deleted';
+ }
+
+ expect = 'f lives!';
+ addThis();
+}
+g();
+
+
+
+/*
+ * Try the same test in eval scope - here we EXPECT the function to be deleted (?)
+ */
+status = inSection(3);
+var s = '';
+s += 'function h()';
+s += '{ ';
+s += ' return "h lives!";';
+s += '}';
+s += 'delete h;';
+
+s += 'try';
+s += '{';
+s += ' actual = h();';
+s += '}';
+s += 'catch(e)';
+s += '{';
+s += ' actual = "h was deleted";';
+s += '}';
+
+s += 'expect = "h was deleted";';
+s += 'addThis();';
+eval(s);
+
+
+/*
+ * Define the function in eval scope, but delete it in global scope -
+ */
+status = inSection(4);
+s = '';
+s += 'function k()';
+s += '{ ';
+s += ' return "k lives!";';
+s += '}';
+eval(s);
+
+delete k;
+
+try
+{
+ actual = k();
+}
+catch(e)
+{
+ actual = 'k was deleted';
+}
+
+expect = 'k was deleted';
+addThis();
+
+
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+
+
+function wasDeleted(functionName)
+{
+ return functionName + ' was deleted...';
+}
+
+
+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/qml/parserstress/tests/ecma_3/Function/regress-137181.js b/tests/auto/qml/parserstress/tests/ecma_3/Function/regress-137181.js
new file mode 100644
index 0000000000..1bf7c35f93
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Function/regress-137181.js
@@ -0,0 +1,113 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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):
+ * ibukanov8@yahoo.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: 12 Apr 2002
+ * SUMMARY: delete arguments[i] should break connection to local reference
+ *
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=137181
+ *
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-137181.js';
+var UBound = 0;
+var BUGNUMBER = 137181;
+var summary = 'delete arguments[i] should break connection to local reference';
+var status = '';
+var statusitems = [];
+var actual = '';
+var actualvalues = [];
+var expect= '';
+var expectedvalues = [];
+
+
+status = inSection(1);
+function f1(x)
+{
+ x = 1;
+ delete arguments[0];
+ return x;
+}
+actual = f1(0); // (bug: Rhino was returning |undefined|)
+expect = 1;
+addThis();
+
+
+status = inSection(2);
+function f2(x)
+{
+ x = 1;
+ delete arguments[0];
+ arguments[0] = -1;
+ return x;
+}
+actual = f2(0); // (bug: Rhino was returning -1)
+expect = 1;
+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<UBound; i++)
+ {
+ reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
+ }
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Function/regress-193555.js b/tests/auto/qml/parserstress/tests/ecma_3/Function/regress-193555.js
new file mode 100644
index 0000000000..ed37b46c90
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Function/regress-193555.js
@@ -0,0 +1,136 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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@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: 17 February 2003
+ * SUMMARY: Testing access to function name from inside function
+ *
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=193555
+ *
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-193555.js';
+var UBound = 0;
+var BUGNUMBER = 193555;
+var summary = 'Testing access to function name from inside function';
+var status = '';
+var statusitems = [];
+var actual = '';
+var actualvalues = [];
+var expect= '';
+var expectedvalues = [];
+
+
+// test via function statement
+status = inSection(1);
+function f() {return f.toString();};
+actual = f();
+expect = f.toString();
+addThis();
+
+// test via function expression
+status = inSection(2);
+var x = function g() {return g.toString();};
+actual = x();
+expect = x.toString();
+addThis();
+
+// test via eval() outside function
+status = inSection(3);
+eval ('function a() {return a.toString();}');
+actual = a();
+expect = a.toString();
+addThis();
+
+status = inSection(4);
+eval ('var y = function b() {return b.toString();}');
+actual = y();
+expect = y.toString();
+addThis();
+
+// test via eval() inside function
+status = inSection(5);
+function c() {return eval('c').toString();};
+actual = c();
+expect = c.toString();
+addThis();
+
+status = inSection(6);
+var z = function d() {return eval('d').toString();};
+actual = z();
+expect = z.toString();
+addThis();
+
+// test via two evals!
+status = inSection(7);
+eval('var w = function e() {return eval("e").toString();}');
+actual = w();
+expect = w.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<UBound; i++)
+ {
+ reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
+ }
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Function/regress-313570.js b/tests/auto/qml/parserstress/tests/ecma_3/Function/regress-313570.js
new file mode 100755
index 0000000000..e159c4c87f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Function/regress-313570.js
@@ -0,0 +1,63 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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): Yuh-Ruey 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 = 'regress-313570.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 313570;
+var summary = 'length of objects whose prototype chain includes a function';
+var actual = '';
+var expect = '';
+
+printBugNumber(BUGNUMBER);
+printStatus (summary);
+
+function tmp() {}
+tmp.prototype = function(a, b, c) {};
+var obj = new tmp();
+
+// arity
+expect = 3;
+actual = obj.length;
+reportCompare(expect, actual, summary + ': arity');
+
+// immutable
+obj.length = 10;
+
+expect = 3;
+actual = obj.length;
+reportCompare(expect, actual, summary + ': immutable');
+
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Function/regress-49286.js b/tests/auto/qml/parserstress/tests/ecma_3/Function/regress-49286.js
new file mode 100644
index 0000000000..50e203bed8
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Function/regress-49286.js
@@ -0,0 +1,137 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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):
+ * jlaprise@delanotech.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: 2001-07-10
+ *
+ * SUMMARY: Invoking try...catch through Function.call
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=49286
+ *
+ * 1) Define a function with a try...catch block in it
+ * 2) Invoke the function via the call method of Function
+ * 3) Pass bad syntax to the try...catch block
+ * 4) We should catch the error!
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-49286.js';
+var UBound = 0;
+var BUGNUMBER = 49286;
+var summary = 'Invoking try...catch through Function.call';
+var cnErrorCaught = 'Error caught';
+var cnErrorNotCaught = 'Error NOT caught';
+var cnGoodSyntax = '1==2';
+var cnBadSyntax = '1=2';
+var status = '';
+var statusitems = [];
+var actual = '';
+var actualvalues = [];
+var expect= '';
+var expectedvalues = [];
+
+
+var obj = new testObject();
+
+status = 'Section A of test: direct call of f';
+actual = f.call(obj);
+expect = cnErrorCaught;
+addThis();
+
+status = 'Section B of test: indirect call of f';
+actual = g.call(obj);
+expect = cnErrorCaught;
+addThis();
+
+
+
+//-----------------------------------------
+test();
+//-----------------------------------------
+
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ for (var i=0; i<UBound; i++)
+ {
+ reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
+ }
+
+ exitFunc ('test');
+}
+
+
+// An object storing bad syntax as a property -
+function testObject()
+{
+ this.badSyntax = cnBadSyntax;
+ this.goodSyntax = cnGoodSyntax;
+}
+
+
+// A function wrapping a try...catch block
+function f()
+{
+ try
+ {
+ eval(this.badSyntax);
+ }
+ catch(e)
+ {
+ return cnErrorCaught;
+ }
+ return cnErrorNotCaught;
+}
+
+
+// A function wrapping a call to f -
+function g()
+{
+ return f.call(this);
+}
+
+
+function addThis()
+{
+ statusitems[UBound] = status;
+ actualvalues[UBound] = actual;
+ expectedvalues[UBound] = expect;
+ UBound++;
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Function/regress-58274.js b/tests/auto/qml/parserstress/tests/ecma_3/Function/regress-58274.js
new file mode 100644
index 0000000000..da5bde597f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Function/regress-58274.js
@@ -0,0 +1,226 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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 functions 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 = '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<UBound; i++)
+ {
+ reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
+ }
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Function/regress-85880.js b/tests/auto/qml/parserstress/tests/ecma_3/Function/regress-85880.js
new file mode 100644
index 0000000000..8ea4fb6c41
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Function/regress-85880.js
@@ -0,0 +1,173 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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-06-14
+ *
+ * SUMMARY: Regression test for Bugzilla bug 85880
+ *
+ * Rhino interpreted mode was nulling out the arguments object of a
+ * function if it happened to call another function inside its body.
+ *
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=85880
+ *
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-85880.js';
+var UBound = 0;
+var BUGNUMBER = 85880;
+var summary = 'Arguments object of g(){f()} should not be null';
+var cnNonNull = 'Arguments != null';
+var cnNull = 'Arguments == null';
+var cnRecurse = true;
+var status = '';
+var statusitems = [];
+var actual = '';
+var actualvalues = [];
+var expect= '';
+var expectedvalues = [];
+
+
+function f1(x)
+{
+}
+
+
+function f2()
+{
+ return f2.arguments;
+}
+status = 'Section A of test';
+actual = (f2() == null);
+expect = false;
+addThis();
+
+status = 'Section B of test';
+actual = (f2(0) == null);
+expect = false;
+addThis();
+
+
+function f3()
+{
+ f1();
+ return f3.arguments;
+}
+status = 'Section C of test';
+actual = (f3() == null);
+expect = false;
+addThis();
+
+status = 'Section D of test';
+actual = (f3(0) == null);
+expect = false;
+addThis();
+
+
+function f4()
+{
+ f1();
+ f2();
+ f3();
+ return f4.arguments;
+}
+status = 'Section E of test';
+actual = (f4() == null);
+expect = false;
+addThis();
+
+status = 'Section F of test';
+actual = (f4(0) == null);
+expect = false;
+addThis();
+
+
+function f5()
+{
+ if (cnRecurse)
+ {
+ cnRecurse = false;
+ f5();
+ }
+ return f5.arguments;
+}
+status = 'Section G of test';
+actual = (f5() == null);
+expect = false;
+addThis();
+
+status = 'Section H of test';
+actual = (f5(0) == null);
+expect = false;
+addThis();
+
+
+
+//-------------------------------------------------------------------------------------------------
+test();
+//-------------------------------------------------------------------------------------------------
+
+
+function addThis()
+{
+ statusitems[UBound] = status;
+ actualvalues[UBound] = isThisNull(actual);
+ expectedvalues[UBound] = isThisNull(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');
+}
+
+
+function isThisNull(bool)
+{
+ return bool? cnNull : cnNonNull
+ }
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Function/regress-94506.js b/tests/auto/qml/parserstress/tests/ecma_3/Function/regress-94506.js
new file mode 100644
index 0000000000..b6ab5cc24c
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Function/regress-94506.js
@@ -0,0 +1,163 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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):
+ * deneen@alum.bucknell.edu, shaver@mozilla.org
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient 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: 08 August 2001
+ *
+ * SUMMARY: When we invoke a function, the arguments object should take
+ * a back seat to any local identifier named "arguments".
+ *
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=94506
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-94506.js';
+var UBound = 0;
+var BUGNUMBER = 94506;
+var summary = 'Testing functions employing identifiers named "arguments"';
+var status = '';
+var statusitems = [];
+var actual = '';
+var actualvalues = [];
+var expect= '';
+var expectedvalues = [];
+var TYPE_OBJECT = typeof new Object();
+var arguments = 5555;
+
+
+// use a parameter named "arguments"
+function F1(arguments)
+{
+ return arguments;
+}
+
+
+// use a local variable named "arguments"
+function F2()
+{
+ var arguments = 55;
+ return arguments;
+}
+
+
+// same thing in a different order. CHANGES THE RESULT!
+function F3()
+{
+ return arguments;
+ var arguments = 555;
+}
+
+
+// use the global variable above named "arguments"
+function F4()
+{
+ return arguments;
+}
+
+
+
+/*
+ * In Sections 1 and 2, expect the local identifier, not the arguments object.
+ * In Sections 3 and 4, expect the arguments object, not the the identifier.
+ */
+
+status = 'Section 1 of test';
+actual = F1(5);
+expect = 5;
+addThis();
+
+
+status = 'Section 2 of test';
+actual = F2();
+expect = 55;
+addThis();
+
+
+status = 'Section 3 of test';
+actual = typeof F3();
+expect = TYPE_OBJECT;
+addThis();
+
+
+status = 'Section 4 of test';
+actual = typeof F4();
+expect = TYPE_OBJECT;
+addThis();
+
+
+// Let's try calling F1 without providing a parameter -
+status = 'Section 5 of test';
+actual = F1();
+expect = undefined;
+addThis();
+
+
+// Let's try calling F1 with too many parameters -
+status = 'Section 6 of test';
+actual = F1(3,33,333);
+expect = 3;
+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 < UBound; i++)
+ {
+ reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
+ }
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Function/regress-97921.js b/tests/auto/qml/parserstress/tests/ecma_3/Function/regress-97921.js
new file mode 100644
index 0000000000..855f966dc4
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Function/regress-97921.js
@@ -0,0 +1,152 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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):
+ * georg@bioshop.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: 10 September 2001
+ *
+ * SUMMARY: Testing with() statement with nested functions
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=97921
+ *
+ * Brendan: "The bug is peculiar to functions that have formal parameters,
+ * but that are called with fewer actual arguments than the declared number
+ * of formal parameters."
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-97921.js';
+var UBound = 0;
+var BUGNUMBER = 97921;
+var summary = 'Testing with() statement with nested functions';
+var cnYES = 'Inner value === outer value';
+var cnNO = "Inner value !== outer value!";
+var status = '';
+var statusitems = [];
+var actual = '';
+var actualvalues = [];
+var expect= '';
+var expectedvalues = [];
+var outerValue = '';
+var innerValue = '';
+var useWith = '';
+
+
+function F(i)
+{
+ i = 0;
+ if(useWith) with(1){i;}
+ i++;
+
+ outerValue = i; // capture value of i in outer function
+ F1 = function() {innerValue = i;}; // capture value of i in inner function
+ F1();
+}
+
+
+status = inSection(1);
+useWith=false;
+F(); // call F without supplying the argument
+actual = innerValue === outerValue;
+expect = true;
+addThis();
+
+status = inSection(2);
+useWith=true;
+F(); // call F without supplying the argument
+actual = innerValue === outerValue;
+expect = true;
+addThis();
+
+
+function G(i)
+{
+ i = 0;
+ with (new Object()) {i=100};
+ i++;
+
+ outerValue = i; // capture value of i in outer function
+ G1 = function() {innerValue = i;}; // capture value of i in inner function
+ G1();
+}
+
+
+status = inSection(3);
+G(); // call G without supplying the argument
+actual = innerValue === 101;
+expect = true;
+addThis();
+
+status = inSection(4);
+G(); // call G without supplying the argument
+actual = innerValue === outerValue;
+expect = true;
+addThis();
+
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+
+function addThis()
+{
+ statusitems[UBound] = status;
+ actualvalues[UBound] = areTheseEqual(actual);
+ expectedvalues[UBound] = areTheseEqual(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');
+}
+
+
+function areTheseEqual(yes)
+{
+ return yes? cnYES : cnNO
+ }
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Function/scope-001.js b/tests/auto/qml/parserstress/tests/ecma_3/Function/scope-001.js
new file mode 100644
index 0000000000..3aa1d3bc03
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Function/scope-001.js
@@ -0,0 +1,265 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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, 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: 28 May 2001
+ *
+ * SUMMARY: Functions are scoped statically, not dynamically
+ *
+ * See ECMA Section 10.1.4 Scope Chain and Identifier Resolution
+ * (This section defines the scope chain of an execution context)
+ *
+ * See ECMA Section 12.10 The with Statement
+ *
+ * See ECMA Section 13 Function Definition
+ * (This section defines the scope chain of a function object as that
+ * of the running execution context when the function was declared)
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'scope-001.js';
+var UBound = 0;
+var BUGNUMBER = '(none)';
+var summary = 'Testing that functions are scoped statically, not dynamically';
+var self = this; // capture a reference to the global object
+var status = '';
+var statusitems = [ ];
+var actual = '';
+var actualvalues = [ ];
+var expect= '';
+var expectedvalues = [ ];
+
+/*
+ * In this section the expected value is 1, not 2.
+ *
+ * Why? f captures its scope chain from when it's declared, and imposes that chain
+ * when it's executed. In other words, f's scope chain is from when it was compiled.
+ * Since f is a top-level function, this is the global object only. Hence 'a' resolves to 1.
+ */
+status = 'Section A of test';
+var a = 1;
+function f()
+{
+ return a;
+}
+var obj = {a:2};
+with (obj)
+{
+ actual = f();
+}
+expect = 1;
+addThis();
+
+
+/*
+ * In this section the expected value is 2, not 1. That is because here
+ * f's associated scope chain now includes 'obj' before the global object.
+ */
+status = 'Section B of test';
+var a = 1;
+var obj = {a:2};
+with (obj)
+{
+ function f()
+ {
+ return a;
+ }
+ actual = f();
+}
+expect = 2;
+addThis();
+
+
+/*
+ * Like Section B , except that we call f outside the with block.
+ * By the principles explained above, we still expect 2 -
+ */
+status = 'Section C of test';
+var a = 1;
+var obj = {a:2};
+with (obj)
+{
+ function f()
+ {
+ return a;
+ }
+}
+actual = f();
+expect = 2;
+addThis();
+
+
+/*
+ * Like Section C, but with one more level of indirection -
+ */
+status = 'Section D of test';
+var a = 1;
+var obj = {a:2, obj:{a:3}};
+with (obj)
+{
+ with (obj)
+ {
+ function f()
+ {
+ return a;
+ }
+ }
+}
+actual = f();
+expect = 3;
+addThis();
+
+
+/*
+ * Like Section C, but here we actually delete obj before calling f.
+ * We still expect 2 -
+ */
+status = 'Section E of test';
+var a = 1;
+var obj = {a:2};
+with (obj)
+{
+ function f()
+ {
+ return a;
+ }
+}
+delete obj;
+actual = f();
+expect = 2;
+addThis();
+
+
+/*
+ * Like Section E. Here we redefine obj and call f under with (obj) -
+ * We still expect 2 -
+ */
+status = 'Section F of test';
+var a = 1;
+var obj = {a:2};
+with (obj)
+{
+ function f()
+ {
+ return a;
+ }
+}
+delete obj;
+var obj = {a:3};
+with (obj)
+{
+ actual = f();
+}
+expect = 2; // NOT 3 !!!
+addThis();
+
+
+/*
+ * Explicitly verify that f exists at global level, even though
+ * it was defined under the with(obj) block -
+ */
+status = 'Section G of test';
+var a = 1;
+var obj = {a:2};
+with (obj)
+{
+ function f()
+ {
+ return a;
+ }
+}
+actual = String([obj.hasOwnProperty('f'), self.hasOwnProperty('f')]);
+expect = String([false, true]);
+addThis();
+
+
+/*
+ * Explicitly verify that f exists at global level, even though
+ * it was defined under the with(obj) block -
+ */
+status = 'Section H of test';
+var a = 1;
+var obj = {a:2};
+with (obj)
+{
+ function f()
+ {
+ return a;
+ }
+}
+actual = String(['f' in obj, 'f' in self]);
+expect = String([false, true]);
+addThis();
+
+
+
+//-------------------------------------------------------------------------------------------------
+test();
+//-------------------------------------------------------------------------------------------------
+
+
+function addThis()
+{
+ statusitems[UBound] = status;
+ actualvalues[UBound] = actual;
+ expectedvalues[UBound] = expect;
+ UBound++;
+ resetTestVars();
+}
+
+
+function resetTestVars()
+{
+ delete a;
+ delete obj;
+ delete f;
+}
+
+
+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/qml/parserstress/tests/ecma_3/Function/scope-002.js b/tests/auto/qml/parserstress/tests/ecma_3/Function/scope-002.js
new file mode 100644
index 0000000000..7a9b6f204b
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Function/scope-002.js
@@ -0,0 +1,245 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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, 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: 28 May 2001
+ *
+ * SUMMARY: Functions are scoped statically, not dynamically
+ *
+ * See ECMA Section 10.1.4 Scope Chain and Identifier Resolution
+ * (This section defines the scope chain of an execution context)
+ *
+ * See ECMA Section 12.10 The with Statement
+ *
+ * See ECMA Section 13 Function Definition
+ * (This section defines the scope chain of a function object as that
+ * of the running execution context when the function was declared)
+ *
+ * Like scope-001.js, but using assignment var f = function expression
+ * instead of a function declaration: function f() {} etc.
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'scope-002.js';
+var UBound = 0;
+var BUGNUMBER = '(none)';
+var summary = 'Testing that functions are scoped statically, not dynamically';
+var self = this; // capture a reference to the global object
+var status = '';
+var statusitems = [ ];
+var actual = '';
+var actualvalues = [ ];
+var expect= '';
+var expectedvalues = [ ];
+
+
+/*
+ * In this section the expected value is 1, not 2.
+ *
+ * Why? f captures its scope chain from when it's declared, and imposes that chain
+ * when it's executed. In other words, f's scope chain is from when it was compiled.
+ * Since f is a top-level function, this is the global object only. Hence 'a' resolves to 1.
+ */
+status = 'Section A of test';
+var a = 1;
+var f = function () {return a;};
+var obj = {a:2};
+with (obj)
+{
+ actual = f();
+}
+expect = 1;
+addThis();
+
+
+/*
+ * In this section the expected value is 2, not 1. That is because here
+ * f's associated scope chain now includes 'obj' before the global object.
+ */
+status = 'Section B of test';
+var a = 1;
+var obj = {a:2};
+with (obj)
+{
+ var f = function () {return a;};
+ actual = f();
+}
+expect = 2;
+addThis();
+
+
+/*
+ * Like Section B , except that we call f outside the with block.
+ * By the principles explained above, we still expect 2 -
+ */
+status = 'Section C of test';
+var a = 1;
+var obj = {a:2};
+with (obj)
+{
+ var f = function () {return a;};
+}
+actual = f();
+expect = 2;
+addThis();
+
+
+/*
+ * Like Section C, but with one more level of indirection -
+ */
+status = 'Section D of test';
+var a = 1;
+var obj = {a:2, obj:{a:3}};
+with (obj)
+{
+ with (obj)
+ {
+ var f = function () {return a;};
+ }
+}
+actual = f();
+expect = 3;
+addThis();
+
+
+/*
+ * Like Section C, but here we actually delete obj before calling f.
+ * We still expect 2 -
+ */
+status = 'Section E of test';
+var a = 1;
+var obj = {a:2};
+with (obj)
+{
+ var f = function () {return a;};
+}
+delete obj;
+actual = f();
+expect = 2;
+addThis();
+
+
+/*
+ * Like Section E. Here we redefine obj and call f under with (obj) -
+ * We still expect 2 -
+ */
+status = 'Section F of test';
+var a = 1;
+var obj = {a:2};
+with (obj)
+{
+ var f = function () {return a;};
+}
+delete obj;
+var obj = {a:3};
+with (obj)
+{
+ actual = f();
+}
+expect = 2; // NOT 3 !!!
+addThis();
+
+
+/*
+ * Explicitly verify that f exists at global level, even though
+ * it was defined under the with(obj) block -
+ */
+status = 'Section G of test';
+var a = 1;
+var obj = {a:2};
+with (obj)
+{
+ var f = function () {return a;};
+}
+actual = String([obj.hasOwnProperty('f'), self.hasOwnProperty('f')]);
+expect = String([false, true]);
+addThis();
+
+
+/*
+ * Explicitly verify that f exists at global level, even though
+ * it was defined under the with(obj) block -
+ */
+status = 'Section H of test';
+var a = 1;
+var obj = {a:2};
+with (obj)
+{
+ var f = function () {return a;};
+}
+actual = String(['f' in obj, 'f' in self]);
+expect = String([false, true]);
+addThis();
+
+
+
+//-------------------------------------------------------------------------------------------------
+test();
+//-------------------------------------------------------------------------------------------------
+
+
+function addThis()
+{
+ statusitems[UBound] = status;
+ actualvalues[UBound] = actual;
+ expectedvalues[UBound] = expect;
+ UBound++;
+ resetTestVars();
+}
+
+
+function resetTestVars()
+{
+ delete a;
+ delete obj;
+ delete f;
+}
+
+
+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/qml/parserstress/tests/ecma_3/Function/shell.js b/tests/auto/qml/parserstress/tests/ecma_3/Function/shell.js
new file mode 100644
index 0000000000..eebf3d51f8
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Function/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'Function';
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/LexicalConventions/7.9.1.js b/tests/auto/qml/parserstress/tests/ecma_3/LexicalConventions/7.9.1.js
new file mode 100755
index 0000000000..10ee26f929
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/LexicalConventions/7.9.1.js
@@ -0,0 +1,157 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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 ***** */
+
+var gTestfile = '7.9.1.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 402386;
+var summary = 'Automatic Semicolon insertion in postfix expressions';
+var actual = '';
+var expect = '';
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ var expr;
+ var code;
+
+ // LeftHandSideExpression [no LineTerminator here] ++
+
+ code = 'expr ++';
+ expr = 0;
+ expect = 1;
+
+ try
+ {
+ eval(code);
+ actual = expr;
+ }
+ catch(ex)
+ {
+ actual = ex + '';
+ }
+ reportCompare(expect, actual, summary + ': ' + code);
+
+ code = 'expr\n++';
+ expr = 0;
+ expect = 'SyntaxError: syntax error';
+
+ try
+ {
+ eval(code);
+ actual = expr;
+ }
+ catch(ex)
+ {
+ actual = ex + '';
+ }
+ reportCompare(expect, actual, summary + ': ' + code);
+
+ // LeftHandSideExpression [no LineTerminator here] --
+
+ code = 'expr --';
+ expr = 0;
+ expect = -1;
+
+ try
+ {
+ eval(code);
+ actual = expr;
+ }
+ catch(ex)
+ {
+ actual = ex + '';
+ }
+ reportCompare(expect, actual, summary + ': ' + code);
+
+ code = 'expr\n--';
+ expr = 0;
+ expect = 'SyntaxError: syntax error';
+
+ try
+ {
+ eval(code);
+ actual = expr;
+ }
+ catch(ex)
+ {
+ actual = ex + '';
+ }
+ reportCompare(expect, actual, summary + ': ' + code);
+
+ //
+
+ var x = 1;
+ var y = 1;
+ code = '(x\n)-- y';
+ expect = 'SyntaxError: missing ; before statement';
+
+ try
+ {
+ eval(code);
+ actual = expr;
+ }
+ catch(ex)
+ {
+ actual = ex + '';
+ }
+ reportCompare(expect, actual, summary + ': ' + code);
+
+ code = '(x)-- y';
+ expect = 'SyntaxError: missing ; before statement';
+
+ try
+ {
+ eval(code);
+ actual = expr;
+ }
+ catch(ex)
+ {
+ actual = ex + '';
+ }
+ reportCompare(expect, actual, summary + ': ' + code);
+
+ exitFunc ('test');
+}
+
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/LexicalConventions/browser.js b/tests/auto/qml/parserstress/tests/ecma_3/LexicalConventions/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/LexicalConventions/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/LexicalConventions/shell.js b/tests/auto/qml/parserstress/tests/ecma_3/LexicalConventions/shell.js
new file mode 100644
index 0000000000..4e1d61d68a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/LexicalConventions/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'LexicalConventions';
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Number/15.7.4.2-01.js b/tests/auto/qml/parserstress/tests/ecma_3/Number/15.7.4.2-01.js
new file mode 100644
index 0000000000..36d63ed7e4
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Number/15.7.4.2-01.js
@@ -0,0 +1,77 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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
+ * Jeff Walden.
+ * 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 ***** */
+
+var gTestfile = '15.7.4.2-01.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = "411889";
+var summary = "num.toString(), num.toString(10), and num.toString(undefined)" +
+ " should all be equivalent";
+var actual, expect;
+
+printBugNumber(BUGNUMBER);
+printStatus(summary);
+
+/**************
+ * BEGIN TEST *
+ **************/
+
+var failed = false;
+
+try
+{
+ var noargs = 3.3.toString();
+ var tenarg = 3.3.toString(10);
+ var undefarg = 3.3.toString(undefined);
+
+ if (noargs !== tenarg)
+ throw "() !== (10): " + noargs + " !== " + tenarg;
+ if (tenarg !== undefarg)
+ throw "(10) !== (undefined): " + tenarg + " !== " + undefarg;
+}
+catch (e)
+{
+ failed = e;
+}
+
+expect = false;
+actual = failed;
+
+reportCompare(expect, actual, summary);
+
+expect = 1;
+actual = 3.3.toString.length;
+reportCompare(expect, actual, '3.3.toString.length should be 1');
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Number/15.7.4.3-01.js b/tests/auto/qml/parserstress/tests/ecma_3/Number/15.7.4.3-01.js
new file mode 100644
index 0000000000..7c4cba753d
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Number/15.7.4.3-01.js
@@ -0,0 +1,69 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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
+ * Jeff Walden.
+ * 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 ***** */
+
+var gTestfile = '15.7.4.3-01.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = "412068";
+var summary = "num.toLocaleString incorrectly accesses its first argument " +
+ "even when no first argument has been given";
+var actual, expect;
+
+printBugNumber(BUGNUMBER);
+printStatus(summary);
+
+/**************
+ * BEGIN TEST *
+ **************/
+
+var failed = false;
+
+try
+{
+ if ("3" !== 3..toLocaleString())
+ throw '"3" should equal 3..toLocaleString()';
+ if ("9" !== 9..toLocaleString(8))
+ throw 'Number.prototype.toLocaleString should ignore its first argument';
+}
+catch (e)
+{
+ failed = e;
+}
+
+expect = false;
+actual = failed;
+
+reportCompare(expect, actual, summary);
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Number/15.7.4.3-02.js b/tests/auto/qml/parserstress/tests/ecma_3/Number/15.7.4.3-02.js
new file mode 100644
index 0000000000..72e7c56141
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Number/15.7.4.3-02.js
@@ -0,0 +1,53 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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
+ * Jeff Walden.
+ * Portions created by the Initial Developer are Copyright (C) 2008
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Philip Taylor
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient 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.7.4.3-02.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = "446494";
+var summary = "num.toLocaleString should handle exponents";
+var actual, expect;
+
+printBugNumber(BUGNUMBER);
+printStatus(summary);
+
+expect = '1e-10';
+actual = 1e-10.toLocaleString();
+reportCompare(expect, actual, summary + ': ' + expect);
+
+expect = 'Infinity';
+actual = Infinity.toLocaleString();
+reportCompare(expect, actual, summary + ': ' + expect);
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Number/15.7.4.5-1.js b/tests/auto/qml/parserstress/tests/ecma_3/Number/15.7.4.5-1.js
new file mode 100644
index 0000000000..c21efa0b66
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Number/15.7.4.5-1.js
@@ -0,0 +1,145 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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-15
+ *
+ * SUMMARY: Testing Number.prototype.toFixed(fractionDigits)
+ * See EMCA 262 Edition 3 Section 15.7.4.5
+ *
+ * Also see http://bugzilla.mozilla.org/show_bug.cgi?id=90551
+ *
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = '15.7.4.5-1.js';
+var UBound = 0;
+var BUGNUMBER = '(none)';
+var summary = 'Testing Number.prototype.toFixed(fractionDigits)';
+var cnIsRangeError = 'instanceof RangeError';
+var cnNotRangeError = 'NOT instanceof RangeError';
+var cnNoErrorCaught = 'NO ERROR CAUGHT...';
+var status = '';
+var statusitems = [];
+var actual = '';
+var actualvalues = [];
+var expect= '';
+var expectedvalues = [];
+var testNum = 234.2040506;
+
+
+status = 'Section A of test: no error intended!';
+actual = testNum.toFixed(4);
+expect = '234.2041';
+captureThis();
+
+
+/////////////////////////// OOPS.... ///////////////////////////////
+/*************************************************************************
+ * 15.7.4.5 Number.prototype.toFixed(fractionDigits)
+ *
+ * An implementation is permitted to extend the behaviour of toFixed
+ * for values of fractionDigits less than 0 or greater than 20. In this
+ * case toFixed would not necessarily throw RangeError for such values.
+
+status = 'Section B of test: expect RangeError because fractionDigits < 0';
+actual = catchError('testNum.toFixed(-4)');
+expect = cnIsRangeError;
+captureThis();
+
+status = 'Section C of test: expect RangeError because fractionDigits > 20 ';
+actual = catchError('testNum.toFixed(21)');
+expect = cnIsRangeError;
+captureThis();
+*************************************************************************/
+
+
+status = 'Section D of test: no error intended!';
+actual = 0.00001.toFixed(2);
+expect = '0.00';
+captureThis();
+
+status = 'Section E of test: no error intended!';
+actual = 0.000000000000000000001.toFixed(20);
+expect = '0.00000000000000000000';
+captureThis();
+
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+
+function captureThis()
+{
+ 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');
+}
+
+
+function catchError(sEval)
+{
+ try {eval(sEval);}
+ catch(e) {return isRangeError(e);}
+ return cnNoErrorCaught;
+}
+
+
+function isRangeError(obj)
+{
+ if (obj instanceof RangeError)
+ return cnIsRangeError;
+ return cnNotRangeError;
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Number/15.7.4.6-1.js b/tests/auto/qml/parserstress/tests/ecma_3/Number/15.7.4.6-1.js
new file mode 100644
index 0000000000..dec9ed6a90
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Number/15.7.4.6-1.js
@@ -0,0 +1,134 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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-15
+ *
+ * SUMMARY: Testing Number.prototype.toExponential(fractionDigits)
+ * See EMCA 262 Edition 3 Section 15.7.4.6
+ *
+ * Also see http://bugzilla.mozilla.org/show_bug.cgi?id=90551
+ *
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = '15.7.4.6-1.js';
+var UBound = 0;
+var BUGNUMBER = '(none)';
+var summary = 'Testing Number.prototype.toExponential(fractionDigits)';
+var cnIsRangeError = 'instanceof RangeError';
+var cnNotRangeError = 'NOT instanceof RangeError';
+var cnNoErrorCaught = 'NO ERROR CAUGHT...';
+var status = '';
+var statusitems = [];
+var actual = '';
+var actualvalues = [];
+var expect= '';
+var expectedvalues = [];
+var testNum = 77.1234;
+
+
+status = 'Section A of test: no error intended!';
+actual = testNum.toExponential(4);
+expect = '7.7123e+1';
+captureThis();
+
+
+/////////////////////////// OOPS.... ///////////////////////////////
+/*************************************************************************
+ * 15.7.4.6 Number.prototype.toExponential(fractionDigits)
+ *
+ * An implementation is permitted to extend the behaviour of toExponential
+ * for values of fractionDigits less than 0 or greater than 20. In this
+ * case toExponential would not necessarily throw RangeError for such values.
+
+status = 'Section B of test: expect RangeError because fractionDigits < 0';
+actual = catchError('testNum.toExponential(-4)');
+expect = cnIsRangeError;
+captureThis();
+
+status = 'Section C of test: expect RangeError because fractionDigits > 20 ';
+actual = catchError('testNum.toExponential(21)');
+expect = cnIsRangeError;
+captureThis();
+*************************************************************************/
+
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+
+function captureThis()
+{
+ 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');
+}
+
+
+function catchError(sEval)
+{
+ try {eval(sEval);}
+ catch(e) {return isRangeError(e);}
+ return cnNoErrorCaught;
+}
+
+
+function isRangeError(obj)
+{
+ if (obj instanceof RangeError)
+ return cnIsRangeError;
+ return cnNotRangeError;
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Number/15.7.4.7-1.js b/tests/auto/qml/parserstress/tests/ecma_3/Number/15.7.4.7-1.js
new file mode 100644
index 0000000000..5aa0724a46
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Number/15.7.4.7-1.js
@@ -0,0 +1,139 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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-15
+ *
+ * SUMMARY: Testing Number.prototype.toPrecision(precision)
+ * See EMCA 262 Edition 3 Section 15.7.4.7
+ *
+ * Also see http://bugzilla.mozilla.org/show_bug.cgi?id=90551
+ *
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = '15.7.4.7-1.js';
+var UBound = 0;
+var BUGNUMBER = '(none)';
+var summary = 'Testing Number.prototype.toPrecision(precision)';
+var cnIsRangeError = 'instanceof RangeError';
+var cnNotRangeError = 'NOT instanceof RangeError';
+var cnNoErrorCaught = 'NO ERROR CAUGHT...';
+var status = '';
+var statusitems = [];
+var actual = '';
+var actualvalues = [];
+var expect= '';
+var expectedvalues = [];
+var testNum = 5.123456;
+
+
+status = 'Section A of test: no error intended!';
+actual = testNum.toPrecision(4);
+expect = '5.123';
+captureThis();
+
+
+/////////////////////////// OOPS.... ///////////////////////////////
+/*************************************************************************
+ * 15.7.4.7 Number.prototype.toPrecision(precision)
+ *
+ * An implementation is permitted to extend the behaviour of toPrecision
+ * for values of precision less than 1 or greater than 21. In this
+ * case toPrecision would not necessarily throw RangeError for such values.
+
+status = 'Section B of test: expect RangeError because precision < 1';
+actual = catchError('testNum.toPrecision(0)');
+expect = cnIsRangeError;
+captureThis();
+
+status = 'Section C of test: expect RangeError because precision < 1';
+actual = catchError('testNum.toPrecision(-4)');
+expect = cnIsRangeError;
+captureThis();
+
+status = 'Section D of test: expect RangeError because precision > 21 ';
+actual = catchError('testNum.toPrecision(22)');
+expect = cnIsRangeError;
+captureThis();
+*************************************************************************/
+
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+
+function captureThis()
+{
+ 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');
+}
+
+
+function catchError(sEval)
+{
+ try {eval(sEval);}
+ catch(e) {return isRangeError(e);}
+ return cnNoErrorCaught;
+}
+
+
+function isRangeError(obj)
+{
+ if (obj instanceof RangeError)
+ return cnIsRangeError;
+ return cnNotRangeError;
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Number/15.7.4.7-2.js b/tests/auto/qml/parserstress/tests/ecma_3/Number/15.7.4.7-2.js
new file mode 100644
index 0000000000..5c8ff396e4
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Number/15.7.4.7-2.js
@@ -0,0 +1,72 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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
+ * Jeff Walden.
+ * 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 ***** */
+
+var gTestfile = '15.7.4.7-2.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = "411893";
+var summary = "num.toPrecision(undefined) should equal num.toString()";
+var actual, expect;
+
+printBugNumber(BUGNUMBER);
+printStatus(summary);
+
+/**************
+ * BEGIN TEST *
+ **************/
+
+var failed = false;
+
+try
+{
+ var prec = 3.3.toPrecision(undefined);
+ var str = 3.3.toString();
+ if (prec !== str)
+ {
+ throw "not equal! " +
+ "3.3.toPrecision(undefined) === '" + prec + "', " +
+ "3.3.toString() === '" + str + "'";
+ }
+}
+catch (e)
+{
+ failed = e;
+}
+
+expect = false;
+actual = failed;
+
+reportCompare(expect, actual, summary);
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Number/browser.js b/tests/auto/qml/parserstress/tests/ecma_3/Number/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Number/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Number/regress-442242-01.js b/tests/auto/qml/parserstress/tests/ecma_3/Number/regress-442242-01.js
new file mode 100755
index 0000000000..e3fa070e5a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Number/regress-442242-01.js
@@ -0,0 +1,62 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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): 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 = 'regress-442242-01.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 442242;
+var summary = 'Do not assert: INT_FITS_IN_JSVAL(i)';
+var actual = 'No Crash';
+var expect = 'No Crash';
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ var i = 28800000;
+ -i;
+
+ reportCompare(expect, actual, summary);
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Number/shell.js b/tests/auto/qml/parserstress/tests/ecma_3/Number/shell.js
new file mode 100644
index 0000000000..03cca1d551
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Number/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'Number';
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/NumberFormatting/browser.js b/tests/auto/qml/parserstress/tests/ecma_3/NumberFormatting/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/NumberFormatting/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/NumberFormatting/shell.js b/tests/auto/qml/parserstress/tests/ecma_3/NumberFormatting/shell.js
new file mode 100644
index 0000000000..1847703bf3
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/NumberFormatting/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'NumberFormatting';
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/NumberFormatting/tostring-001.js b/tests/auto/qml/parserstress/tests/ecma_3/NumberFormatting/tostring-001.js
new file mode 100644
index 0000000000..34152aa5c0
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/NumberFormatting/tostring-001.js
@@ -0,0 +1,60 @@
+/* -*- 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 = 'tostring-001.js';
+
+test();
+
+function test()
+{
+ var n0 = 1e23;
+ var n1 = 5e22;
+ var n2 = 1.6e24;
+
+ printStatus ("Number formatting test.");
+ printBugNumber ("11178");
+
+ reportCompare ("1e+23", n0.toString(), "1e23 toString()");
+ reportCompare ("5e+22", n1.toString(), "5e22 toString()");
+ reportCompare ("1.6e+24", n2.toString(), "1.6e24 toString()");
+
+}
+
+
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Object/8.6.1-01.js b/tests/auto/qml/parserstress/tests/ecma_3/Object/8.6.1-01.js
new file mode 100755
index 0000000000..2897ece555
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Object/8.6.1-01.js
@@ -0,0 +1,113 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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): Michael Daumling <daumling@adobe.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 = '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/qml/parserstress/tests/ecma_3/Object/8.6.2.6-001.js b/tests/auto/qml/parserstress/tests/ecma_3/Object/8.6.2.6-001.js
new file mode 100644
index 0000000000..8fe2b23f4a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Object/8.6.2.6-001.js
@@ -0,0 +1,113 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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<UBound; i++)
+ {
+ reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
+ }
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Object/browser.js b/tests/auto/qml/parserstress/tests/ecma_3/Object/browser.js
new file mode 100644
index 0000000000..0e57d1fcd0
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Object/browser.js
@@ -0,0 +1,7 @@
+var GLOBAL = 'Window';
+
+function isObject(obj)
+{
+ return obj instanceof Object || obj == window;
+}
+
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Object/class-001.js b/tests/auto/qml/parserstress/tests/ecma_3/Object/class-001.js
new file mode 100644
index 0000000000..faa2f4fceb
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Object/class-001.js
@@ -0,0 +1,156 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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: 14 Mar 2001
+ *
+ * SUMMARY: Testing the internal [[Class]] property of objects
+ * See ECMA-262 Edition 3 13-Oct-1999, Section 8.6.2
+ *
+ * The getJSClass() function we use is in a utility file, e.g. "shell.js".
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'class-001.js';
+var i = 0;
+var UBound = 0;
+var BUGNUMBER = '(none)';
+var summary = 'Testing the internal [[Class]] property of objects';
+var statprefix = 'Current object is: ';
+var status = ''; var statusList = [ ];
+var actual = ''; var actualvalue = [ ];
+var expect= ''; var expectedvalue = [ ];
+
+
+status = 'the global object';
+actual = getJSClass(this);
+expect = GLOBAL;
+if (expect == 'Window' && actual == 'XPCCrossOriginWrapper')
+{
+ print('Skipping global object due to XPCCrossOriginWrapper. See bug 390946');
+}
+else
+{
+ addThis();
+}
+
+status = 'new Object()';
+actual = getJSClass(new Object());
+expect = 'Object';
+addThis();
+
+status = 'new Function()';
+actual = getJSClass(new Function());
+expect = 'Function';
+addThis();
+
+status = 'new Array()';
+actual = getJSClass(new Array());
+expect = 'Array';
+addThis();
+
+status = 'new String()';
+actual = getJSClass(new String());
+expect = 'String';
+addThis();
+
+status = 'new Boolean()';
+actual = getJSClass(new Boolean());
+expect = 'Boolean';
+addThis();
+
+status = 'new Number()';
+actual = getJSClass(new Number());
+expect = 'Number';
+addThis();
+
+status = 'Math';
+actual = getJSClass(Math); // can't use 'new' with the Math object (EMCA3, 15.8)
+expect = 'Math';
+addThis();
+
+status = 'new Date()';
+actual = getJSClass(new Date());
+expect = 'Date';
+addThis();
+
+status = 'new RegExp()';
+actual = getJSClass(new RegExp());
+expect = 'RegExp';
+addThis();
+
+status = 'new Error()';
+actual = getJSClass(new Error());
+expect = 'Error';
+addThis();
+
+
+
+//---------------------------------------------------------------------------------
+test();
+//---------------------------------------------------------------------------------
+
+
+
+function addThis()
+{
+ statusList[UBound] = status;
+ actualvalue[UBound] = actual;
+ expectedvalue[UBound] = expect;
+ UBound++;
+}
+
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ for (i = 0; i < UBound; i++)
+ {
+ reportCompare(expectedvalue[i], actualvalue[i], getStatus(i));
+ }
+
+ exitFunc ('test');
+}
+
+
+function getStatus(i)
+{
+ return statprefix + statusList[i];
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Object/class-002.js b/tests/auto/qml/parserstress/tests/ecma_3/Object/class-002.js
new file mode 100644
index 0000000000..0b49ffd9db
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Object/class-002.js
@@ -0,0 +1,146 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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: 14 Mar 2001
+ *
+ * SUMMARY: Testing the [[Class]] property of native constructors.
+ * See ECMA-262 Edition 3 13-Oct-1999, Section 8.6.2 re [[Class]] property.
+ *
+ * Same as class-001.js - but testing the constructors here, not
+ * object instances. Therefore we expect the [[Class]] property to
+ * equal 'Function' in each case.
+ *
+ * The getJSClass() function we use is in a utility file, e.g. "shell.js"
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'class-002.js';
+var i = 0;
+var UBound = 0;
+var BUGNUMBER = '(none)';
+var summary = 'Testing the internal [[Class]] property of native constructors';
+var statprefix = 'Current constructor is: ';
+var status = ''; var statusList = [ ];
+var actual = ''; var actualvalue = [ ];
+var expect= ''; var expectedvalue = [ ];
+
+/*
+ * We set the expect variable each time only for readability.
+ * We expect 'Function' every time; see discussion above -
+ */
+status = 'Object';
+actual = getJSClass(Object);
+expect = 'Function';
+addThis();
+
+status = 'Function';
+actual = getJSClass(Function);
+expect = 'Function';
+addThis();
+
+status = 'Array';
+actual = getJSClass(Array);
+expect = 'Function';
+addThis();
+
+status = 'String';
+actual = getJSClass(String);
+expect = 'Function';
+addThis();
+
+status = 'Boolean';
+actual = getJSClass(Boolean);
+expect = 'Function';
+addThis();
+
+status = 'Number';
+actual = getJSClass(Number);
+expect = 'Function';
+addThis();
+
+status = 'Date';
+actual = getJSClass(Date);
+expect = 'Function';
+addThis();
+
+status = 'RegExp';
+actual = getJSClass(RegExp);
+expect = 'Function';
+addThis();
+
+status = 'Error';
+actual = getJSClass(Error);
+expect = 'Function';
+addThis();
+
+
+
+//---------------------------------------------------------------------------------
+test();
+//---------------------------------------------------------------------------------
+
+
+
+function addThis()
+{
+ statusList[UBound] = status;
+ actualvalue[UBound] = actual;
+ expectedvalue[UBound] = expect;
+ UBound++;
+}
+
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ for (i = 0; i < UBound; i++)
+ {
+ reportCompare(expectedvalue[i], actualvalue[i], getStatus(i));
+ }
+
+ exitFunc ('test');
+}
+
+
+function getStatus(i)
+{
+ return statprefix + statusList[i];
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Object/class-003.js b/tests/auto/qml/parserstress/tests/ecma_3/Object/class-003.js
new file mode 100644
index 0000000000..7afedb2985
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Object/class-003.js
@@ -0,0 +1,139 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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: 14 Mar 2001
+ *
+ * SUMMARY: Testing the [[Class]] property of native error types.
+ * See ECMA-262 Edition 3, Section 8.6.2 for the [[Class]] property.
+ *
+ * Same as class-001.js - but testing only the native error types here.
+ * See ECMA-262 Edition 3, Section 15.11.6 for a list of these types.
+ *
+ * ECMA expects the [[Class]] property to equal 'Error' in each case.
+ * See ECMA-262 Edition 3, Sections 15.11.1.1 and 15.11.7.2 for this.
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=56868
+ *
+ * The getJSClass() function we use is in a utility file, e.g. "shell.js"
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'class-003.js';
+var i = 0;
+var UBound = 0;
+var BUGNUMBER = 56868;
+var summary = 'Testing the internal [[Class]] property of native error types';
+var statprefix = 'Current object is: ';
+var status = ''; var statusList = [ ];
+var actual = ''; var actualvalue = [ ];
+var expect= ''; var expectedvalue = [ ];
+
+/*
+ * We set the expect variable each time only for readability.
+ * We expect 'Error' every time; see discussion above -
+ */
+status = 'new Error()';
+actual = getJSClass(new Error());
+expect = 'Error';
+addThis();
+
+status = 'new EvalError()';
+actual = getJSClass(new EvalError());
+expect = 'Error';
+addThis();
+
+status = 'new RangeError()';
+actual = getJSClass(new RangeError());
+expect = 'Error';
+addThis();
+
+status = 'new ReferenceError()';
+actual = getJSClass(new ReferenceError());
+expect = 'Error';
+addThis();
+
+status = 'new SyntaxError()';
+actual = getJSClass(new SyntaxError());
+expect = 'Error';
+addThis();
+
+status = 'new TypeError()';
+actual = getJSClass(new TypeError());
+expect = 'Error';
+addThis();
+
+status = 'new URIError()';
+actual = getJSClass(new URIError());
+expect = 'Error';
+addThis();
+
+
+
+//---------------------------------------------------------------------------------
+test();
+//---------------------------------------------------------------------------------
+
+
+
+function addThis()
+{
+ statusList[UBound] = status;
+ actualvalue[UBound] = actual;
+ expectedvalue[UBound] = expect;
+ UBound++;
+}
+
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ for (i = 0; i < UBound; i++)
+ {
+ reportCompare(expectedvalue[i], actualvalue[i], getStatus(i));
+ }
+
+ exitFunc ('test');
+}
+
+
+function getStatus(i)
+{
+ return statprefix + statusList[i];
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Object/class-004.js b/tests/auto/qml/parserstress/tests/ecma_3/Object/class-004.js
new file mode 100644
index 0000000000..729b041086
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Object/class-004.js
@@ -0,0 +1,139 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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: 14 Mar 2001
+ *
+ * SUMMARY: Testing [[Class]] property of native error constructors.
+ * See ECMA-262 Edition 3, Section 8.6.2 for the [[Class]] property.
+ *
+ * See ECMA-262 Edition 3, Section 15.11.6 for the native error types.
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=56868
+ *
+ * Same as class-003.js - but testing the constructors here, not
+ * object instances. Therefore we expect the [[Class]] property to
+ * equal 'Function' in each case.
+ *
+ * The getJSClass() function we use is in a utility file, e.g. "shell.js"
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'class-004.js';
+var i = 0;
+var UBound = 0;
+var BUGNUMBER = 56868;
+var summary = 'Testing the internal [[Class]] property of native error constructors';
+var statprefix = 'Current constructor is: ';
+var status = ''; var statusList = [ ];
+var actual = ''; var actualvalue = [ ];
+var expect= ''; var expectedvalue = [ ];
+
+/*
+ * We set the expect variable each time only for readability.
+ * We expect 'Function' every time; see discussion above -
+ */
+status = 'Error';
+actual = getJSClass(Error);
+expect = 'Function';
+addThis();
+
+status = 'EvalError';
+actual = getJSClass(EvalError);
+expect = 'Function';
+addThis();
+
+status = 'RangeError';
+actual = getJSClass(RangeError);
+expect = 'Function';
+addThis();
+
+status = 'ReferenceError';
+actual = getJSClass(ReferenceError);
+expect = 'Function';
+addThis();
+
+status = 'SyntaxError';
+actual = getJSClass(SyntaxError);
+expect = 'Function';
+addThis();
+
+status = 'TypeError';
+actual = getJSClass(TypeError);
+expect = 'Function';
+addThis();
+
+status = 'URIError';
+actual = getJSClass(URIError);
+expect = 'Function';
+addThis();
+
+
+
+//---------------------------------------------------------------------------------
+test();
+//---------------------------------------------------------------------------------
+
+
+
+function addThis()
+{
+ statusList[UBound] = status;
+ actualvalue[UBound] = actual;
+ expectedvalue[UBound] = expect;
+ UBound++;
+}
+
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ for (i = 0; i < UBound; i++)
+ {
+ reportCompare(expectedvalue[i], actualvalue[i], getStatus(i));
+ }
+
+ exitFunc ('test');
+}
+
+
+function getStatus(i)
+{
+ return statprefix + statusList[i];
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Object/class-005.js b/tests/auto/qml/parserstress/tests/ecma_3/Object/class-005.js
new file mode 100644
index 0000000000..f57d0681cf
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Object/class-005.js
@@ -0,0 +1,124 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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: 14 Mar 2001
+ *
+ * SUMMARY: Testing the internal [[Class]] property of user-defined types.
+ * See ECMA-262 Edition 3 13-Oct-1999, Section 8.6.2 re [[Class]] property.
+ *
+ * Same as class-001.js - but testing user-defined types here, not
+ * native types. Therefore we expect the [[Class]] property to equal
+ * 'Object' in each case -
+ *
+ * The getJSClass() function we use is in a utility file, e.g. "shell.js"
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'class-005.js';
+var i = 0;
+var UBound = 0;
+var BUGNUMBER = '(none)';
+var summary = 'Testing the internal [[Class]] property of user-defined types';
+var statprefix = 'Current user-defined type is: ';
+var status = ''; var statusList = [ ];
+var actual = ''; var actualvalue = [ ];
+var expect= ''; var expectedvalue = [ ];
+
+
+Calf.prototype= new Cow();
+
+/*
+ * We set the expect variable each time only for readability.
+ * We expect 'Object' every time; see discussion above -
+ */
+status = 'new Cow()';
+actual = getJSClass(new Cow());
+expect = 'Object';
+addThis();
+
+status = 'new Calf()';
+actual = getJSClass(new Calf());
+expect = 'Object';
+addThis();
+
+
+//---------------------------------------------------------------------------------
+test();
+//---------------------------------------------------------------------------------
+
+
+function addThis()
+{
+ statusList[UBound] = status;
+ actualvalue[UBound] = actual;
+ expectedvalue[UBound] = expect;
+ UBound++;
+}
+
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ for (i = 0; i < UBound; i++)
+ {
+ reportCompare(expectedvalue[i], actualvalue[i], getStatus(i));
+ }
+
+ exitFunc ('test');
+}
+
+
+function getStatus(i)
+{
+ return statprefix + statusList[i];
+}
+
+
+function Cow(name)
+{
+ this.name=name;
+}
+
+
+function Calf(name)
+{
+ this.name=name;
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Object/regress-361274.js b/tests/auto/qml/parserstress/tests/ecma_3/Object/regress-361274.js
new file mode 100755
index 0000000000..d3962004e3
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Object/regress-361274.js
@@ -0,0 +1,66 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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): Jason Sachs
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient 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-361274.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 361274;
+var summary = 'Embedded nulls in property names';
+var actual = '';
+var expect = '';
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ var x='123'+'\0'+'456';
+ var y='123'+'\0'+'789';
+ var a={};
+ a[x]=1;
+ a[y]=2;
+
+ reportCompare(1, a[x], summary + ': 123\\0456');
+ reportCompare(2, a[y], summary + ': 123\\0789');
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Object/regress-385393-07.js b/tests/auto/qml/parserstress/tests/ecma_3/Object/regress-385393-07.js
new file mode 100755
index 0000000000..0473fe4956
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Object/regress-385393-07.js
@@ -0,0 +1,67 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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-385393-07.js';
+
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 385393;
+var summary = 'Regression test for bug 385393';
+var actual = 'No Crash';
+var expect = 'No Crash';
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ try
+ {
+ (2).eval();
+ }
+ catch(ex)
+ {
+ }
+
+ reportCompare(expect, actual, summary);
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Object/regress-72773.js b/tests/auto/qml/parserstress/tests/ecma_3/Object/regress-72773.js
new file mode 100644
index 0000000000..5b0dee62bf
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Object/regress-72773.js
@@ -0,0 +1,97 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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: 09 May 2001
+ *
+ * SUMMARY: Regression test: we shouldn't crash on this code
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=72773
+ *
+ * See ECMA-262 Edition 3 13-Oct-1999, Section 8.6.2 re [[Class]] property.
+ *
+ * Same as class-001.js - but testing user-defined types here, not
+ * native types. Therefore we expect the [[Class]] property to equal
+ * 'Object' in each case -
+ *
+ * The getJSClass() function we use is in a utility file, e.g. "shell.js"
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-72773.js';
+var BUGNUMBER = 72773;
+var summary = "Regression test: we shouldn't crash on this code";
+var status = '';
+var actual = '';
+var expect = '';
+var sToEval = '';
+
+/*
+ * This code should produce an error, but not a crash.
+ * 'TypeError: Function.prototype.toString called on incompatible object'
+ */
+sToEval += 'function Cow(name){this.name = name;}'
+sToEval += 'function Calf(str){this.name = str;}'
+sToEval += 'Calf.prototype = Cow;'
+sToEval += 'new Calf().toString();'
+
+status = 'Trying to catch an expected error';
+try
+{
+ eval(sToEval);
+}
+catch(e)
+{
+ actual = getJSClass(e);
+ expect = 'Error';
+}
+
+
+//----------------------------------------------------------------------------------------------
+test();
+//----------------------------------------------------------------------------------------------
+
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ reportCompare(expect, actual, status);
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Object/regress-79129-001.js b/tests/auto/qml/parserstress/tests/ecma_3/Object/regress-79129-001.js
new file mode 100644
index 0000000000..efafed8047
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Object/regress-79129-001.js
@@ -0,0 +1,80 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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 May 2001
+ *
+ * SUMMARY: Regression test: we shouldn't crash on this code
+ *
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=79129
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-79129-001.js';
+var BUGNUMBER = 79129;
+var summary = "Regression test: we shouldn't crash on this code";
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+ tryThis();
+ reportCompare('No Crash', 'No Crash', 'Should not crash');
+ exitFunc ('test');
+}
+
+
+function tryThis()
+{
+ obj={};
+ obj.a = obj.b = obj.c = 1;
+ delete obj.a;
+ delete obj.b;
+ delete obj.c;
+ obj.d = obj.e = 1;
+ obj.a=1;
+ obj.b=1;
+ obj.c=1;
+ obj.d=1;
+ obj.e=1;
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Object/shell.js b/tests/auto/qml/parserstress/tests/ecma_3/Object/shell.js
new file mode 100644
index 0000000000..d0ee054485
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Object/shell.js
@@ -0,0 +1,105 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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: 14 Mar 2001
+ *
+ * SUMMARY: Utility functions for testing objects -
+ *
+ * Suppose obj is an instance of a native type, e.g. Number.
+ * Then obj.toString() invokes Number.prototype.toString().
+ * We would also like to access Object.prototype.toString().
+ *
+ * The difference is this: suppose obj = new Number(7).
+ * Invoking Number.prototype.toString() on this just returns 7.
+ * Object.prototype.toString() on this returns '[object Number]'.
+ *
+ * The getJSType() function below will return '[object Number]' for us.
+ * The getJSClass() function returns 'Number', the [[Class]] property of obj.
+ * See ECMA-262 Edition 3, 13-Oct-1999, Section 8.6.2
+ */
+//-----------------------------------------------------------------------------
+
+gTestsubsuite = 'Object';
+
+var cnNoObject = 'Unexpected Error!!! Parameter to this function must be an object';
+var cnNoClass = 'Unexpected Error!!! Cannot find Class property';
+var cnObjectToString = Object.prototype.toString;
+var GLOBAL = 'global';
+
+// checks that it's safe to call findType()
+function getJSType(obj)
+{
+ if (isObject(obj))
+ return findType(obj);
+ return cnNoObject;
+}
+
+
+// checks that it's safe to call findType()
+function getJSClass(obj)
+{
+ if (isObject(obj))
+ return findClass(findType(obj));
+ return cnNoObject;
+}
+
+
+function findType(obj)
+{
+ return cnObjectToString.apply(obj);
+}
+
+
+// given '[object Number]', return 'Number'
+function findClass(sType)
+{
+ var re = /^\[.*\s+(\w+)\s*\]$/;
+ var a = sType.match(re);
+
+ if (a && a[1])
+ return a[1];
+ return cnNoClass;
+}
+
+
+function isObject(obj)
+{
+ return obj instanceof Object;
+}
+
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Operators/11.13.1-001.js b/tests/auto/qml/parserstress/tests/ecma_3/Operators/11.13.1-001.js
new file mode 100644
index 0000000000..935eed2de1
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Operators/11.13.1-001.js
@@ -0,0 +1,152 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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):
+ * brendan@mozilla.org, 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: 08 May 2003
+ * SUMMARY: JS should evaluate RHS before binding LHS implicit variable
+ *
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=204919
+ *
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = '11.13.1-001.js';
+var UBound = 0;
+var BUGNUMBER = 204919;
+var summary = 'JS should evaluate RHS before binding LHS implicit variable';
+var TEST_PASSED = 'ReferenceError';
+var TEST_FAILED = 'Generated an error, but NOT a ReferenceError!';
+var TEST_FAILED_BADLY = 'Did not generate ANY error!!!';
+var status = '';
+var statusitems = [];
+var actual = '';
+var actualvalues = [];
+var expect= '';
+var expectedvalues = [];
+
+
+/*
+ * global scope -
+ */
+status = inSection(1);
+try
+{
+ x = x;
+ actual = TEST_FAILED_BADLY;
+}
+catch(e)
+{
+ if (e instanceof ReferenceError)
+ actual = TEST_PASSED;
+ else
+ actual = TEST_FAILED;
+}
+expect = TEST_PASSED;
+addThis();
+
+
+/*
+ * function scope -
+ */
+status = inSection(2);
+try
+{
+ (function() {y = y;})();
+ actual = TEST_FAILED_BADLY;
+}
+catch(e)
+{
+ if (e instanceof ReferenceError)
+ actual = TEST_PASSED;
+ else
+ actual = TEST_FAILED;
+}
+expect = TEST_PASSED;
+addThis();
+
+
+/*
+ * eval scope -
+ */
+status = inSection(3);
+try
+{
+ eval('z = z');
+ actual = TEST_FAILED_BADLY;
+}
+catch(e)
+{
+ if (e instanceof ReferenceError)
+ actual = TEST_PASSED;
+ else
+ actual = TEST_FAILED;
+}
+expect = TEST_PASSED;
+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<UBound; i++)
+ {
+ reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
+ }
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Operators/11.13.1-002.js b/tests/auto/qml/parserstress/tests/ecma_3/Operators/11.13.1-002.js
new file mode 100755
index 0000000000..5d3307e4a7
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Operators/11.13.1-002.js
@@ -0,0 +1,57 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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): Seno.Aiko@gmail.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 = '11.13.1-002.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 312354;
+var summary = '11.13.1 Simple Assignment should return type of RHS';
+var actual = '';
+var expect = '';
+
+// XXX this test should really test each property of the native
+// objects, but I'm too lazy. Patches accepted.
+
+printBugNumber(BUGNUMBER);
+printStatus (summary);
+
+var re = /x/g;
+var y = re.lastIndex = "7";
+
+expect = "string";
+actual = typeof y;
+
+reportCompare(expect, actual, summary);
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Operators/11.4.1-001.js b/tests/auto/qml/parserstress/tests/ecma_3/Operators/11.4.1-001.js
new file mode 100644
index 0000000000..7a5ed8f915
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Operators/11.4.1-001.js
@@ -0,0 +1,120 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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: |delete x.y| should return |true| if |x| has no property |y|
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=201987
+ *
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = '11.4.1-001.js';
+var UBound = 0;
+var BUGNUMBER = 201987;
+var summary = '|delete x.y| should return |true| if |x| has no property |y|';
+var status = '';
+var statusitems = [];
+var actual = '';
+var actualvalues = [];
+var expect= '';
+var expectedvalues = [];
+
+
+status = inSection(1);
+var x = {};
+actual = delete x.y;
+expect = true;
+addThis();
+
+status = inSection(2);
+actual = delete {}.y;
+expect = true;
+addThis();
+
+status = inSection(3);
+actual = delete "".y;
+expect = true;
+addThis();
+
+status = inSection(4);
+actual = delete /abc/.y;
+expect = true;
+addThis();
+
+status = inSection(5);
+actual = delete (new Date()).y;
+expect = true;
+addThis();
+
+status = inSection(6);
+var x = 99;
+actual = delete x.y;
+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<UBound; i++)
+ {
+ reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
+ }
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Operators/11.4.1-002.js b/tests/auto/qml/parserstress/tests/ecma_3/Operators/11.4.1-002.js
new file mode 100755
index 0000000000..c48565ba5f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Operators/11.4.1-002.js
@@ -0,0 +1,72 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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): x0
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient 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.4.1-002.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 423300;
+var summary = '11.4.1 - The delete Operator - delete f()';
+var actual = '';
+var expect = '';
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+function f() {}
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ expect = true;
+
+ try
+ {
+ actual = delete f();
+ }
+ catch(ex)
+ {
+ actual = ex + '';
+ }
+
+ reportCompare(expect, actual, summary);
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Operators/browser.js b/tests/auto/qml/parserstress/tests/ecma_3/Operators/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Operators/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Operators/order-01.js b/tests/auto/qml/parserstress/tests/ecma_3/Operators/order-01.js
new file mode 100755
index 0000000000..671faceb81
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Operators/order-01.js
@@ -0,0 +1,108 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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 ***** */
+
+var gTestfile = 'order-01.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 433672;
+var summary = 'operator evaluation order';
+var actual = '';
+var expect = '';
+
+function makeObject(label)
+{
+ var o = (function (){});
+
+ o.label = label;
+ o.valueOf = (function() { actual += this.label + ' valueOf, '; return Object.prototype.valueOf.call(this); });
+ o.toString = (function() { actual += this.label + ' toString, '; return Object.prototype.toString.call(this); });
+
+ return o;
+}
+
+operators = [
+ {section: '11.5.1', operator: '*'},
+ {section: '11.5.2', operator: '/'},
+ {section: '11.5.3', operator: '%'},
+ {section: '11.6.1', operator: '+'},
+ {section: '11.6.2', operator: '-'},
+ {section: '11.7.1', operator: '<<'},
+ {section: '11.7.2', operator: '>>'},
+ {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/qml/parserstress/tests/ecma_3/Operators/shell.js b/tests/auto/qml/parserstress/tests/ecma_3/Operators/shell.js
new file mode 100644
index 0000000000..910515cfe4
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Operators/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'Operators';
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/README b/tests/auto/qml/parserstress/tests/ecma_3/README
new file mode 100755
index 0000000000..eebd421c2e
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/README
@@ -0,0 +1 @@
+ECMA 262 Edition 3
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/RegExp/15.10.2-1.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/15.10.2-1.js
new file mode 100644
index 0000000000..9439a2ccd6
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/15.10.2-1.js
@@ -0,0 +1,181 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_3/RegExp/15.10.2.12.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/15.10.2.12.js
new file mode 100755
index 0000000000..d68b86c2ed
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/15.10.2.12.js
@@ -0,0 +1,63 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_3/RegExp/15.10.3.1-1.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/15.10.3.1-1.js
new file mode 100644
index 0000000000..7286cea297
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/15.10.3.1-1.js
@@ -0,0 +1,136 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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/qml/parserstress/tests/ecma_3/RegExp/15.10.3.1-2.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/15.10.3.1-2.js
new file mode 100644
index 0000000000..d78be13c25
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/15.10.3.1-2.js
@@ -0,0 +1,144 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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/qml/parserstress/tests/ecma_3/RegExp/15.10.4.1-1.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/15.10.4.1-1.js
new file mode 100644
index 0000000000..47faf0051b
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/15.10.4.1-1.js
@@ -0,0 +1,127 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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/qml/parserstress/tests/ecma_3/RegExp/15.10.4.1-2.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/15.10.4.1-2.js
new file mode 100644
index 0000000000..1d67b8afe6
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/15.10.4.1-2.js
@@ -0,0 +1,133 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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/qml/parserstress/tests/ecma_3/RegExp/15.10.4.1-3.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/15.10.4.1-3.js
new file mode 100644
index 0000000000..12ef46bde8
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/15.10.4.1-3.js
@@ -0,0 +1,139 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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/qml/parserstress/tests/ecma_3/RegExp/15.10.4.1-4.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/15.10.4.1-4.js
new file mode 100644
index 0000000000..3b4245851e
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/15.10.4.1-4.js
@@ -0,0 +1,146 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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/qml/parserstress/tests/ecma_3/RegExp/15.10.4.1-5-n.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/15.10.4.1-5-n.js
new file mode 100644
index 0000000000..592fb03ac7
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/15.10.4.1-5-n.js
@@ -0,0 +1,139 @@
+/* -*- 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/qml/parserstress/tests/ecma_3/RegExp/15.10.6.2-1.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/15.10.6.2-1.js
new file mode 100644
index 0000000000..8203da4967
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/15.10.6.2-1.js
@@ -0,0 +1,140 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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/qml/parserstress/tests/ecma_3/RegExp/15.10.6.2-2.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/15.10.6.2-2.js
new file mode 100644
index 0000000000..e6fd6c6311
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/15.10.6.2-2.js
@@ -0,0 +1,367 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_3/RegExp/browser.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/RegExp/octal-001.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/octal-001.js
new file mode 100644
index 0000000000..f35724e47b
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/octal-001.js
@@ -0,0 +1,136 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_3/RegExp/octal-002.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/octal-002.js
new file mode 100644
index 0000000000..401ad43c11
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/octal-002.js
@@ -0,0 +1,218 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_3/RegExp/perlstress-001.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/perlstress-001.js
new file mode 100644
index 0000000000..0b27529a32
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/perlstress-001.js
@@ -0,0 +1,3230 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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 = /(?<!c)b/;
+ string = 'ab';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('b');
+ addThis();
+
+ status = inSection(237);
+ pattern = /(?<!c)b/;
+ string = 'b';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('b');
+ addThis();
+
+ status = inSection(238);
+ pattern = /(?<!c)b/;
+ string = 'b';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('b');
+ addThis();
+*/
+
+status = inSection(239);
+pattern = /(?:..)*a/;
+string = 'aba';
+actualmatch = string.match(pattern);
+expectedmatch = Array('aba');
+addThis();
+
+status = inSection(240);
+pattern = /(?:..)*?a/;
+string = 'aba';
+actualmatch = string.match(pattern);
+expectedmatch = Array('a');
+addThis();
+
+/*
+ * MODIFIED - ECMA has different rules for paren contents. Note
+ * this regexp has two non-capturing parens, and one capturing
+ *
+ * The issue: shouldn't the match be ['ab', undefined]? Because the
+ * '\1' matches the undefined value of the second iteration of the '*'
+ * (in which the 'b' part of the '|' matches). But Perl wants ['ab','b'].
+ *
+ * Answer: waldemar@netscape.com:
+ *
+ * The correct answer is ['ab', undefined]. Perl doesn't match
+ * ECMAScript here, and I'd say that Perl is wrong in this case.
+ */
+status = inSection(241);
+pattern = /^(?:b|a(?=(.)))*\1/;
+string = 'abc';
+actualmatch = string.match(pattern);
+//expectedmatch = Array('ab', 'b');
+expectedmatch = Array('ab', undefined);
+addThis();
+
+status = inSection(242);
+pattern = /^(){3,5}/;
+string = 'abc';
+actualmatch = string.match(pattern);
+expectedmatch = Array('', '');
+addThis();
+
+status = inSection(243);
+pattern = /^(a+)*ax/;
+string = 'aax';
+actualmatch = string.match(pattern);
+expectedmatch = Array('aax', 'a');
+addThis();
+
+status = inSection(244);
+pattern = /^((a|b)+)*ax/;
+string = 'aax';
+actualmatch = string.match(pattern);
+expectedmatch = Array('aax', 'a', 'a');
+addThis();
+
+status = inSection(245);
+pattern = /^((a|bc)+)*ax/;
+string = 'aax';
+actualmatch = string.match(pattern);
+expectedmatch = Array('aax', 'a', 'a');
+addThis();
+
+/* MODIFIED - ECMA has different rules for paren contents */
+status = inSection(246);
+pattern = /(a|x)*ab/;
+string = 'cab';
+actualmatch = string.match(pattern);
+//expectedmatch = Array('ab', '');
+expectedmatch = Array('ab', undefined);
+addThis();
+
+status = inSection(247);
+pattern = /(a)*ab/;
+string = 'cab';
+actualmatch = string.match(pattern);
+expectedmatch = Array('ab', undefined);
+addThis();
+
+/* ECMA doesn't support (?imsx or (?-imsx
+ status = inSection(248);
+ pattern = /(?:(?i)a)b/;
+ string = 'ab';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('ab');
+ addThis();
+
+ status = inSection(249);
+ pattern = /((?i)a)b/;
+ string = 'ab';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('ab', 'a');
+ addThis();
+
+ status = inSection(250);
+ pattern = /(?:(?i)a)b/;
+ string = 'Ab';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('Ab');
+ addThis();
+
+ status = inSection(251);
+ pattern = /((?i)a)b/;
+ string = 'Ab';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('Ab', 'A');
+ addThis();
+
+ status = inSection(252);
+ pattern = /(?i:a)b/;
+ string = 'ab';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('ab');
+ addThis();
+
+ status = inSection(253);
+ pattern = /((?i:a))b/;
+ string = 'ab';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('ab', 'a');
+ addThis();
+
+ status = inSection(254);
+ pattern = /(?i:a)b/;
+ string = 'Ab';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('Ab');
+ addThis();
+
+ status = inSection(255);
+ pattern = /((?i:a))b/;
+ string = 'Ab';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('Ab', 'A');
+ addThis();
+
+ status = inSection(256);
+ pattern = /(?:(?-i)a)b/i;
+ string = 'ab';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('ab');
+ addThis();
+
+ status = inSection(257);
+ pattern = /((?-i)a)b/i;
+ string = 'ab';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('ab', 'a');
+ addThis();
+
+ status = inSection(258);
+ pattern = /(?:(?-i)a)b/i;
+ string = 'aB';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('aB');
+ addThis();
+
+ status = inSection(259);
+ pattern = /((?-i)a)b/i;
+ string = 'aB';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('aB', 'a');
+ addThis();
+
+ status = inSection(260);
+ pattern = /(?:(?-i)a)b/i;
+ string = 'aB';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('aB');
+ addThis();
+
+ status = inSection(261);
+ pattern = /((?-i)a)b/i;
+ string = 'aB';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('aB', 'a');
+ addThis();
+
+ status = inSection(262);
+ pattern = /(?-i:a)b/i;
+ string = 'ab';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('ab');
+ addThis();
+
+ status = inSection(263);
+ pattern = /((?-i:a))b/i;
+ string = 'ab';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('ab', 'a');
+ addThis();
+
+ status = inSection(264);
+ pattern = /(?-i:a)b/i;
+ string = 'aB';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('aB');
+ addThis();
+
+ status = inSection(265);
+ pattern = /((?-i:a))b/i;
+ string = 'aB';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('aB', 'a');
+ addThis();
+
+ status = inSection(266);
+ pattern = /(?-i:a)b/i;
+ string = 'aB';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('aB');
+ addThis();
+
+ status = inSection(267);
+ pattern = /((?-i:a))b/i;
+ string = 'aB';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('aB', 'a');
+ addThis();
+
+ status = inSection(268);
+ pattern = /((?s-i:a.))b/i;
+ string = 'a\nB';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('a\nB', 'a\n');
+ addThis();
+*/
+
+status = inSection(269);
+pattern = /(?:c|d)(?:)(?:a(?:)(?:b)(?:b(?:))(?:b(?:)(?:b)))/;
+string = 'cabbbb';
+actualmatch = string.match(pattern);
+expectedmatch = Array('cabbbb');
+addThis();
+
+status = inSection(270);
+pattern = /(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))/;
+string = 'caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb';
+actualmatch = string.match(pattern);
+expectedmatch = Array('caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb');
+addThis();
+
+status = inSection(271);
+pattern = /(ab)\d\1/i;
+string = 'Ab4ab';
+actualmatch = string.match(pattern);
+expectedmatch = Array('Ab4ab', 'Ab');
+addThis();
+
+status = inSection(272);
+pattern = /(ab)\d\1/i;
+string = 'ab4Ab';
+actualmatch = string.match(pattern);
+expectedmatch = Array('ab4Ab', 'ab');
+addThis();
+
+status = inSection(273);
+pattern = /foo\w*\d{4}baz/;
+string = 'foobar1234baz';
+actualmatch = string.match(pattern);
+expectedmatch = Array('foobar1234baz');
+addThis();
+
+status = inSection(274);
+pattern = /x(~~)*(?:(?:F)?)?/;
+string = 'x~~';
+actualmatch = string.match(pattern);
+expectedmatch = Array('x~~', '~~');
+addThis();
+
+/* Perl supports (?# but JS doesn't
+ status = inSection(275);
+ pattern = /^a(?#xxx){3}c/;
+ string = 'aaac';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('aaac');
+ addThis();
+*/
+
+/* ECMA doesn't support (?< etc
+ status = inSection(276);
+ pattern = /(?<![cd])[ab]/;
+ string = 'dbaacb';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('a');
+ addThis();
+
+ status = inSection(277);
+ pattern = /(?<!(c|d))[ab]/;
+ string = 'dbaacb';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('a');
+ addThis();
+
+ status = inSection(278);
+ pattern = /(?<!cd)[ab]/;
+ string = 'cdaccb';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('b');
+ addThis();
+
+ status = inSection(279);
+ pattern = /((?s)^a(.))((?m)^b$)/;
+ string = 'a\nb\nc\n';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('a\nb', 'a\n', '\n', 'b');
+ addThis();
+
+ status = inSection(280);
+ pattern = /((?m)^b$)/;
+ string = 'a\nb\nc\n';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('b', 'b');
+ addThis();
+
+ status = inSection(281);
+ pattern = /(?m)^b/;
+ string = 'a\nb\n';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('b');
+ addThis();
+
+ status = inSection(282);
+ pattern = /(?m)^(b)/;
+ string = 'a\nb\n';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('b', 'b');
+ addThis();
+
+ status = inSection(283);
+ pattern = /((?m)^b)/;
+ string = 'a\nb\n';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('b', 'b');
+ addThis();
+
+ status = inSection(284);
+ pattern = /\n((?m)^b)/;
+ string = 'a\nb\n';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('\nb', 'b');
+ addThis();
+
+ status = inSection(285);
+ pattern = /((?s).)c(?!.)/;
+ string = 'a\nb\nc\n';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('\nc', '\n');
+ addThis();
+
+ status = inSection(286);
+ pattern = /((?s).)c(?!.)/;
+ string = 'a\nb\nc\n';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('\nc', '\n');
+ addThis();
+
+ status = inSection(287);
+ pattern = /((?s)b.)c(?!.)/;
+ string = 'a\nb\nc\n';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('b\nc', 'b\n');
+ addThis();
+
+ status = inSection(288);
+ pattern = /((?s)b.)c(?!.)/;
+ string = 'a\nb\nc\n';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('b\nc', 'b\n');
+ addThis();
+
+ status = inSection(289);
+ pattern = /((?m)^b)/;
+ string = 'a\nb\nc\n';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('b', 'b');
+ addThis();
+*/
+
+/* ECMA doesn't support (?(condition)
+ status = inSection(290);
+ pattern = /(?(1)b|a)/;
+ string = 'a';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('a');
+ addThis();
+
+ status = inSection(291);
+ pattern = /(x)?(?(1)b|a)/;
+ string = 'a';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('a');
+ addThis();
+
+ status = inSection(292);
+ pattern = /()?(?(1)b|a)/;
+ string = 'a';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('a');
+ addThis();
+
+ status = inSection(293);
+ pattern = /()?(?(1)a|b)/;
+ string = 'a';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('a');
+ addThis();
+
+ status = inSection(294);
+ pattern = /^(\()?blah(?(1)(\)))$/;
+ string = '(blah)';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('(blah)', '(', ')');
+ addThis();
+
+ status = inSection(295);
+ pattern = /^(\()?blah(?(1)(\)))$/;
+ string = 'blah';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('blah');
+ addThis();
+
+ status = inSection(296);
+ pattern = /^(\(+)?blah(?(1)(\)))$/;
+ string = '(blah)';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('(blah)', '(', ')');
+ addThis();
+
+ status = inSection(297);
+ pattern = /^(\(+)?blah(?(1)(\)))$/;
+ string = 'blah';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('blah');
+ addThis();
+
+ status = inSection(298);
+ pattern = /(?(?!a)b|a)/;
+ string = 'a';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('a');
+ addThis();
+
+ status = inSection(299);
+ pattern = /(?(?=a)a|b)/;
+ string = 'a';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('a');
+ addThis();
+*/
+
+status = inSection(300);
+pattern = /(?=(a+?))(\1ab)/;
+string = 'aaab';
+actualmatch = string.match(pattern);
+expectedmatch = Array('aab', 'a', 'aab');
+addThis();
+
+status = inSection(301);
+pattern = /(\w+:)+/;
+string = 'one:';
+actualmatch = string.match(pattern);
+expectedmatch = Array('one:', 'one:');
+addThis();
+
+/* ECMA doesn't support (?< etc
+ status = inSection(302);
+ pattern = /$(?<=^(a))/;
+ string = 'a';
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('', 'a');
+ addThis();
+*/
+
+status = inSection(303);
+pattern = /(?=(a+?))(\1ab)/;
+string = 'aaab';
+actualmatch = string.match(pattern);
+expectedmatch = Array('aab', 'a', 'aab');
+addThis();
+
+/* MODIFIED - ECMA has different rules for paren contents */
+status = inSection(304);
+pattern = /([\w:]+::)?(\w+)$/;
+string = 'abcd';
+actualmatch = string.match(pattern);
+//expectedmatch = Array('abcd', '', 'abcd');
+expectedmatch = Array('abcd', undefined, 'abcd');
+addThis();
+
+status = inSection(305);
+pattern = /([\w:]+::)?(\w+)$/;
+string = 'xy:z:::abcd';
+actualmatch = string.match(pattern);
+expectedmatch = Array('xy:z:::abcd', 'xy:z:::', 'abcd');
+addThis();
+
+status = inSection(306);
+pattern = /^[^bcd]*(c+)/;
+string = 'aexycd';
+actualmatch = string.match(pattern);
+expectedmatch = Array('aexyc', 'c');
+addThis();
+
+status = inSection(307);
+pattern = /(a*)b+/;
+string = 'caab';
+actualmatch = string.match(pattern);
+expectedmatch = Array('aab', 'aa');
+addThis();
+
+/* MODIFIED - ECMA has different rules for paren contents */
+status = inSection(308);
+pattern = /([\w:]+::)?(\w+)$/;
+string = 'abcd';
+actualmatch = string.match(pattern);
+//expectedmatch = Array('abcd', '', 'abcd');
+expectedmatch = Array('abcd', undefined, 'abcd');
+addThis();
+
+status = inSection(309);
+pattern = /([\w:]+::)?(\w+)$/;
+string = 'xy:z:::abcd';
+actualmatch = string.match(pattern);
+expectedmatch = Array('xy:z:::abcd', 'xy:z:::', 'abcd');
+addThis();
+
+status = inSection(310);
+pattern = /^[^bcd]*(c+)/;
+string = 'aexycd';
+actualmatch = string.match(pattern);
+expectedmatch = Array('aexyc', 'c');
+addThis();
+
+/* ECMA doesn't support (?>
+ 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/qml/parserstress/tests/ecma_3/RegExp/perlstress-002.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/perlstress-002.js
new file mode 100644
index 0000000000..a9b147b977
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/perlstress-002.js
@@ -0,0 +1,1842 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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 = /(?<!c)b/;
+ string = 'cb';
+ actualmatch = string.match(pattern);
+ expectedmatch = null;
+ addThis();
+*/
+
+/* ECMA doesn't support (?(condition)
+ status = inSection(71);
+ pattern = /(?:(?i)a)b/;
+ string = 'aB';
+ actualmatch = string.match(pattern);
+ expectedmatch = null;
+ addThis();
+
+ status = inSection(72);
+ pattern = /((?i)a)b/;
+ string = 'aB';
+ actualmatch = string.match(pattern);
+ expectedmatch = null;
+ addThis();
+
+ status = inSection(73);
+ pattern = /(?i:a)b/;
+ string = 'aB';
+ actualmatch = string.match(pattern);
+ expectedmatch = null;
+ addThis();
+
+ status = inSection(74);
+ pattern = /((?i:a))b/;
+ string = 'aB';
+ actualmatch = string.match(pattern);
+ expectedmatch = null;
+ addThis();
+
+ status = inSection(75);
+ pattern = /(?:(?-i)a)b/i;
+ string = 'Ab';
+ actualmatch = string.match(pattern);
+ expectedmatch = null;
+ addThis();
+
+ status = inSection(76);
+ pattern = /((?-i)a)b/i;
+ string = 'Ab';
+ actualmatch = string.match(pattern);
+ expectedmatch = null;
+ addThis();
+
+ status = inSection(77);
+ pattern = /(?:(?-i)a)b/i;
+ string = 'AB';
+ actualmatch = string.match(pattern);
+ expectedmatch = null;
+ addThis();
+
+ status = inSection(78);
+ pattern = /((?-i)a)b/i;
+ string = 'AB';
+ actualmatch = string.match(pattern);
+ expectedmatch = null;
+ addThis();
+
+ status = inSection(79);
+ pattern = /(?-i:a)b/i;
+ string = 'Ab';
+ actualmatch = string.match(pattern);
+ expectedmatch = null;
+ addThis();
+
+ status = inSection(80);
+ pattern = /((?-i:a))b/i;
+ string = 'Ab';
+ actualmatch = string.match(pattern);
+ expectedmatch = null;
+ addThis();
+
+ status = inSection(81);
+ pattern = /(?-i:a)b/i;
+ string = 'AB';
+ actualmatch = string.match(pattern);
+ expectedmatch = null;
+ addThis();
+
+ status = inSection(82);
+ pattern = /((?-i:a))b/i;
+ string = 'AB';
+ actualmatch = string.match(pattern);
+ expectedmatch = null;
+ addThis();
+
+ status = inSection(83);
+ pattern = /((?-i:a.))b/i;
+ string = 'a\nB';
+ actualmatch = string.match(pattern);
+ expectedmatch = null;
+ addThis();
+
+ status = inSection(84);
+ pattern = /((?s-i:a.))b/i;
+ string = 'B\nB';
+ actualmatch = string.match(pattern);
+ expectedmatch = null;
+ addThis();
+*/
+
+/* ECMA doesn't support (?<
+ status = inSection(85);
+ pattern = /(?<![cd])b/;
+ string = 'dbcb';
+ actualmatch = string.match(pattern);
+ expectedmatch = null;
+ addThis();
+
+ status = inSection(86);
+ pattern = /(?<!(c|d))b/;
+ string = 'dbcb';
+ actualmatch = string.match(pattern);
+ expectedmatch = null;
+ addThis();
+*/
+
+status = inSection(87);
+pattern = /^(?:a?b?)*$/;
+string = 'a--';
+actualmatch = string.match(pattern);
+expectedmatch = null;
+addThis();
+
+status = inSection(88);
+pattern = /^b/;
+string = 'a\nb\nc\n';
+actualmatch = string.match(pattern);
+expectedmatch = null;
+addThis();
+
+status = inSection(89);
+pattern = /()^b/;
+string = 'a\nb\nc\n';
+actualmatch = string.match(pattern);
+expectedmatch = null;
+addThis();
+
+/* ECMA doesn't support (?(
+ status = inSection(90);
+ pattern = /(?(1)a|b)/;
+ string = 'a';
+ actualmatch = string.match(pattern);
+ expectedmatch = null;
+ addThis();
+
+ status = inSection(91);
+ pattern = /(x)?(?(1)a|b)/;
+ string = 'a';
+ actualmatch = string.match(pattern);
+ expectedmatch = null;
+ addThis();
+
+ status = inSection(92);
+ pattern = /()(?(1)b|a)/;
+ string = 'a';
+ actualmatch = string.match(pattern);
+ expectedmatch = null;
+ addThis();
+
+ status = inSection(93);
+ pattern = /^(\()?blah(?(1)(\)))$/;
+ string = 'blah)';
+ actualmatch = string.match(pattern);
+ expectedmatch = null;
+ addThis();
+
+ status = inSection(94);
+ pattern = /^(\()?blah(?(1)(\)))$/;
+ string = '(blah';
+ actualmatch = string.match(pattern);
+ expectedmatch = null;
+ addThis();
+
+ status = inSection(95);
+ pattern = /^(\(+)?blah(?(1)(\)))$/;
+ string = 'blah)';
+ actualmatch = string.match(pattern);
+ expectedmatch = null;
+ addThis();
+
+ status = inSection(96);
+ pattern = /^(\(+)?blah(?(1)(\)))$/;
+ string = '(blah';
+ actualmatch = string.match(pattern);
+ expectedmatch = null;
+ addThis();
+
+ status = inSection(97);
+ pattern = /(?(?{0})a|b)/;
+ string = 'a';
+ actualmatch = string.match(pattern);
+ expectedmatch = null;
+ addThis();
+
+ status = inSection(98);
+ pattern = /(?(?{1})b|a)/;
+ string = 'a';
+ actualmatch = string.match(pattern);
+ expectedmatch = null;
+ addThis();
+
+ status = inSection(99);
+ pattern = /(?(?!a)a|b)/;
+ string = 'a';
+ actualmatch = string.match(pattern);
+ expectedmatch = null;
+ addThis();
+
+ status = inSection(100);
+ pattern = /(?(?=a)b|a)/;
+ string = 'a';
+ actualmatch = string.match(pattern);
+ expectedmatch = null;
+ addThis();
+*/
+
+status = inSection(101);
+pattern = /^(?=(a+?))\1ab/;
+string = 'aaab';
+actualmatch = string.match(pattern);
+expectedmatch = null;
+addThis();
+
+status = inSection(102);
+pattern = /^(?=(a+?))\1ab/;
+string = 'aaab';
+actualmatch = string.match(pattern);
+expectedmatch = null;
+addThis();
+
+status = inSection(103);
+pattern = /([\w:]+::)?(\w+)$/;
+string = 'abcd:';
+actualmatch = string.match(pattern);
+expectedmatch = null;
+addThis();
+
+status = inSection(104);
+pattern = /([\w:]+::)?(\w+)$/;
+string = 'abcd:';
+actualmatch = string.match(pattern);
+expectedmatch = null;
+addThis();
+
+status = inSection(105);
+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/qml/parserstress/tests/ecma_3/RegExp/regress-100199.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-100199.js
new file mode 100644
index 0000000000..8c88aa7f52
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-100199.js
@@ -0,0 +1,307 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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/qml/parserstress/tests/ecma_3/RegExp/regress-105972.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-105972.js
new file mode 100644
index 0000000000..e691c518b4
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-105972.js
@@ -0,0 +1,157 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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/qml/parserstress/tests/ecma_3/RegExp/regress-119909.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-119909.js
new file mode 100644
index 0000000000..97f6414bc7
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-119909.js
@@ -0,0 +1,92 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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<numParens; i++) {pattern += openParen;}
+ pattern += strOriginal;
+ for (i=0; i<numParens; i++) {pattern += closeParen;}
+ var re = new RegExp(pattern);
+
+ var res = strOriginal.search(re);
+ res = strOriginal.match(re);
+ res = strOriginal.replace(re, strReplace);
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-122076.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-122076.js
new file mode 100644
index 0000000000..e77f433fc4
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-122076.js
@@ -0,0 +1,110 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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: 12 Feb 2002
+ * SUMMARY: Don't crash on invalid regexp literals / \\/ /
+ *
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=122076
+ * The function checkURL() below sometimes caused a compile-time error:
+ *
+ * SyntaxError: unterminated parenthetical (:
+ *
+ * However, sometimes it would cause a crash instead. The presence of
+ * other functions below is merely fodder to help provoke the crash.
+ * The constant |STRESS| is number of times we'll try to crash on this.
+ *
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-122076.js';
+var BUGNUMBER = 122076;
+var summary = "Don't crash on invalid regexp literals / \\/ /";
+var STRESS = 10;
+var sEval = '';
+
+printBugNumber(BUGNUMBER);
+printStatus(summary);
+
+
+sEval += 'function checkDate()'
+sEval += '{'
+sEval += 'return (this.value.search(/^[012]?\d\/[0123]?\d\/[0]\d$/) != -1);'
+sEval += '}'
+
+sEval += 'function checkDNSName()'
+sEval += '{'
+sEval += ' return (this.value.search(/^([\w\-]+\.)+([\w\-]{2,3})$/) != -1);'
+sEval += '}'
+
+sEval += 'function checkEmail()'
+sEval += '{'
+sEval += ' return (this.value.search(/^([\w\-]+\.)*[\w\-]+@([\w\-]+\.)+([\w\-]{2,3})$/) != -1);'
+sEval += '}'
+
+sEval += 'function checkHostOrIP()'
+sEval += '{'
+sEval += ' if (this.value.search(/^([\w\-]+\.)+([\w\-]{2,3})$/) == -1)'
+sEval += ' return (this.value.search(/^[1-2]?\d{1,2}\.[1-2]?\d{1,2}\.[1-2]?\d{1,2}\.[1-2]?\d{1,2}$/) != -1);'
+sEval += ' else'
+sEval += ' return true;'
+sEval += '}'
+
+sEval += 'function checkIPAddress()'
+sEval += '{'
+sEval += ' return (this.value.search(/^[1-2]?\d{1,2}\.[1-2]?\d{1,2}\.[1-2]?\d{1,2}\.[1-2]?\d{1,2}$/) != -1);'
+sEval += '}'
+
+sEval += 'function checkURL()'
+sEval += '{'
+sEval += ' return (this.value.search(/^(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,4}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\/\*\$+@&#;`~=%!]*)(\.\w{2,})?)*\/?)$/) != -1);'
+sEval += '}'
+
+
+for (var i=0; i<STRESS; i++)
+{
+ try
+ {
+ eval(sEval);
+ }
+ catch(e)
+ {
+ }
+}
+
+reportCompare('No Crash', 'No Crash', '');
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-123437.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-123437.js
new file mode 100644
index 0000000000..745a3a707a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-123437.js
@@ -0,0 +1,112 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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):
+ * waldemar, rogerl, 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 Feb 2002
+ * SUMMARY: regexp backreferences must hold |undefined| if not used
+ *
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=123437 (SpiderMonkey)
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=123439 (Rhino)
+ *
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-123437.js';
+var i = 0;
+var BUGNUMBER = 123437;
+var summary = 'regexp backreferences must hold |undefined| if not used';
+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/;
+string = 'a';
+status = inSection(1);
+actualmatch = string.match(pattern);
+expectedmatch = Array('a', undefined);
+addThis();
+
+pattern = /a|(b)/;
+string = 'a';
+status = inSection(2);
+actualmatch = string.match(pattern);
+expectedmatch = Array('a', undefined);
+addThis();
+
+pattern = /(a)?(a)/;
+string = 'a';
+status = inSection(3);
+actualmatch = string.match(pattern);
+expectedmatch = Array('a', undefined, '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/qml/parserstress/tests/ecma_3/RegExp/regress-165353.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-165353.js
new file mode 100644
index 0000000000..f7c736ce4d
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-165353.js
@@ -0,0 +1,122 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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):
+ * franky@pacificconnections.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: 31 August 2002
+ * SUMMARY: RegExp conformance test
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=165353
+ *
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-165353.js';
+var i = 0;
+var BUGNUMBER = 165353;
+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();
+
+
+pattern = /^([a-z]+)*[a-z]$/;
+status = inSection(1);
+string = 'a';
+actualmatch = string.match(pattern);
+expectedmatch = Array('a', undefined);
+addThis();
+
+status = inSection(2);
+string = 'ab';
+actualmatch = string.match(pattern);
+expectedmatch = Array('ab', 'a');
+addThis();
+
+status = inSection(3);
+string = 'abc';
+actualmatch = string.match(pattern);
+expectedmatch = Array('abc', 'ab');
+addThis();
+
+
+string = 'www.netscape.com';
+status = inSection(4);
+pattern = /^(([a-z]+)*[a-z]\.)+[a-z]{2,}$/;
+actualmatch = string.match(pattern);
+expectedmatch = Array('www.netscape.com', 'netscape.', 'netscap');
+addThis();
+
+// add one more capturing parens to the previous regexp -
+status = inSection(5);
+pattern = /^(([a-z]+)*([a-z])\.)+[a-z]{2,}$/;
+actualmatch = string.match(pattern);
+expectedmatch = Array('www.netscape.com', 'netscape.', 'netscap', 'e');
+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/qml/parserstress/tests/ecma_3/RegExp/regress-169497.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-169497.js
new file mode 100644
index 0000000000..5613a93872
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-169497.js
@@ -0,0 +1,105 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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):
+ * martin.honnen@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: 31 August 2002
+ * SUMMARY: RegExp conformance test
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=169497
+ *
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-169497.js';
+var i = 0;
+var BUGNUMBER = 169497;
+var summary = 'RegExp conformance test';
+var status = '';
+var statusmessages = new Array();
+var pattern = '';
+var patterns = new Array();
+var sBody = '';
+var sHTML = '';
+var string = '';
+var strings = new Array();
+var actualmatch = '';
+var actualmatches = new Array();
+var expectedmatch = '';
+var expectedmatches = new Array();
+
+sBody += '<body onXXX="alert(event.type);">\n';
+sBody += '<p>Kibology for all<\/p>\n';
+sBody += '<p>All for Kibology<\/p>\n';
+sBody += '<\/body>';
+
+sHTML += '<html>\n';
+sHTML += sBody;
+sHTML += '\n<\/html>';
+
+status = inSection(1);
+string = sHTML;
+pattern = /<body.*>((.*\n?)*?)<\/body>/i;
+actualmatch = string.match(pattern);
+expectedmatch = Array(sBody, '\n<p>Kibology for all</p>\n<p>All for Kibology</p>\n', '<p>All for Kibology</p>\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/qml/parserstress/tests/ecma_3/RegExp/regress-169534.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-169534.js
new file mode 100644
index 0000000000..c736631bd7
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-169534.js
@@ -0,0 +1,95 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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, '<a href="$4">$2</a>');
+expect = 'To sign up click <a href="https://www.xxxx.org/subscribe.htm">here</a>';
+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<UBound; i++)
+ {
+ reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
+ }
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-187133.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-187133.js
new file mode 100644
index 0000000000..98ec4753bf
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-187133.js
@@ -0,0 +1,142 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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):
+ * ji_bo@yahoo.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: 06 January 2003
+ * SUMMARY: RegExp conformance test
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=187133
+ *
+ * The tests here employ the regular expression construct:
+ *
+ * (?!pattern)
+ *
+ * This is a "zero-width lookahead negative assertion".
+ * From the Perl documentation:
+ *
+ * For example, /foo(?!bar)/ matches any occurrence
+ * of 'foo' that isn't followed by 'bar'.
+ *
+ * It is "zero-width" means that it does not consume any characters and that
+ * the parens are non-capturing. A non-null match array in the example above
+ * will have only have length 1, not 2.
+ *
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-187133.js';
+var i = 0;
+var BUGNUMBER = 187133;
+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();
+
+
+pattern = /(\.(?!com|org)|\/)/;
+status = inSection(1);
+string = 'ah.info';
+actualmatch = string.match(pattern);
+expectedmatch = ['.', '.'];
+addThis();
+
+status = inSection(2);
+string = 'ah/info';
+actualmatch = string.match(pattern);
+expectedmatch = ['/', '/'];
+addThis();
+
+status = inSection(3);
+string = 'ah.com';
+actualmatch = string.match(pattern);
+expectedmatch = null;
+addThis();
+
+
+pattern = /(?!a|b)|c/;
+status = inSection(4);
+string = '';
+actualmatch = string.match(pattern);
+expectedmatch = [''];
+addThis();
+
+status = inSection(5);
+string = 'bc';
+actualmatch = string.match(pattern);
+expectedmatch = [''];
+addThis();
+
+status = inSection(6);
+string = 'd';
+actualmatch = string.match(pattern);
+expectedmatch = [''];
+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/qml/parserstress/tests/ecma_3/RegExp/regress-188206.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-188206.js
new file mode 100644
index 0000000000..308c0ff605
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-188206.js
@@ -0,0 +1,219 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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):
+ * scole@planetweb.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: 21 January 2003
+ * SUMMARY: Invalid use of regexp quantifiers should generate SyntaxErrors
+ *
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=188206
+ * and http://bugzilla.mozilla.org/show_bug.cgi?id=85721#c48 etc.
+ * and http://bugzilla.mozilla.org/show_bug.cgi?id=190685
+ * and http://bugzilla.mozilla.org/show_bug.cgi?id=197451
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-188206.js';
+var UBound = 0;
+var BUGNUMBER = 188206;
+var summary = 'Invalid use of regexp quantifiers should generate SyntaxErrors';
+var TEST_PASSED = 'SyntaxError';
+var TEST_FAILED = 'Generated an error, but NOT a SyntaxError!';
+var TEST_FAILED_BADLY = 'Did not generate ANY error!!!';
+var CHECK_PASSED = 'Should not generate an error';
+var CHECK_FAILED = 'Generated an error!';
+var status = '';
+var statusitems = [];
+var actual = '';
+var actualvalues = [];
+var expect= '';
+var expectedvalues = [];
+
+
+/*
+ * All the following are invalid uses of regexp quantifiers and
+ * should generate SyntaxErrors. That's what we're testing for.
+ *
+ * To allow the test to compile and run, we have to hide the errors
+ * inside eval strings, and check they are caught at run-time -
+ *
+ */
+status = inSection(1);
+testThis(' /a**/ ');
+
+status = inSection(2);
+testThis(' /a***/ ');
+
+status = inSection(3);
+testThis(' /a++/ ');
+
+status = inSection(4);
+testThis(' /a+++/ ');
+
+/*
+ * The ? quantifier, unlike * or +, may appear twice in succession.
+ * Thus we need at least three in a row to provoke a SyntaxError -
+ */
+
+status = inSection(5);
+testThis(' /a???/ ');
+
+status = inSection(6);
+testThis(' /a????/ ');
+
+
+/*
+ * Now do some weird things on the left side of the regexps -
+ */
+status = inSection(9);
+testThis(' /+a/ ');
+
+status = inSection(10);
+testThis(' /++a/ ');
+
+status = inSection(11);
+testThis(' /?a/ ');
+
+status = inSection(12);
+testThis(' /??a/ ');
+
+
+/*
+ * Misusing the {DecmalDigits} quantifier - according to BOTH ECMA and Perl.
+ *
+ * Just as with the * and + quantifiers above, can't have two {DecmalDigits}
+ * quantifiers in succession - it's a SyntaxError.
+ */
+status = inSection(28);
+testThis(' /x{1}{1}/ ');
+
+status = inSection(29);
+testThis(' /x{1,}{1}/ ');
+
+status = inSection(30);
+testThis(' /x{1,2}{1}/ ');
+
+status = inSection(31);
+testThis(' /x{1}{1,}/ ');
+
+status = inSection(32);
+testThis(' /x{1,}{1,}/ ');
+
+status = inSection(33);
+testThis(' /x{1,2}{1,}/ ');
+
+status = inSection(34);
+testThis(' /x{1}{1,2}/ ');
+
+status = inSection(35);
+testThis(' /x{1,}{1,2}/ ');
+
+status = inSection(36);
+testThis(' /x{1,2}{1,2}/ ');
+
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+
+
+/*
+ * Invalid syntax should generate a SyntaxError
+ */
+function testThis(sInvalidSyntax)
+{
+ expect = TEST_PASSED;
+ actual = TEST_FAILED_BADLY;
+
+ try
+ {
+ eval(sInvalidSyntax);
+ }
+ catch(e)
+ {
+ if (e instanceof SyntaxError)
+ actual = TEST_PASSED;
+ else
+ actual = TEST_FAILED;
+ }
+
+ statusitems[UBound] = status;
+ expectedvalues[UBound] = expect;
+ actualvalues[UBound] = actual;
+ UBound++;
+}
+
+
+/*
+ * Allowed syntax shouldn't generate any errors
+ */
+function checkThis(sAllowedSyntax)
+{
+ expect = CHECK_PASSED;
+ actual = CHECK_PASSED;
+
+ try
+ {
+ eval(sAllowedSyntax);
+ }
+ catch(e)
+ {
+ actual = CHECK_FAILED;
+ }
+
+ statusitems[UBound] = status;
+ expectedvalues[UBound] = expect;
+ actualvalues[UBound] = actual;
+ 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/qml/parserstress/tests/ecma_3/RegExp/regress-191479.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-191479.js
new file mode 100644
index 0000000000..51d5f14c42
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-191479.js
@@ -0,0 +1,198 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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):
+ * flying@dom.natm.ru, 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 January 2003
+ * SUMMARY: Testing regular expressions of form /(x|y){n,}/
+ *
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=191479
+ *
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-191479.js';
+var i = 0;
+var BUGNUMBER = 191479;
+var summary = 'Testing regular expressions of form /(x|y){n,}/';
+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 = '12 3 45';
+pattern = /(\d|\d\s){2,}/;
+actualmatch = string.match(pattern);
+expectedmatch = Array('12', '2');
+addThis();
+
+status = inSection(2);
+string = '12 3 45';
+pattern = /(\d|\d\s){4,}/;
+actualmatch = string.match(pattern);
+expectedmatch = Array(string, '5');
+addThis();
+
+status = inSection(3);
+string = '12 3 45';
+pattern = /(\d|\d\s)+/;
+actualmatch = string.match(pattern);
+expectedmatch = Array('12', '2');
+addThis();
+
+status = inSection(4);
+string = '12 3 45';
+pattern = /(\d\s?){4,}/;
+actualmatch = string.match(pattern);
+expectedmatch = Array(string, '5');
+addThis();
+
+/*
+ * Let's reverse the operands in Sections 1-3 above -
+ */
+status = inSection(5);
+string = '12 3 45';
+pattern = /(\d\s|\d){2,}/;
+actualmatch = string.match(pattern);
+expectedmatch = Array(string, '5');
+addThis();
+
+status = inSection(6);
+string = '12 3 45';
+pattern = /(\d\s|\d){4,}/;
+actualmatch = string.match(pattern);
+expectedmatch = Array(string, '5');
+addThis();
+
+status = inSection(7);
+string = '12 3 45';
+pattern = /(\d\s|\d)+/;
+actualmatch = string.match(pattern);
+expectedmatch = Array(string, '5');
+addThis();
+
+
+/*
+ * Let's take all 7 sections above and make each quantifer non-greedy.
+ *
+ * This is done by appending ? to it. It doesn't change the meaning of
+ * the quantifier, but makes it non-greedy, which affects the results -
+ */
+status = inSection(8);
+string = '12 3 45';
+pattern = /(\d|\d\s){2,}?/;
+actualmatch = string.match(pattern);
+expectedmatch = Array('12', '2');
+addThis();
+
+status = inSection(9);
+string = '12 3 45';
+pattern = /(\d|\d\s){4,}?/;
+actualmatch = string.match(pattern);
+expectedmatch = Array('12 3 4', '4');
+addThis();
+
+status = inSection(10);
+string = '12 3 45';
+pattern = /(\d|\d\s)+?/;
+actualmatch = string.match(pattern);
+expectedmatch = Array('1', '1');
+addThis();
+
+status = inSection(11);
+string = '12 3 45';
+pattern = /(\d\s?){4,}?/;
+actualmatch = string.match(pattern);
+expectedmatch = Array('12 3 4', '4');
+addThis();
+
+status = inSection(12);
+string = '12 3 45';
+pattern = /(\d\s|\d){2,}?/;
+actualmatch = string.match(pattern);
+expectedmatch = Array('12 ', '2 ');
+addThis();
+
+status = inSection(13);
+string = '12 3 45';
+pattern = /(\d\s|\d){4,}?/;
+actualmatch = string.match(pattern);
+expectedmatch = Array('12 3 4', '4');
+addThis();
+
+status = inSection(14);
+string = '12 3 45';
+pattern = /(\d\s|\d)+?/;
+actualmatch = string.match(pattern);
+expectedmatch = Array('1', '1');
+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/qml/parserstress/tests/ecma_3/RegExp/regress-202564.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-202564.js
new file mode 100644
index 0000000000..e0ae0f9948
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-202564.js
@@ -0,0 +1,101 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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):
+ * drbrain-bugzilla@segment7.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: 18 April 2003
+ * SUMMARY: Testing regexp with many backreferences
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=202564
+ *
+ * Note that in Section 1 below, we expect the 1st and 4th backreferences
+ * to hold |undefined| instead of the empty strings one gets in Perl and IE6.
+ * This is because per ECMA, regexp backreferences must hold |undefined|
+ * if not used. See http://bugzilla.mozilla.org/show_bug.cgi?id=123437.
+ *
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-202564.js';
+var i = 0;
+var BUGNUMBER = 202564;
+var summary = 'Testing regexp with many backreferences';
+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 = 'Seattle, WA to Buckley, WA';
+pattern = /(?:(.+), )?(.+), (..) to (?:(.+), )?(.+), (..)/;
+actualmatch = string.match(pattern);
+expectedmatch = Array(string, undefined, "Seattle", "WA", undefined, "Buckley", "WA");
+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/qml/parserstress/tests/ecma_3/RegExp/regress-209067.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-209067.js
new file mode 100644
index 0000000000..98b4029ce4
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-209067.js
@@ -0,0 +1,1106 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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):
+ * 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 June 2003
+ * SUMMARY: Testing complicated str.replace()
+ *
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=209067
+ *
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-209067.js';
+var UBound = 0;
+var BUGNUMBER = 209067;
+var summary = 'Testing complicated str.replace()';
+var status = '';
+var statusitems = [];
+var actual = '';
+var actualvalues = [];
+var expect= '';
+var expectedvalues = [];
+
+
+function formatHTML(h)
+{
+ // a replace function used in the succeeding lines -
+ function S(s)
+ {
+ return s.replace(/</g,'&lt;').replace(/>/g,'&gt;');
+ }
+
+ h+='\n';
+ h=h.replace(/&([^\s]+;)/g,'&lt;&amp;$1&gt;');
+ h=h.replace(new RegExp('<!-'+'-[\\s\\S]*-'+'->','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'<span class=doctype>&lt;' + p + '&gt;</span>';
+
+ p=p.replace(/\\'/g,'\\&#39;').replace(/\\"/g,'\\&#34;').replace(/^\s/,'');
+p=p.replace(/(\s)([^<]+)$/g,
+ function(s,p1,p2)
+ {
+ p2=p2.replace(/(=)(\s*[^"'][^\s]*)(\s|$)/g,'$1<span class=attribute-value>$2</span>$3');
+ p2=p2.replace(/("[^"]*")/g,'<span class=attribute-value>$1</span>');
+ p2=p2.replace(/('[^']*')/g,'<span class=attribute-value>$1</span>');
+ return p1 + '<span class=attribute-name>'+p2+'</span>';
+ }
+ )
+
+ return'&lt;<span class=' + (s.match(/<\s*\//)?'end-tag':'start-tag') + '>' + p + '</span>&gt;';
+ }
+ )
+
+
+ h=h.replace(/&lt;(&[^\s]+;)&gt;/g,'<span class=entity>$1</span>');
+ h=h.replace(/(&lt;!--[\s\S]*--&gt;)/g,'<span class=comment>$1</span>');
+
+
+ numer=1;
+ h=h.replace(/(.*\n)/g,
+ function(s,p)
+ {
+ return (numer++) +'. ' + p;
+ }
+ )
+
+
+ return'<span class=text>' + h + '</span>';
+}
+
+
+
+/*
+ * sanity check
+ */
+status = inSection(1);
+actual = formatHTML('abc');
+expect = '<span class=text>1. abc\n</span>';
+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<UBound; i++)
+ {
+ reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
+ }
+
+ exitFunc ('test');
+}
+
+
+function hugeString()
+{
+var s = '';
+
+s += '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">';
+s += '<html lang="en">';
+s += '<head>';
+s += ' <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">';
+s += ' <meta http-equiv="refresh" content="1800">';
+s += ' <title>CNN.com</title>';
+s += ' <link rel="Start" href="/">';
+s += ' <link rel="Search" href="/search/">';
+s += ' <link rel="stylesheet" href="http://i.cnn.net/cnn/.element/ssi/css/1.0/main.css" type="text/css">';
+s += ' <script language="JavaScript1.2" src="http://i.cnn.net/cnn/.element/ssi/js/1.0/main.js" type="text/javascript"></script>';
+s += '<script language="JavaScript1.1" src="http://ar.atwola.com/file/adsWrapper.js"></script>';
+s += '<style type="text/css">';
+s += '<!--';
+s += '.aoltextad { text-align: justify; font-size: 12px; color: black; font-family: Georgia, sans-serif }';
+s += '-->';
+s += '</style>';
+s += '<script language="JavaScript1.1" type="text/javascript" src="http://ar.atwola.com/file/adsPopup2.js"></script>';
+s += '<script language="JavaScript">';
+s += 'document.adoffset = 0;';
+s += 'document.adPopupDomain = "www.cnn.com";';
+s += 'document.adPopupFile = "/cnn_adspaces/adsPopup2.html";';
+s += 'document.adPopupInterval = "P24";';
+s += 'document.adPopunderInterval = "P24";';
+s += 'adSetOther("&TVAR="+escape("class=us.low"));';
+s += '</script>';
+s += '';
+s += ' ';
+s += '</head>';
+s += '<body class="cnnMainPage">';
+s += '';
+s += '';
+s += '';
+s += '<a name="top_of_page"></a>';
+s += '<a href="#ContentArea"><img src="http://i.cnn.net/cnn/images/1.gif" alt="Click here to skip to main content." width="10" height="1" border="0" align="right"></a>';
+s += '<table width="770" border="0" cellpadding="0" cellspacing="0" style="speak: none">';
+s += ' <col width="229">';
+s += ' <col width="73">';
+s += ' <col width="468">';
+s += ' <tr>';
+s += ' <td colspan="3"><!--';
+s += '[[!~~ netscape hat ~~]][[table border="0" cellpadding="0" cellspacing="0" width="100%"]][[tr]][[td]][[script Language="Javascript" SRC="http://toolbar.aol.com/dashboard.twhat?dom=cnn" type="text/javascript"]][[/script]][[/td]][[/tr]][[/table]]';
+s += '';
+s += '[[div]][[img src="http://i.cnn.net/cnn/images/1.gif" alt="" width="1" height="2" border="0"]][[/div]]';
+s += '-->';
+s += ' </td>';
+s += ' </tr>';
+s += ' <tr valign="bottom">';
+s += ' <td width="229" style="speak: normal"><img src="http://i.a.cnn.net/cnn/.element/img/1.0/logo/cnn.gif" alt="CNN.com" width="229" height="52" border="0"></td>';
+s += ' <td width="73"></td>';
+s += ' <td width="468" align="right">';
+s += ' <!-- home/bottom.468x60 -->';
+s += '<script language="JavaScript1.1">';
+s += '<!--';
+s += 'adSetTarget("_top");';
+s += 'htmlAdWH( (new Array(93103287,93103287,93103300,93103300))[document.adoffset||0] , 468, 60);';
+s += '//-->';
+ s += '</script>';
+ s += '<noscript><a href="http://ar.atwola.com/link/93103287/aol" target="_top"><img src="http://ar.atwola.com/image/93103287/aol" alt="Click Here" width="468" height="60" border="0"></a></noscript> ';
+ s += '';
+ s += '';
+ s += '';
+ s += '';
+ s += ' </td>';
+ s += ' </tr>';
+ s += ' <tr><td colspan="3"><img src="http://i.cnn.net/cnn/images/1.gif" alt="" width="1" height="2"></td></tr>';
+ s += ' <tr>';
+ s += ' <td colspan="3">';
+ s += '</td>';
+ s += ' </tr>';
+ s += ' <tr><td colspan="3" bgcolor="#CC0000"><img src="http://i.cnn.net/cnn/images/1.gif" alt="" width="1" height="3"></td></tr>';
+ s += ' <tr>';
+ s += ' <td colspan="3">';
+ s += '';
+ s += '<table width="770" border="0" cellpadding="0" cellspacing="0">';
+ s += ' <form action="http://search.cnn.com/cnn/search" method="get" onsubmit="return CNN_validateSearchForm(this);">';
+ s += '<input type="hidden" name="source" value="cnn">';
+ s += '<input type="hidden" name="invocationType" value="search/top">';
+ s += ' <tr><td colspan="4"><img src="http://i.cnn.net/cnn/images/1.gif" alt="" width="1" height="1" border="0"></td></tr>';
+ s += ' <tr><td colspan="4" bgcolor="#003366"><img src="http://i.cnn.net/cnn/images/1.gif" alt="" width="1" height="3" border="0"></td></tr>';
+ s += ' <tr>';
+ s += ' <td rowspan="2"><img src="http://i.a.cnn.net/cnn/.element/img/1.0/searchbar/bar.search.gif" alt="SEARCH" width="110" height="27" border="0"></td>';
+ s += ' <td colspan="2"><img src="http://i.a.cnn.net/cnn/.element/img/1.0/searchbar/bar.top.bevel.gif" alt="" width="653" height="3" border="0"></td>';
+ s += ' <td rowspan="2"><img src="http://i.a.cnn.net/cnn/.element/img/1.0/searchbar/bar.right.bevel.gif" alt="" width="7" height="27" border="0"></td>';
+ s += ' </tr>';
+ s += ' <tr bgcolor="#B6D8E0">';
+ s += ' <td><table border="0" cellpadding="0" cellspacing="0">';
+ s += ' <tr>';
+ s += ' <td>&nbsp;&nbsp;</td>';
+ s += ' <td nowrap><span class="cnnFormTextB" style="color:#369">The Web</span></td>';
+ s += ' <td><input type="radio" name="sites" value="google" checked></td>';
+ s += ' <td>&nbsp;&nbsp;</td>';
+ s += ' <td><span class="cnnFormTextB" style="color:#369;">CNN.com</span></td>';
+ s += ' <td><input type="radio" name="sites" value="cnn"></td>';
+ s += ' <td>&nbsp;&nbsp;</td>';
+ s += ' <td><input type="text" name="query" class="cnnFormText" value="" title="Enter text to search for and click Search" size="35" maxlength="40" style="width: 280px"></td>';
+ s += ' <td>&nbsp;<input type="Submit" value="Search" class="cnnNavButton" style="padding: 0px; margin: 0px; width: 50px"></td>';
+ s += ' </tr>';
+ s += ' </table></td>';
+ s += ' <td align="right"><img src="http://i.a.cnn.net/cnn/.element/img/1.0/searchbar/bar.google.gif" alt="enhanced by Google" width="137" height="24" border="0"></td>';
+ s += ' </tr>';
+ s += ' <tr><td colspan="4"><img src="http://i.a.cnn.net/cnn/.element/img/1.0/searchbar/bar.bottom.bevel.gif" alt="" width="770" height="3" border="0"></td></tr>';
+ s += ' </form>';
+ s += '</table>';
+ s += ' </td>';
+ s += ' </tr>';
+ s += '';
+ s += '';
+ s += '</table>';
+ s += '';
+ s += '<table width="770" border="0" cellpadding="0" cellspacing="0">';
+ s += ' <col width="126" align="left" valign="top">';
+ s += ' <col width="10">';
+ s += ' <col width="280">';
+ s += ' <col width="10">';
+ s += ' <col width="344">';
+ s += ' <tr valign="top">';
+ s += ' <td rowspan="5" width="126" style="speak: none"><table id="cnnNavBar" width="126" bgcolor="#EEEEEE" border="0" cellpadding="0" cellspacing="0" summary="CNN.com Navigation">';
+ s += ' <col width="8" align="left" valign="top">';
+ s += ' <col width="118" align="left" valign="top">';
+ s += ' <tr bgcolor="#CCCCCC" class="cnnNavHiliteRow"><td width="8" class="swath">&nbsp;</td>';
+ s += ' <td class="cnnNavHilite" onClick="CNN_goTo("/")"><div class="cnnNavText"><a href="/">Home Page</a></div></td></tr>';
+ s += ' <tr class="cnnNavRow"><td class="swath">&nbsp;</td>';
+ s += ' <td class="cnnNav" onMouseOver="CNN_navBar(this,1,1)" onMouseOut="CNN_navBar(this,0,1)" onClick="CNN_navBarClick(this,1,"/WORLD/")"><div class="cnnNavText"><a href="/WORLD/">World</a></div></td></tr>';
+ s += ' <tr class="cnnNavRow"><td class="swath">&nbsp;</td>';
+ s += ' <td class="cnnNav" onMouseOver="CNN_navBar(this,1,1)" onMouseOut="CNN_navBar(this,0,1)" onClick="CNN_navBarClick(this,1,"/US/")"><div class="cnnNavText"><a href="/US/">U.S.</a></div></td></tr>';
+ s += ' <tr class="cnnNavRow"><td class="swath">&nbsp;</td>';
+ s += ' <td class="cnnNav" onMouseOver="CNN_navBar(this,1,1)" onMouseOut="CNN_navBar(this,0,1)" onClick="CNN_navBarClick(this,1,"/WEATHER/")"><div class="cnnNavText"><a href="/WEATHER/">Weather</a></div></td></tr>';
+ s += ' <tr class="cnnNavRow"><td class="swath">&nbsp;</td>';
+ s += ' <td class="cnnNav" onMouseOver="CNN_navBar(this,1,1)" onMouseOut="CNN_navBar(this,0,1)" onClick="CNN_navBarClick(this,1,"/money/")"><div class="cnnNavText"><a href="/money/">Business</a>&nbsp;<a href="/money/"><img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/nav_at_money.gif" alt="at CNN/Money" width="51" height="5" border="0"></a></div></td></tr>';
+ s += ' <tr class="cnnNavRow"><td class="swath">&nbsp;</td>';
+ s += ' <td class="cnnNav" onMouseOver="CNN_navBar(this,1,1)" onMouseOut="CNN_navBar(this,0,1)" onClick="CNN_navBarClick(this,1,"/cnnsi/")"><div class="cnnNavText"><a href="/si/">Sports</a>&nbsp;<a href="/si/"><img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/nav_at_si.gif" alt="at SI.com" width="50" height="5" border="0"></a></div></td></tr>';
+ s += ' <tr class="cnnNavRow"><td class="swath">&nbsp;</td>';
+ s += ' <td class="cnnNav" onMouseOver="CNN_navBar(this,1,1)" onMouseOut="CNN_navBar(this,0,1)" onClick="CNN_navBarClick(this,1,"/ALLPOLITICS/")"><div class="cnnNavText"><a href="/ALLPOLITICS/">Politics</a></div></td></tr>';
+ s += ' <tr class="cnnNavRow"><td class="swath">&nbsp;</td>';
+ s += ' <td class="cnnNav" onMouseOver="CNN_navBar(this,1,1)" onMouseOut="CNN_navBar(this,0,1)" onClick="CNN_navBarClick(this,1,"/LAW/")"><div class="cnnNavText"><a href="/LAW/">Law</a></div></td></tr>';
+ s += ' <tr class="cnnNavRow"><td class="swath">&nbsp;</td>';
+ s += ' <td class="cnnNav" onMouseOver="CNN_navBar(this,1,1)" onMouseOut="CNN_navBar(this,0,1)" onClick="CNN_navBarClick(this,1,"/TECH/")"><div class="cnnNavText"><a href="/TECH/">Technology</a></div></td></tr>';
+ s += ' <tr class="cnnNavRow"><td class="swath">&nbsp;</td>';
+ s += ' <td class="cnnNav" onMouseOver="CNN_navBar(this,1,1)" onMouseOut="CNN_navBar(this,0,1)" onClick="CNN_navBarClick(this,1,"/TECH/space/")"><div class="cnnNavText"><a href="/TECH/space/">Science &amp; Space</a></div></td></tr>';
+ s += ' <tr class="cnnNavRow"><td class="swath">&nbsp;</td>';
+ s += ' <td class="cnnNav" onMouseOver="CNN_navBar(this,1,1)" onMouseOut="CNN_navBar(this,0,1)" onClick="CNN_navBarClick(this,1,"/HEALTH/")"><div class="cnnNavText"><a href="/HEALTH/">Health</a></div></td></tr>';
+ s += ' <tr class="cnnNavRow"><td class="swath">&nbsp;</td>';
+ s += ' <td class="cnnNav" onMouseOver="CNN_navBar(this,1,1)" onMouseOut="CNN_navBar(this,0,1)" onClick="CNN_navBarClick(this,1,"/SHOWBIZ/")"><div class="cnnNavText"><a href="/SHOWBIZ/">Entertainment</a></div></td></tr>';
+ s += ' <tr class="cnnNavRow"><td class="swath">&nbsp;</td>';
+ s += ' <td class="cnnNav" onMouseOver="CNN_navBar(this,1,1)" onMouseOut="CNN_navBar(this,0,1)" onClick="CNN_navBarClick(this,1,"/TRAVEL/")"><div class="cnnNavText"><a href="/TRAVEL/">Travel</a></div></td></tr>';
+ s += ' <tr class="cnnNavRow"><td class="swath">&nbsp;</td>';
+ s += ' <td class="cnnNav" onMouseOver="CNN_navBar(this,1,1)" onMouseOut="CNN_navBar(this,0,1)" onClick="CNN_navBarClick(this,1,"/EDUCATION/")"><div class="cnnNavText"><a href="/EDUCATION/">Education</a></div></td></tr>';
+ s += ' <tr class="cnnNavRow"><td class="swath">&nbsp;</td>';
+ s += ' <td class="cnnNav" onMouseOver="CNN_navBar(this,1,1)" onMouseOut="CNN_navBar(this,0,1)" onClick="CNN_navBarClick(this,1,"/SPECIALS/")"><div class="cnnNavText"><a href="/SPECIALS/">Special Reports</a></div></td></tr>';
+ s += ' <tr bgcolor="#FFFFFF"><td class="cnnNavAd" colspan="2" align="center"><!-- home/left.120x90 -->';
+ s += '<script language="JavaScript1.1">';
+ s += '<!--';
+ s += 'adSetTarget("_top");';
+ s += 'htmlAdWH( (new Array(93166917,93166917,93170132,93170132))[document.adoffset||0] , 120, 90);';
+ s += '//-->';
+ s += '</script><noscript><a href="http://ar.atwola.com/link/93166917/aol" target="_top"><img src="http://ar.atwola.com/image/93166917/aol" alt="Click here for our advertiser" width="120" height="90" border="0"></a></noscript></td></tr>';
+ s += ' <tr bgcolor="#999999" class="cnnNavGroupRow">';
+ s += ' <td colspan="2" class="cnnNavGroup"><div class="cnnNavText">SERVICES</div></td></tr>';
+ s += ' <tr class="cnnNavOtherRow"><td class="swath">&nbsp;</td>';
+ s += ' <td class="cnnNavOther" onMouseOver="CNN_navBar(this,1,0)" onMouseOut="CNN_navBar(this,0,0)" onClick="CNN_navBarClick(this,0,"/video/")"><div class="cnnNavText"><a href="/video/">Video</a></div></td></tr>';
+ s += ' <tr class="cnnNavOtherRow"><td class="swath">&nbsp;</td>';
+ s += ' <td class="cnnNavOther" onMouseOver="CNN_navBar(this,1,0)" onMouseOut="CNN_navBar(this,0,0)" onClick="CNN_navBarClick(this,0,"/EMAIL/")"><div class="cnnNavText"><a href="/EMAIL/">E-Mail Services</a></div></td></tr>';
+ s += ' <tr class="cnnNavOtherRow"><td class="swath">&nbsp;</td>';
+ s += ' <td class="cnnNavOther" onMouseOver="CNN_navBar(this,1,0)" onMouseOut="CNN_navBar(this,0,0)" onClick="CNN_navBarClick(this,0,"/mobile/CNNtoGO/")"><div class="cnnNavText"><a href="/mobile/CNNtoGO/">CNN To Go</a></div></td></tr>';
+ s += ' <tr bgcolor="#999999" class="cnnNavGroupRow">';
+ s += ' <td colspan="2" class="cnnNavGroup" style="background-color: #445B60"><div class="cnnNavText" style="color: #fff">SEARCH</div></td></tr>';
+ s += ' <tr bgcolor="#CCCCCC"><td colspan="2" class="cnnNavSearch" style="background-color:#B6D8E0">';
+ s += '';
+ s += '<form action="http://search.cnn.com/cnn/search" method="get" name="nav_bottom_search" onSubmit="return CNN_validateSearchForm(this)" style="margin: 0px;">';
+ s += ' <input type="hidden" name="sites" value="cnn">';
+ s += ' <input type="hidden" name="source" value="cnn">';
+ s += ' <input type="hidden" name="invocationType" value="side/bottom">';
+ s += '<table width="100%" border="0" cellpadding="0" cellspacing="4">';
+ s += ' <tr><td colspan="2"><table width="100%" border="0" cellpadding="0" cellspacing="0">';
+ s += ' <tr>';
+ s += ' <td align="left"><span class="cnnFormTextB" style="color: #369">Web</span></td>';
+ s += ' <td><input type="radio" name="sites" value="google" checked></td>';
+ s += ' <td align="right"><span class="cnnFormTextB" style="color: #369">CNN.com</span></td>';
+ s += ' <td><input type="radio" name="sites" value="cnn"></td>';
+ s += ' </tr>';
+ s += ' </table></td></tr>';
+ s += ' <tr><td colspan="2"><input type="text" name="query" class="cnnFormText" value="" title="Enter text to search for and click Search" size="7" maxlength="40" style="width: 100%"></td></tr>';
+ s += ' <tr valign="top">';
+ s += ' <td><input type="submit" value="Search" class="cnnNavButton" style="padding: 0px; margin: 0px; width: 50px"></td>';
+ s += ' <td align="right"><img src="http://i.a.cnn.net/cnn/.element/img/1.0/sect/SEARCH/nav.search.gif" alt="enhanced by Google" width="54" height="27"></td>';
+ s += ' </tr>';
+ s += '</table>';
+ s += '';
+ s += '';
+ s += '';
+ s += '</td></form></tr>';
+ s += '</table>';
+ s += '';
+ s += ' </td>';
+ s += ' <td rowspan="5" width="10"><a name="ContentArea"></a><img id="accessibilityPixel" src="http://i.cnn.net/cnn/images/1.gif" alt="" width="1" height="7" border="0"></td>';
+ s += ' <td colspan="3" valign="middle">';
+ s += ' <table border="0" cellpadding="0" cellspacing="0" width="100%">';
+ s += ' <tr>';
+ s += ' <td valign="top" nowrap><div class="cnnFinePrint" style="color: #333;padding:6px;padding-left:0px;">Updated: 05:53 p.m. EDT (2153 GMT) June 12, 2003</div></td>';
+ s += ' <td align="right" nowrap class="cnnt1link"><a href="http://edition.cnn.com/">Visit International Edition</a>&nbsp;</td>';
+ s += ' </tr><!--include virtual="/.element/ssi/sect/MAIN/1.0/banner.html"-->';
+ s += ' </table>';
+ s += ' </td>';
+ s += ' </tr>';
+ s += ' <tr valign="top">';
+ s += ' <td rowspan="2" width="280" bgcolor="#EAEFF4">';
+ s += '';
+ s += '<!-- T1 -->';
+ s += ' ';
+ s += ' <a href="/2003/SHOWBIZ/Movies/06/12/obit.peck/index.html"><img src="http://i.cnn.net/cnn/2003/SHOWBIZ/Movies/06/12/obit.peck/top.peck.obit.jpg" alt="Oscar-winner Peck dies" width="280" height="210" border="0" hspace="0" vspace="0"></a>';
+ s += '';
+ s += ' <div class="cnnMainT1">';
+ s += ' <h2 style="font-size:20px;"><a href="/2003/SHOWBIZ/Movies/06/12/obit.peck/index.html">Oscar-winner Peck dies</a></h2>';
+ s += '<p>';
+ s += 'Actor Gregory Peck, who won an Oscar for his portrayal of upstanding lawyer Atticus Finch in 1962s "To Kill a Mockingbird," has died at age 87. Peck was best known for roles of dignified statesmen and people who followed a strong code of ethics. But he also could play against type. All told, Peck was nominated for five Academy Awards.';
+ s += '</p>';
+ s += ' <p>';
+ s += ' <b><a href="/2003/SHOWBIZ/Movies/06/12/obit.peck/index.html" class="cnnt1link">FULL STORY</a></b>';
+ s += ' </p>';
+ s += '';
+ s += '';
+ s += '';
+ s += '&#8226; <span class="cnnBodyText" style="font-weight:bold;color:#333;">Video: </span><img src="http://i.cnn.net/cnn/.element/img/1.0/misc/premium.gif" alt="premium content" width="9" height="11" hspace="0" vspace="0" border="0" align="absmiddle"> <a href="javascript:LaunchVideo("/showbiz/2003/06/12/peck.obit.affl.","300k");">A leading mans leading man</a><br>';
+ s += '';
+ s += '';
+ s += '';
+ s += ' ';
+ s += '&#8226; <span class="cnnBodyText" style="font-weight:bold;color:#333">Interactive: </span> <a href="javascript:CNN_openPopup("/interactive/entertainment/0306/peck.obit/frameset.exclude.html","620x430","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=620,height=430")">Gregory Peck through the years</a><br>';
+ s += '';
+ s += ' ';
+ s += '&#8226; <a href="http://www.cnn.com/2003/SHOWBIZ/Movies/06/12/peck.filmography/index.html" target="new">Gregory Peck filmography</a><img src="http://i.cnn.net/cnn/.element/img/1.0/misc/icon.external.links.gif" alt="external link" width="20" height="13" vspace="1" hspace="4" border="0" align="top"><br>';
+ s += '';
+ s += ' ';
+ s += '&#8226; <a href="http://www.cnn.com/2003/SHOWBIZ/Movies/06/04/heroes.villains.ap/index.html" target="new">Pecks Finch chararcter AFIs top hero</a><img src="http://i.cnn.net/cnn/.element/img/1.0/misc/icon.external.links.gif" alt="external link" width="20" height="13" vspace="1" hspace="4" border="0" align="top"><br>';
+ s += ' </div>';
+ s += '';
+ s += '<!-- /T1 -->';
+ s += ' </td>';
+ s += ' ';
+ s += ' <td rowspan="2" width="10"><img src="http://i.cnn.net/cnn/images/1.gif" alt="" width="10" height="1"></td>';
+ s += ' <td width="344">';
+ s += '';
+ s += '';
+ s += '';
+ s += '';
+ s += '<!-- T2 -->';
+ s += '';
+ s += '<div><img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/px_c00.gif" alt="" width="344" height="2"></div>';
+ s += '<table width="344" border="0" cellpadding="0" cellspacing="0">';
+ s += ' <tr>';
+ s += ' <td width="285" class="cnnTabbedBoxHeader" style="padding-left:0px;"><span class="cnnBigPrint"><b>MORE TOP STORIES</b></span></td>';
+ s += ' <td width="59" class="cnnTabbedBoxTab" align="right" bgcolor="#336699"><a href="/userpicks"><img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/userpicks.gif" alt=" Hot Stories " width="59" height="11" border="0"></a></td>';
+ s += ' </tr>';
+ s += '</table>';
+ s += '<div style="padding:6px;padding-left:0px;">';
+ s += '';
+ s += ' ';
+ s += '<div class="cnnMainNewT2">&#8226; <a href="/2003/WORLD/meast/06/12/mideast/index.html">7 dead in new Gaza strike</a>';
+ s += '| <img src="http://i.cnn.net/cnn/.element/img/1.0/misc/premium.gif" alt="premium content" width="9" height="11" hspace="0" vspace="0" border="0" align="absmiddle"> <a href="javascript:LaunchVideo("/world/2003/06/11/cb.bush.roadmap.ap.","300k");">Video</a><br></div>';
+ s += '';
+ s += ' ';
+ s += '<div class="cnnMainNewT2">&#8226; <a href="/2003/WORLD/meast/06/12/sprj.irq.main/index.html">U.S. helicopter, jet down in Iraqi raid</a>';
+ s += '| <img src="http://i.cnn.net/cnn/.element/img/1.0/misc/premium.gif" alt="premium content" width="9" height="11" hspace="0" vspace="0" border="0" align="absmiddle"> <a href="javascript:LaunchVideo("/iraq/2003/06/11/bw.iraq.oil.cnn.","300k");">Video</a><br></div>';
+ s += '';
+ s += ' ';
+ s += '<div class="cnnMainNewT2">&#8226; <a href="/2003/SHOWBIZ/TV/06/12/obit.brinkley/index.html">Television icon David Brinkley dead at 82</a><br></div>';
+ s += '';
+ s += ' ';
+ s += '<div class="cnnMainNewT2">&#8226; <a href="/2003/LAW/06/12/peterson.case/index.html">Peterson search warrants will be made public in July</a><br></div>';
+ s += '';
+ s += ' ';
+ s += '<div class="cnnMainNewT2">&#8226; <a href="/2003/WORLD/asiapcf/east/06/12/okinawa.rape/index.html">U.S. Marine held in new Okinawa rape case</a><br></div>';
+ s += '';
+ s += ' ';
+ s += '<div class="cnnMainNewT2">&#8226; <a href="/2003/TECH/space/06/12/sprj.colu.bolts.ap/index.html">New threat discovered for shuttle launches</a><br></div>';
+ s += '';
+ s += ' ';
+ s += '<div class="cnnMainNewT2">&#8226; <a href="/2003/SHOWBIZ/TV/06/12/television.sopranos.reut/index.html">"Soprano" Gandolfini shares his wealth with castmates</a><br></div>';
+ s += '<!--[[div class="cnnMainNewT2"]]&#8226;&nbsp;[[b]][[span style="color:#C00;"]]CNN[[/span]]Radio:[[/b]]&nbsp;[[a href="javascript:CNN_openPopup("/audio/radio/preferences.html","radioplayer","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=200,height=124")"]]Bush on Medicare[[/a]]&nbsp;[[a href="javascript:CNN_openPopup("/audio/radio/preferences.html","radioplayer","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=200,height=124")"]][[img src="http://i.a.cnn.net/cnn/.element/img/1.0/misc/live.video.gif" alt="" width="61" height="14" vspace="0" hspace="2" align="absmiddle" border="0"]][[/a]][[img src="http://i.a.cnn.net/cnn/.element/img/1.0/misc/audio.gif" alt="" width="10" height="10" vspace="0" hspace="2" align="absmiddle"]][[br]][[/div]]--></div>';
+ s += '';
+ s += '<!-- /T2 -->';
+ s += '<div><img src="http://i.cnn.net/cnn/images/1.gif" alt="" width="1" height="10"></div>';
+ s += '';
+ s += '<!--include virtual="/.element/ssi/misc/1.0/war.zone.smmap.txt"-->';
+ s += '<!-- =========== CNN Radio/Video Box =========== -->';
+ s += '<!-- top line --> ';
+ s += '<div><img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/px_ccc.gif" alt="" width="344" height="1"></div>';
+ s += '<!-- /top line -->';
+ s += ' <table width="344" border="0" cellpadding="0" cellspacing="0">';
+ s += ' <tr valign="top">';
+ s += '<!-- left-side line --> ';
+ s += ' <td bgcolor="#CCCCCC" width="1"><img src="http://i.cnn.net/cnn/images/1.gif" alt="" width="1" height="30" hspace="0" vspace="0" border="0"></td>';
+ s += '<!-- /left-side line --> ';
+ s += '<!-- CNNRadio cell -->';
+ s += ' <td width="114"><div class="cnn6pxPad">';
+ s += ' <span class="cnnBigPrint" style="color:#C00;font-weight:bold;">CNN</span><span class="cnnBigPrint" style="color:#000;font-weight:bold;">RADIO</span>';
+ s += '<div class="cnnMainNewT2"><a href="javascript:CNN_openPopup("/audio/radio/preferences.html","radioplayer","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=200,height=124")">Listen to latest updates</a><img src="http://i.a.cnn.net/cnn/.element/img/1.0/misc/audio.gif" alt="" width="10" height="10" vspace="0" hspace="2" align="absmiddle">';
+ s += '<div><img src="http://i.a.cnn.net/cnn/images/1.gif" alt="" width="1" height="5" hspace="0" vspace="0"></div>';
+ s += '<!--';
+ s += '[[span class="cnnFinePrint"]]sponsored by:[[/span]][[br]][[center]]';
+ s += '[[!~~#include virtual="/cnn_adspaces/home/war_in_iraq/sponsor.88x31.ad"~~]]';
+ s += ' [[/center]]';
+ s += '-->';
+ s += ' </div></td>';
+ s += '<!-- /CNNRadio cell --> ';
+ s += '<!-- center line --> ';
+ s += ' <td bgcolor="#CCCCCC" width="1"><img src="http://i.cnn.net/cnn/images/1.gif" alt="" width="1" height="1" hspace="0" vspace="0" border="0"></td>';
+ s += '<!-- /center line --> ';
+ s += '<!-- video cell --> ';
+ s += ' <td width="227"><div class="cnn6pxPad">';
+ s += '<!-- video box --> ';
+ s += '<table width="215" border="0" cellpadding="0" cellspacing="0">';
+ s += ' <tr valign="top">';
+ s += ' <td width="144"><span class="cnnBigPrint" style="font-weight:bold;">VIDEO</span></td>';
+ s += ' <td width="6"><img src="http://i.a.cnn.net/cnn/images/1.gif" alt="" width="6" height="1" hspace="0" vspace="0"></td>';
+ s += ' <td width="65"><a href="/video/"><img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/more.video.blue.gif" alt="MORE VIDEO" width="62" height="11" hspace="0" vspace="0" border="0"></a></td></tr>';
+ s += ' <tr>';
+ s += ' <td width="215" colspan="3"><img src="http://i.a.cnn.net/cnn/images/1.gif" alt="" width="1" height="2" hspace="0" vspace="0"></td></tr>';
+ s += ' <tr valign="top">';
+ s += ' <td><div class="cnnBodyText">';
+ s += ' Soldier broke dozens of hearts over e-mail<br>';
+ s += ' <img src="http://i.a.cnn.net/cnn/images/icons/premium.gif" align="middle" alt="premium content" width="9" height="11" hspace="0" vspace="1" border="0">&nbsp;<a href="javascript:LaunchVideo("/offbeat/2003/06/12/ms.casanova.col.ap.","300k");" class="cnnVideoLink">PLAY VIDEO</a></div>';
+ s += ' </td>';
+ s += '<td width="3"><img src="http://i.a.cnn.net/cnn/images/1.gif" alt="" width="3" height="1" hspace="0" vspace="0"></td> ';
+ s += ' <td width="65" align="right">';
+ s += ' <a href="javascript:LaunchVideo("/offbeat/2003/06/12/ms.casanova.col.ap.","300k");"><img src="http://i.cnn.net/cnn/video/offbeat/2003/06/12/ms.casanova.col.vs.kndu.jpg" alt="" width="65" height="49" border="0" vspace="2" hspace="0"></a>';
+ s += ' </td></tr>';
+ s += '</table>';
+ s += ' <!-- /video box --> ';
+ s += ' </div></td>';
+ s += '<!-- /video cell --> ';
+ s += '<!-- right-side line --> ';
+ s += '<td bgcolor="#CCCCCC" width="1"><img src="http://i.cnn.net/cnn/images/1.gif" alt="" width="1" height="1" hspace="0" vspace="0" border="0"></td>';
+ s += '<!-- /right-side line --> ';
+ s += ' </tr>';
+ s += ' </table>';
+ s += '';
+ s += '<!-- bottom line -->';
+ s += '<div><img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/px_ccc.gif" alt="" width="344" height="1"></div>';
+ s += '<!-- /bottom line -->';
+ s += '<!-- =========== /CNN Radio/Video Box =========== -->';
+ s += '';
+ s += '<div><img src="http://i.cnn.net/cnn/images/1.gif" alt="" width="1" height="10"></div>';
+ s += '<div><img src="http://i.cnn.net/cnn/.element/img/1.0/main/px_c00.gif" alt="" width="344" height="2"></div>';
+ s += '<table width="344" border="0" cellpadding="0" cellspacing="0">';
+ s += ' <tr>';
+ s += ' <td width="260" class="cnnTabbedBoxHeader" style="padding-left:0px;"><span class="cnnBigPrint"><b>ON THE SCENE</b></span></td>';
+ s += ' <td width="84" class="cnnTabbedBoxTab" align="right" bgcolor="#336699" style="padding: 0px 3px;"><a href="/LAW/"><img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/superlinks/law.gif" alt="more reports" height="11" border="0" hspace="2" vspace="2" align="right"></a></td>';
+ s += ' </tr>';
+ s += '</table>';
+ s += '';
+ s += '<table width="344" border="0" cellpadding="5" cellspacing="0">';
+ s += ' <tr valign="top">';
+ s += ' <td style="padding-left:0px;"> <b>Jeffrey Toobin:</b> "It takes guts" for Peterson defense to subpoena judge over wiretap issue.';
+ s += '<a href="/2003/LAW/06/12/otsc.toobin/index.html">Full Story</a></td>';
+ s += '';
+ s += '<td width="65" align="right" style="padding-left:6px;"><a href="/2003/LAW/06/12/otsc.toobin/index.html"><img src="http://i.cnn.net/cnn/2003/LAW/06/12/otsc.toobin/tz.toobin.jpg" alt="image" width="65" height="49" border="0" hspace="0" vspace="0"></a></td>';
+ s += ' </tr>';
+ s += '</table>';
+ s += '<div><img src="http://i.cnn.net/cnn/images/1.gif" alt="" width="1" height="10"></div>';
+ s += ' </td>';
+ s += ' </tr>';
+ s += ' <tr valign="bottom">';
+ s += ' <td>';
+ s += '<table width="344" border="0" cellpadding="0" cellspacing="0">';
+ s += ' <tr>';
+ s += ' <td width="267" nowrap style="color: #c00; padding-left: 6px"><span class="cnnBigPrint" style="vertical-align: top"><b>BUSINESS</b></span>';
+ s += ' <a href="/money/"><img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/at_cnnmoney.gif" alt=" at CNN/Money " width="100" height="15" border="0"></a></td>';
+ s += ' <td width="77" align="right"><a href="/money/"><img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/business.news.blue.gif" alt=" Business News " width="77" height="11" border="0"></a></td>';
+ s += ' </tr>';
+ s += '</table>';
+ s += '';
+ s += '<table width="344" bgcolor="#EEEEEE" border="0" cellpadding="0" cellspacing="0" style="border: solid 1px #ddd">';
+ s += ' <tr valign="top">';
+ s += ' <td>';
+ s += ' <table width="100%" border="0" cellpadding="0" cellspacing="4">';
+ s += ' <tr>';
+ s += ' <td colspan="3"><span class="cnnMenuText"><b>STOCK/FUND QUOTES: </b></span></td>';
+ s += ' </tr><form action="http://qs.money.cnn.com/tq/stockquote" method="get" style="margin: 0px;">';
+ s += ' <tr>';
+ s += ' <td><span class="cnnFinePrint">enter symbol</span></td>';
+ s += ' <td><input type="text" name="symbols" size="7" maxlength="40" class="cnnMenuText" title="Enter stock/fund symbol or name to get a quote"></td>';
+ s += ' <td><input type="submit" value="GET" class="cnnNavButton"></td>';
+ s += ' </tr></form>';
+ s += ' </table>';
+ s += ' <table width="100%" border="0" cellpadding="0" cellspacing="4">';
+ s += ' <tr valign="top">';
+ s += ' <td><span class="cnnFinePrint">sponsored by:</span></td>';
+ s += ' <td align="right"><!--<a href="/money/news/specials/rebuild_iraq/"><img src="http://i.a.cnn.net/cnn/2003/images/04/17/money.box.gif" ALT="" width="150" height="31" HSPACE="0" VSPACE="0" border="0" align="left"></a>--><a href="http://ar.atwola.com/link/93103306/aol"><img src="http://ar.atwola.com/image/93103306/aol" alt="Click Here" width="88" height="31" border="0" hspace="0" vspace="0"></a></td>';
+ s += ' </tr>';
+ s += ' </table>';
+ s += ' </td>';
+ s += ' <td class="cnnMainMarketBox"> <table width="100%" border="0" cellpadding="4" cellspacing="0" summary="Market data from CNNmoney">';
+ s += ' <tr class="noBottomBorder">';
+ s += ' <td colspan="5"><span class="cnnMainMarketCell"><span class="cnnMenuText"><b><a href="/money/markets/">MARKETS:</a></b></span> <!-- 16:30:15 -->';
+ s += '';
+ s += '4:30pm ET, 6/12</span></td>';
+ s += ' </tr>';
+ s += ' <tr class="noTopBorder">';
+ s += ' <td><span class="cnnMainMarketCell"><a href="/money/markets/dow.html" title="Dow Jones Industrial Average">DJIA</a></span></td>';
+ s += ' <td><img src="http://i.cnn.net/cnn/.element/img/1.0/main/arrow_up.gif" alt="" width="9" height="9"></td>';
+ s += ' <td align="right" nowrap><span class="cnnMainMarketCell">+13.30</span></td>';
+ s += ' <td align="right" nowrap><span class="cnnMainMarketCell">9196.50</span></td>';
+ s += ' <td align="right" nowrap><span class="cnnMainMarketCell">+ 0.14%</span></td>';
+ s += '';
+ s += ' </tr>';
+ s += ' <tr>';
+ s += ' <td><span class="cnnMainMarketCell"><a href="/money/markets/nasdaq.html" title="NASDAQ">NAS</a></span></td>';
+ s += ' <td><img src="http://i.cnn.net/cnn/.element/img/1.0/main/arrow_up.gif" alt="" width="9" height="9"></td>';
+ s += ' <td align="right" nowrap><span class="cnnMainMarketCell">+ 7.60</span></td>';
+ s += ' <td align="right" nowrap><span class="cnnMainMarketCell">1653.62</span></td>';
+ s += ' <td align="right" nowrap><span class="cnnMainMarketCell">+ 0.46%</span></td>';
+ s += '';
+ s += ' </tr>';
+ s += ' <tr class="noBottomBorder">';
+ s += ' <td><span class="cnnMainMarketCell"><a href="/money/markets/sandp.html" title="S&amp;P 500">S&amp;P</a></span></td>';
+ s += ' <td><img src="http://i.cnn.net/cnn/.element/img/1.0/main/arrow_up.gif" alt="" width="9" height="9"></td>';
+ s += ' <td align="right" nowrap><span class="cnnMainMarketCell">+ 1.03</span></td>';
+ s += ' <td align="right" nowrap><span class="cnnMainMarketCell">998.51</span></td>';
+ s += ' <td align="right" nowrap><span class="cnnMainMarketCell">+ 0.10%</span></td>';
+ s += '';
+ s += ' </tr>';
+ s += ' </table>';
+ s += '</td>';
+ s += ' </tr>';
+ s += '</table>';
+ s += '';
+ s += '</td>';
+ s += ' </tr>';
+ s += ' <tr>';
+ s += ' <td colspan="3"><img src="http://i.cnn.net/cnn/images/1.gif" alt="" width="1" height="4"></td>';
+ s += ' </tr>';
+ s += ' <tr align="center" valign="bottom">';
+ s += ' <td width="280" bgcolor="#EEEEEE"><a href="/linkto/ftn.nytimes1.html"><img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/ftn.280x32.ny.times.gif" width="255" height="32" alt="" border="0"></a></td>';
+ s += '<td width="10"><img src="http://i.cnn.net/cnn/images/1.gif" alt="" width="10" height="1"></td>';
+ s += ' <td width="344" bgcolor="#EEEEEE"><a href="/linkto/ftn.bn3.html"><img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/ftn.345x32.breaking.news.gif" width="340" height="32" alt="" border="0"></a></td>';
+ s += ' </tr>';
+ s += '';
+ s += '</table>';
+ s += '';
+ s += '';
+ s += '<div><img src="http://i.cnn.net/cnn/images/1.gif" alt="" width="1" height="10"></div>';
+ s += '';
+ s += '';
+ s += '<table width="770" border="0" cellpadding="0" cellspacing="0">';
+ s += ' <col width="10">';
+ s += ' <col width="483" align="left" valign="top">';
+ s += ' <col width="10">';
+ s += ' <col width="267" align="left" valign="top">';
+ s += ' <tr valign="top">';
+ s += ' <td rowspan="2"><img src="http://i.cnn.net/cnn/images/1.gif" alt="" width="10" height="1"></td>';
+ s += ' <td valign="top">';
+ s += ' <table border="0" cellpadding="0" cellspacing="0">';
+ s += ' <tr valign="top">';
+ s += ' <td width="238">';
+ s += ' <div><img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/px_c00.gif" alt="" width="238" height="2"></div>';
+ s += '';
+ s += '';
+ s += '';
+ s += '';
+ s += '';
+ s += '';
+ s += ' <table width="238" border="0" cellpadding="0" cellspacing="0">';
+ s += ' <tr>';
+ s += ' <td width="132" class="cnnTabbedBoxHeader" style="padding-left:0px;"><span class="cnnBigPrint"><b>MORE REAL TV</b></span></td>';
+ s += ' <td width="106" class="cnnTabbedBoxTab" align="right" bgcolor="#336699" style="padding: 0px 3px;"><a href="/SHOWBIZ"><img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/entertainment.news.gif" alt="More Entertainment" border="0" width="102" height="11" hspace="2" vspace="2" align="right"></a></td>';
+ s += ' </tr>';
+ s += ' </table>';
+ s += ' <div><img src="http://i.cnn.net/cnn/images/1.gif" alt="" width="238" height="5" vspace="0" hspace="0"></div>';
+ s += ' <table width="238" border="0" cellpadding="0" cellspacing="0">';
+ s += ' <tr valign="top">';
+ s += ' <td><div class="cnn6pxTpad">';
+ s += ' ';
+ s += ' <a href="/2003/SHOWBIZ/06/11/eye.ent.voyeurs/index.html">Go ahead, follow me</a><br>';
+ s += 'New reality series and the movie debut of "Idol" finalists';
+ s += ' </div></td>';
+ s += ' <td width="71" align="right"><a href="/2003/SHOWBIZ/06/11/eye.ent.voyeurs/index.html"><img src="http://i.a.cnn.net/cnn/2003/SHOWBIZ/06/11/eye.ent.voyeurs/tz.movies.gif" alt="Go ahead, follow me" width="65" height="49" border="0" vspace="6"></a></td>';
+ s += ' </tr>';
+ s += ' </table>';
+ s += '';
+ s += '';
+ s += '';
+ s += '';
+ s += '';
+ s += '';
+ s += ' ';
+ s += ' <div><img src="http://i.cnn.net/cnn/images/1.gif" alt="" width="238" height="5" vspace="0" hspace="0"></div>';
+ s += '<!--include virtual="/.element/ssi/video/section_teases/topvideos_include.txt"-->';
+ s += ' </td>';
+ s += ' <td><img src="http://i.cnn.net/cnn/images/1.gif" alt="" width="7" height="1"></td>';
+ s += ' <td width="238">';
+ s += ' <div><img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/px_c00.gif" alt="" width="238" height="2"></div>';
+ s += '';
+ s += '';
+ s += '';
+ s += '';
+ s += '';
+ s += '';
+ s += ' <table width="238" border="0" cellpadding="0" cellspacing="0">';
+ s += ' <tr>';
+ s += ' <td width="157" class="cnnTabbedBoxHeader" style="padding-left:0px;"><span class="cnnBigPrint"><b>GIFT IDEAS</b></span></td>';
+ s += ' <td width="81" class="cnnTabbedBoxTab" align="right" bgcolor="#336699" style="padding: 0px 3px;"><a href="/money"><img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/superlinks/business.gif" alt="Business News" border="0" width="77" height="11" hspace="2" vspace="2" align="right"></a></td>';
+ s += ' </tr>';
+ s += ' </table>';
+ s += ' <div><img src="http://i.cnn.net/cnn/images/1.gif" alt="" width="238" height="5" vspace="0" hspace="0"></div>';
+ s += ' <table width="238" border="0" cellpadding="0" cellspacing="0">';
+ s += ' <tr valign="top">';
+ s += ' <td><div class="cnn6pxTpad">';
+ s += '';
+ s += '';
+ s += '<span class="cnnBodyText" style="font-weight:bold;">CNN/Money: </span> <a href="/money/2003/06/12/news/companies/fathers_day/index.htm?cnn=yes">Fathers Day</a><br>';
+ s += 'Smaller is better --from digital cameras to iPod';
+ s += ' </div></td>';
+ s += ' <td width="71" align="right"><a href="/money/2003/06/12/news/companies/fathers_day/index.htm?cnn=yes"><img src="http://i.a.cnn.net/cnn/images/programming.boxes/tz.money.dads.day.watch.jpg" alt="Fathers Day" width="65" height="49" border="0" vspace="6"></a></td>';
+ s += ' </tr>';
+ s += ' </table>';
+ s += ' </td>';
+ s += ' </tr>';
+ s += ' </table>';
+ s += ' <div><img src="http://i.cnn.net/cnn/images/1.gif" alt="" width="238" height="10" vspace="0" hspace="0"></div> ';
+ s += '<table width="483" border="0" cellspacing="0" cellpadding="0">';
+ s += ' <tr valign="top">';
+ s += ' <td rowspan="9"><br></td>';
+ s += ' <td width="238"><a href="/US/"><img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/us.gif" alt="U.S. News: " width="238" height="15" border="0"></a><br><div class="cnnMainSections">';
+ s += '';
+ s += ' ';
+ s += '&#8226;&nbsp;<a href="/2003/US/South/06/11/miami.rapist/index.html">Miami police link 4 rapes to serial rapist</a><br>';
+ s += '';
+ s += ' ';
+ s += '&#8226;&nbsp;<a href="/2003/LAW/06/12/mistaken.identity.ap/index.html">Woman mistaken for fugitive jailed</a><br>';
+ s += '';
+ s += ' ';
+ s += '&#8226;&nbsp;<a href="/2003/US/Northeast/06/12/woman.impaled.ap/index.html">Pregnant woman impaled on mic stand</a><br>';
+ s += ' </div></td>';
+ s += ' <td rowspan="7" width="7"><img src="http://i.cnn.net/cnn/images/1.gif" alt="" width="7" height="1"></td>';
+ s += ' <td width="238"><a href="/WORLD/"><img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/world.gif" alt="World News: " width="238" height="15" border="0"></a><br><div class="cnnMainSections">';
+ s += '';
+ s += ' ';
+ s += '&#8226;&nbsp;<a href="/2003/WORLD/europe/06/12/nato.bases/index.html">NATO reshapes for new era</a><br>';
+ s += '';
+ s += ' ';
+ s += '&#8226;&nbsp;<a href="/2003/WORLD/africa/06/12/congo.democratic/index.html">U.N. reviews Bunia peace force</a><br>';
+ s += '';
+ s += '';
+ s += '';
+ s += '&#8226;&nbsp;<span class="cnnBodyText" style="font-weight:bold;color:#900;">TIME.com: </span><a href="/time/magazine/article/0,9171,1101030616-457361,00.html?CNN=yes" target="new">Saddams curtain trail</a><img src="http://i.cnn.net/cnn/.element/img/1.0/misc/icon.external.links.gif" alt="external link" width="20" height="13" vspace="1" hspace="4" border="0" align="top"><br>';
+ s += ' </div></td>';
+ s += ' </tr><tr valign="top">';
+ s += ' <td width="238"><a href="/TECH/"><img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/technology.gif" alt="Sci-Tech News: " width="238" height="15" border="0"></a><br><div class="cnnMainSections">';
+ s += '';
+ s += ' ';
+ s += '&#8226;&nbsp;<a href="/2003/TECH/ptech/06/11/bus2.ptech.dvd.maker/index.html">Another reason to throw out your VCR</a><br>';
+ s += '';
+ s += ' ';
+ s += '&#8226;&nbsp;<a href="/2003/TECH/ptech/06/12/korea.samsung.reut/index.html">Flat screen TV prices dropping</a><br>';
+ s += ' </div></td>';
+ s += ' <td width="238"><a href="/SHOWBIZ/"><img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/entertainment.gif" alt="Entertainment News: " width="238" height="15" border="0"></a><br><div class="cnnMainSections">';
+ s += '';
+ s += ' ';
+ s += '&#8226;&nbsp;<a href="/2003/SHOWBIZ/TV/06/12/cnn.obrien/index.html">CNN hires Soledad OBrien for "AM"</a><br>';
+ s += '';
+ s += ' ';
+ s += '&#8226;&nbsp;<a href="/2003/SHOWBIZ/TV/06/11/batchelor.troubles.ap/index.html">Dating show star let go by law firm</a><br>';
+ s += ' </div></td>';
+ s += ' </tr><tr valign="top">';
+ s += ' <td width="238"><a href="/ALLPOLITICS/"><img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/politics.gif" alt="Politics News: " width="238" height="15" border="0"></a><br><div class="cnnMainSections">';
+ s += '';
+ s += ' ';
+ s += '&#8226;&nbsp;<a href="/2003/ALLPOLITICS/06/11/schwarzenegger.ap/index.html">Schwarzenegger on California politics</a><br>';
+ s += '';
+ s += ' ';
+ s += '&#8226;&nbsp;<a href="/2003/ALLPOLITICS/06/12/tax.credit.ap/index.html">House approves extension on child tax credit</a><br>';
+ s += ' </div></td>';
+ s += ' <td width="238"><a href="/LAW/"><img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/law.gif" alt="Law News: " width="238" height="15" border="0"></a><br><div class="cnnMainSections">';
+ s += '';
+ s += ' ';
+ s += '&#8226;&nbsp;<a href="/2003/LAW/06/12/plaintiff.advances.ap/index.html">Court bars cash advances to plaintiffs</a><br>';
+ s += '';
+ s += ' ';
+ s += '&#8226;&nbsp;<a href="/2003/LAW/06/11/jackson.lawsuit.ap/index.html">Lawsuit against Jackson settled</a><br>';
+ s += ' </div></td>';
+ s += ' </tr><tr valign="top">';
+ s += ' <td width="238"><a href="/HEALTH/"><img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/health.gif" alt="Health News: " width="238" height="15" border="0"></a><br><div class="cnnMainSections">';
+ s += '';
+ s += ' ';
+ s += '&#8226;&nbsp;<a href="/2003/HEALTH/06/12/monkeypox.ap/index.html">Monkeypox spreading person-to-person?</a><br>';
+ s += '';
+ s += ' ';
+ s += '&#8226;&nbsp;<a href="/2003/HEALTH/06/12/quick.xray.ap/index.html">A full body X-ray in 13 seconds</a><br>';
+ s += ' </div></td>';
+ s += ' <td width="238"><a href="/TECH/space/"><img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/space.gif" alt="Space News: " width="238" height="15" border="0"></a><br><div class="cnnMainSections">';
+ s += '';
+ s += ' ';
+ s += '&#8226;&nbsp;<a href="/2003/TECH/science/06/12/hydrogen.ozone.ap/index.html">Hydrogen fuel may disturb ozone layer</a><br>';
+ s += '';
+ s += ' ';
+ s += '&#8226;&nbsp;<a href="/2003/TECH/space/06/12/sprj.colu.bolts.ap/index.html">New threat found for shuttle launches</a><br>';
+ s += ' </div></td>';
+ s += ' </tr><tr valign="top">';
+ s += ' <td width="238"><a href="/TRAVEL/"><img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/travel.gif" alt="Travel News: " width="238" height="15" border="0"></a><br><div class="cnnMainSections">';
+ s += '';
+ s += ' ';
+ s += '&#8226;&nbsp;<a href="/2003/TRAVEL/DESTINATIONS/06/12/walk.across.america.ap/index.html">Walking America from coast to coast</a><br>';
+ s += '';
+ s += ' ';
+ s += '&#8226;&nbsp;<a href="/2003/TRAVEL/06/11/bi.airlines.executives.reut/index.html">Airline execs not seeing sunny skies yet</a><br>';
+ s += ' </div></td>';
+ s += ' <td width="238"><a href="/EDUCATION/"><img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/education.gif" alt="Education News: " width="238" height="15" border="0"></a><br><div class="cnnMainSections">';
+ s += '';
+ s += ' ';
+ s += '&#8226;&nbsp;<a href="/2003/EDUCATION/06/12/arabs.prom.ap/index.html">Arab students seek prom balance</a><br>';
+ s += '';
+ s += ' ';
+ s += '&#8226;&nbsp;<a href="/2003/EDUCATION/06/11/school.fundraising.ap/index.html">Public schools turn to upscale fundraising</a><br>';
+ s += ' </div></td>';
+ s += ' </tr><tr valign="top">';
+ s += ' <td width="238"><a href="/si/index.html?cnn=yes"><img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/sports.gif" alt="Sports News: " width="238" height="15" border="0"></a><br><div class="cnnMainSections">';
+ s += '';
+ s += '&#8226;&nbsp;<a href="/cnnsi/golfonline/2003/us_open/news/2003/06/12/open_thursday_ap">Woods eyes third U.S. Open title</a><br>';
+ s += '&#8226;&nbsp;<a href="/cnnsi/basketball/news/2003/06/12/jordan_ruling_ap">Judge denies Jordan&#039;s former lover $5M payoff</a><br>';
+ s += ' </div></td>';
+ s += ' <td width="238"><a href="/money/"><img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/business.gif" alt="Business News: " width="238" height="15" border="0"></a><br><div class="cnnMainSections">';
+ s += '&#8226;&nbsp;<a href="/money/2003/06/12/pf/saving/duppies/index.htm">Here come the "Duppies"</a><br>';
+ s += '&#8226;&nbsp;<a href="/money/2003/06/12/technology/oracle/index.htm">Oracle beats estimates</a><br>';
+ s += ' </div></td>';
+ s += ' </tr>';
+ s += '</table>';
+ s += ' </td>';
+ s += ' <td><img src="http://i.cnn.net/cnn/images/1.gif" width="10" hspace="0" vspace="0" alt=""></td>';
+ s += ' <td valign="top">';
+ s += ' <div><img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/px_c00.gif" alt="" width="267" height="2"></div>';
+ s += ' ';
+ s += '<table width="267" border="0" cellpadding="0" cellspacing="0">';
+ s += ' <tr>';
+ s += ' <td width="173" bgcolor="#003366"><div class="cnnBlueBoxHeader"><span class="cnnBigPrint"><b>WATCH CNN TV</b></span></div></td>';
+ s += ' <td width="25" class="cnnBlueBoxHeader" align="right"><img src="http://i.a.cnn.net/cnn/.element/img/1.0/misc/diagonal.gif" width="25" height="19" alt=""></td>';
+ s += ' <td width="69" class="cnnBlueBoxTab" align="right" bgcolor="#336699"><a href="/CNN/Programs/"><img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/tv.schedule.gif" alt="On CNN TV" border="0" width="65" height="11" hspace="2" vspace="2" align="right"></a></td>';
+ s += ' </tr>';
+ s += '</table>';
+ s += '<table width="267" bgcolor="#EEEEEE" border="0" cellpadding="4" cellspacing="0">';
+ s += ' <tr valign="top">';
+ s += ' <td><a href="/CNN/Programs/american.morning/"><img src="http://i.cnn.net/cnn/CNN/Programs/includes/showbox/images/2003/05/tz.hemmer.jpg" alt="American Morning, 7 a.m. ET" width="65" height="49" border="0" align="right"></a><a href="/CNN/Programs/american.morning/"><b>American Morning (7 a.m. ET):</b></a> Tomorrow, singer Carnie Wilson talks about her new book, "Im Still Hungry."';
+ s += ' </td>';
+ s += ' </tr>';
+ s += '</table>';
+ s += '';
+ s += '<!--';
+ s += '[[table width="267" border="0" cellpadding="0" cellspacing="0"]]';
+ s += '[[tr]][[td width="173" bgcolor="#003366"]][[div class="cnnBlueBoxHeader"]][[span class="cnnBigPrint"]][[b]]WATCH CNN TV[[/b]][[/span]][[/div]][[/td]][[td width="25" class="cnnBlueBoxHeader" align="right"]][[img src="http://i.a.cnn.net/cnn/.element/img/1.0/misc/diagonal.gif" width="25" height="19" alt=""]][[/td]][[td width="69" class="cnnBlueBoxTab" align="right" bgcolor="#336699"]][[a href="/CNN/Programs/"]][[img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/tv.schedule.gif" alt="On CNN TV" border="0" width="65" height="11" hspace="2" vspace="2" align="right"]][[/a]][[/td]][[/tr]][[/table]][[table width="267" bgcolor="#EEEEEE" border="0" cellpadding="4" cellspacing="0"]][[tr valign="top"]][[td]]';
+ s += '[[img src="http://i.cnn.net/cnn/2003/images/05/31/tz.bw.jpg" alt="" width="65" height="49" border="0" align="right"]]';
+ s += ' ';
+ s += '[[b]] CNN Presents: The Hunt for Eric Robert Rudolph (8 p.m. ET)[[/b]][[br]]Latest on his capture.';
+ s += ' [[/td]]';
+ s += ' [[/tr]]';
+ s += ' [[/table]]';
+ s += '-->';
+ s += '';
+ s += ' <div><img src="http://i.cnn.net/cnn/images/1.gif" alt="" width="1" height="10"></div> ';
+ s += '';
+ s += '';
+ s += '';
+ s += '';
+ s += '';
+ s += '';
+ s += ' <div><img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/px_c00.gif" alt="" width="267" height="2"></div>';
+ s += ' <table width="267" border="0" cellpadding="0" cellspacing="0">';
+ s += ' <tr>';
+ s += ' <td width="184" bgcolor="#003366"><div class="cnnBlueBoxHeader"><span class="cnnBigPrint"><b>ANALYSIS</b></span></div></td>';
+ s += ' <td width="25" class="cnnBlueBoxHeader" align="right"><img src="http://i.a.cnn.net/cnn/.element/img/1.0/misc/diagonal.gif" width="25" height="19" alt=""></td>';
+ s += ' <td width="58" class="cnnBlueBoxTab" align="right" bgcolor="#336699"><a href="/US"><img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/superlinks/us.gif" alt="U.S. News" border="0" width="54" height="11" hspace="2" vspace="2" align="right"></a></td>';
+ s += ' </tr>';
+ s += ' </table>';
+ s += ' <table width="267" bgcolor="#EEEEEE" border="0" cellpadding="4" cellspacing="0">';
+ s += ' <tr valign="top">';
+ s += ' <td>';
+ s += '<a href="/2003/US/06/12/nyt.safire/index.html"><img src="http://i.a.cnn.net/cnn/2003/US/06/12/nyt.safire/tz.stewart.jpg" alt="Fight It, Martha" width="65" height="49" border="0" align="right"></a>';
+ s += '';
+ s += '';
+ s += '<span class="cnnBodyText" style="font-weight:bold;color:#000;">NYTimes: </span> <a href="/2003/US/06/12/nyt.safire/index.html">Fight It, Martha</a><br>';
+ s += 'William Safire: I hope Martha Stewart beats this bum rap';
+ s += '';
+ s += '';
+ s += '';
+ s += '';
+ s += ' </td>';
+ s += ' </tr>';
+ s += ' </table>';
+ s += ' <div><img src="http://i.cnn.net/cnn/images/1.gif" alt="" width="1" height="10"></div>';
+ s += ' <div><img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/px_c00.gif" alt="" width="267" height="2"></div>';
+ s += ' <table width="267" border="0" cellpadding="0" cellspacing="0">';
+ s += ' <tr>';
+ s += ' <td width="164" bgcolor="#003366"><div class="cnnBlueBoxHeader"><span class="cnnBigPrint"><b>OFFBEAT</b></span></div></td>';
+ s += ' <td width="25" class="cnnBlueBoxHeader" align="right"><img src="http://i.a.cnn.net/cnn/.element/img/1.0/misc/diagonal.gif" width="25" height="19" alt=""></td>';
+ s += ' <td width="78" class="cnnBlueBoxTab" align="right" bgcolor="#336699"><a href="/offbeat"><img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/superlinks/offbeat.gif" alt="more offbeat" width="74" height="11" border="0" hspace="2" vspace="2" align="right"></a></td>';
+ s += ' </tr>';
+ s += ' </table>';
+ s += ' <table width="267" bgcolor="#DDDDDD" border="0" cellpadding="4" cellspacing="0">';
+ s += ' <tr valign="top">';
+ s += ' <td>';
+ s += '<a href="/2003/HEALTH/06/12/offbeat.china.sperm.ap/index.html"><img src="http://i.a.cnn.net/cnn/2003/HEALTH/06/12/offbeat.china.sperm.ap/tz.china.sperm.jpg" alt="Waiting list" width="65" height="49" border="0" align="right"></a>';
+ s += ' ';
+ s += ' <a href="/2003/HEALTH/06/12/offbeat.china.sperm.ap/index.html">Waiting list</a><br>';
+ s += 'Chinas "smart sperm" bank needs donors';
+ s += ' </td>';
+ s += ' </tr>';
+ s += ' </table>';
+ s += ' <div><img src="http://i.cnn.net/cnn/images/1.gif" alt="" width="1" height="10"></div>';
+ s += '';
+ s += ' <table width="267" bgcolor="#999999" border="0" cellpadding="0" cellspacing="0">';
+ s += ' <tr>';
+ s += ' <td>';
+ s += ' <table width="100%" border="0" cellpadding="4" cellspacing="1">';
+ s += ' <tr>';
+ s += ' <td bgcolor="#EEEEEE" class="cnnMainWeatherBox"><a name="weatherBox"></a>';
+ s += '';
+ s += '';
+ s += '';
+ s += '';
+ s += '';
+ s += '';
+ s += '<table width="257" border="0" cellpadding="1" cellspacing="0">';
+ s += '<form method="get" action="http://weather.cnn.com/weather/search" style="margin: 0px">';
+ s += '<input type="hidden" name="mode" value="hplwp">';
+ s += ' <tr>';
+ s += ' <td bgcolor="#FFFFFF"><table width="255" bgcolor="#EAEFF4" border="0" cellpadding="4" cellspacing="0">';
+ s += ' <tr>';
+ s += ' <td colspan="2" class="cnnWEATHERrow">&nbsp;<span class="cnnBigPrint">WEATHER</span></td>';
+ s += ' </tr>';
+ s += ' <tr>';
+ s += ' <td colspan="2" class="cnnBodyText">Get your hometown weather on the home page! <b>Enter city name or U.S. Zip Code:</b></td>';
+ s += ' </tr>';
+ s += ' <tr>';
+ s += ' <td><input class="cnnFormText" type="text" size="12" name="wsearch" value="" style="width:100px;"></td>';
+ s += ' <td><input class="cnnNavButton" type="submit" value="PERSONALIZE"></td>';
+ s += ' </tr>';
+ s += ' <tr>';
+ s += ' <td class="cnnBodyText" colspan="2">Or <a href="javascript:CNN_openPopup("http://weather.cnn.com/weather/select.popup/content2.jsp?mode=hplwp", "weather", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=260,height=250")"><b>select location from a list</b></a></td>';
+ s += ' </tr>';
+ s += ' </table></td>';
+ s += ' </tr>';
+ s += '</form>';
+ s += '</table>';
+ s += '';
+ s += '';
+ s += '';
+ s += ' </td>';
+ s += ' </tr>';
+ s += ' <tr>';
+ s += ' <td bgcolor="#EEEEEE">';
+ s += ' <table width="100%" border="0" cellpadding="0" cellspacing="2">';
+ s += ' <tr>';
+ s += ' <td><img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/quickvote.gif" alt="Quick Vote" width="107" height="24" border="0"></td>';
+ s += ' <td width="88" align="right"><!-- ad home/quickvote/sponsor.88x31 -->';
+ s += '<!-- ad commented while aol investigates 3/31/03 5:40 a.m. lk -->';
+ s += '<a href="http://ar.atwola.com/link/93101912/aol"><img src="http://ar.atwola.com/image/93101912/aol" alt="Click Here" width="88" height="31" border="0" hspace="0" vspace="0"></a>';
+ s += '</td>';
+ s += ' </tr>';
+ s += ' </table>';
+ s += '<table width="100%" cellspacing="0" cellpadding="1" border="0"><form target="popuppoll" method="post" action="http://polls.cnn.com/poll">';
+ s += '<INPUT TYPE=HIDDEN NAME="poll_id" VALUE="3966">';
+ s += '<tr><td colspan="2" align="left"><span class="cnnBodyText">Should an international peacekeeping force be sent to the Mideast?<br></span></td></tr>';
+ s += '<tr valign="top">';
+ s += '<td><span class="cnnBodyText">Yes</span>';
+ s += '</td><td align="right"><input value="1" type="radio" name="question_1"></td></tr>';
+ s += '<tr valign="top">';
+ s += '<td><span class="cnnBodyText">No</span>';
+ s += '</td><td align="right"><input value="2" type="radio" name="question_1"></td></tr>';
+ s += '<!-- /end Question 1 -->';
+ s += '<tr>';
+ s += '<td colspan="2">';
+ s += '<table width="100%" cellspacing="0" cellpadding="0" border="0"><tr><td><span class="cnnInterfaceLink"><nobr><a href="javascript:CNN_openPopup("/POLLSERVER/results/3966.html","popuppoll","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=510,height=400")">VIEW RESULTS</a></nobr></span></td>';
+ s += '<td align="right"><input class="cnnFormButton" onclick="CNN_openPopup("","popuppoll","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=510,height=400")" value="VOTE" type="SUBMIT"></td></tr></table></td></tr>';
+ s += '</form></table>';
+ s += '';
+ s += ' </td>';
+ s += ' </tr>';
+ s += '</table>';
+ s += '';
+ s += ' </td>';
+ s += ' </tr>';
+ s += ' </table>';
+ s += ' <!-- /right --></td>';
+ s += ' </tr>';
+ s += ' <tr>';
+ s += ' <td colspan="3" valign="bottom"> <img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/px_ccc.gif" alt="" width="483" height="1"> </td>';
+ s += ' </tr>';
+ s += '</table>';
+ s += '<table width="770" border="0" cellpadding="0" cellspacing="0" summary="Links to stories from CNN partners">';
+ s += ' <col width="10">';
+ s += ' <col width="250" align="left" valign="top">';
+ s += ' <col width="5">';
+ s += ' <col width="250" align="left" valign="top">';
+ s += ' <col width="5">';
+ s += ' <col width="250" align="left" valign="top">';
+ s += ' <tr><td colspan="6"><img src="http://i.cnn.net/cnn/images/1.gif" alt="" width="1" height="2"></td></tr>';
+ s += ' <tr valign="top">';
+ s += ' <td rowspan="6" width="10"><img src="http://i.cnn.net/cnn/images/1.gif" alt="" width="10" height="1"></td>';
+ s += ' <td colspan="3"><span class="cnnMenuText" style="font-size: 12px"><b style="color: #c00">From our Partners</b></span>';
+ s += ' <img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/icon_external.gif" alt=" External site icon " width="20" height="13" border="0" align="middle"></td>';
+ s += ' <td colspan="2"></td>';
+ s += ' </tr>';
+ s += ' <tr><td colspan="5"><img src="http://i.cnn.net/cnn/images/1.gif" alt="" width="1" height="2"></td></tr>';
+ s += ' <tr><td colspan="5" bgcolor="#CCCCCC"><img src="http://i.cnn.net/cnn/images/1.gif" alt="" width="1" height="1"></td></tr>';
+ s += ' <tr><td colspan="5"><img src="http://i.cnn.net/cnn/images/1.gif" alt="" width="1" height="2"></td></tr>';
+ s += ' <tr valign="top">';
+ s += ' <td class="cnnMainSections" width="250">';
+ s += '<a href="/time/" target="new"><img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/partner_time.gif" alt="Time: " width="70" height="17" border="0"></a><br><div style="margin-top: 4px"> &#8226;&nbsp;<a target="new" href="/time/magazine/article/0,9171,1101030616-457387,00.html?CNN=yes">Where the Jobs Are</a><br> &#8226;&nbsp;<a target="new" href="/time/magazine/article/0,9171,1101030616-457373,00.html?CNN=yes">Of Dogs and Men</a><br> &#8226;&nbsp;<a target="new" href="/time/photoessays/gunmen/?CNN=yes">Photo Essay: Fighting the Peace</a><br></div><table border="0"><tr><td><img height="1" width="1" alt="" src="http://i.cnn.net/cnn/images/1.gif"/></td></tr><tr bgcolor="#dddddd"><td>&nbsp;&nbsp;<a target="new" href="/linkto/time.main.html">Subscribe to TIME</a>&nbsp;&nbsp;</td></tr></table> </td>';
+ s += ' <td width="5"><br></td>';
+ s += ' <td class="cnnMainSections" width="250">';
+ s += '<a href="/cnnsi/index.html?cnn=yes"><img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/partner_si.gif" alt="CNNsi.com: " width="138" height="17" border="0"></a><br><div style="margin-top: 4px">';
+ s += '&#8226;&nbsp;Marty Burns: <a target="new" href="/cnnsi/inside_game/marty_burns/news/2003/06/11/burns_game4/">Nets pull out all stops</a><br>';
+ s += '&#8226;&nbsp;Michael Farber: <a target="new" href="/cnnsi/inside_game/michael_farber/news/2003/06/11/farber_wrapup/">Sens look good for "04</a><br>';
+ s += '&#8226;&nbsp;Tim Layden: <a target="new" href="/cnnsi/inside_game/tim_layden/news/2003/06/11/layden_neuheisel/">NFL or bust for Neuheisel</a><br>';
+ s += '</div>';
+ s += '<table border="0"><tr><td><img src="http://i.cnn.net/cnn/images/1.gif" alt="" width="1" height="1"></td></tr><tr bgcolor="#dddddd"><td>&nbsp;&nbsp;<a href="http://subs.timeinc.net/CampaignHandler/si_cnnsi?source_id=19">Subscribe to Sports Illustrated</a>&nbsp;&nbsp;</td></tr></table>';
+ s += ' </td>';
+ s += ' <td width="5"><br></td>';
+ s += ' <td class="cnnMainSections" width="250">';
+ s += '<a href="/linkto/nyt/main.banner.html" target="new"><img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/partners_nyt.gif" alt="New York Times: " width="105" height="17" border="0"></a><br><div style="margin-top: 4px"> &#8226;&nbsp;<a target="new" href="/linkto/nyt/story/1.0612.html">U.S. Widens Checks at Foreign Ports</a><br> &#8226;&nbsp;<a target="new" href="/linkto/nyt/story/2.0612.html">Rumsfeld: Iran Developing Nuclear Arms</a><br> &#8226;&nbsp;<a target="new" href="/linkto/nyt/story/3.0612.html">Vandalism, "Improvements" Mar Great Wall</a><br></div><table border="0"><tr><td><img height="1" width="1" alt="" src="http://i.cnn.net/cnn/images/1.gif"/></td></tr><tr bgcolor="#dddddd"><td>&nbsp;&nbsp;<a target="new" href="/linkto/nyt.main.html">Get 50% OFF the NY Times</a>&nbsp;&nbsp;</td></tr></table> </td>';
+ s += ' </tr>';
+ s += '';
+ s += '</table>';
+ s += '<div><img src="http://i.cnn.net/cnn/images/1.gif" alt="" width="1" height="2"></div>';
+ s += '';
+ s += '<table width="770" border="0" cellpadding="0" cellspacing="0">';
+ s += ' <tr>';
+ s += ' <td width="10"><img src="http://i.cnn.net/cnn/images/1.gif" alt="" width="10" height="10"></td>';
+ s += ' <td width="760">';
+ s += '<!-- floor -->';
+ s += '';
+ s += '<table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td bgcolor="#999999"><img src="http://i.cnn.net/cnn/images/1.gif" alt="" width="1" height="1"></td></tr></table>';
+ s += '';
+ s += '<div><img src="http://i.cnn.net/cnn/images/1.gif" alt="" width="1" height="1"></div>';
+ s += '';
+ s += '<table width="100%" bgcolor="#DEDEDE" border="0" cellpadding="3" cellspacing="0">';
+ s += ' <tr> ';
+ s += ' <td><img src="http://i.cnn.net/cnn/images/1.gif" alt="" width="5" height="5"></td>';
+ s += ' <td><a href="http://edition.cnn.com/" class="cnnFormTextB" onClick="clickEdLink()" style="color:#000;">International Edition</a></td>';
+ s += '<form>';
+ s += ' <td><select title="CNN.com is available in different languages" class="cnnMenuText" name="languages" size="1" style="font-weight: bold; vertical-align: middle" onChange="if (this.options[selectedIndex].value != "") location.href=this.options[selectedIndex].value">';
+ s += ' <option value="" disabled selected>Languages</option>';
+ s += ' <option value="" disabled>---------</option>';
+ s += ' <option value="/cnnes/">Spanish</option>';
+ s += ' <option value="http://cnn.de/">German</option>';
+ s += ' <option value="http://cnnitalia.it/">Italian</option>';
+ s += ' <option value="http://www.joins.com/cnn/">Korean</option>';
+ s += ' <option value="http://arabic.cnn.com/">Arabic</option>';
+ s += ' <option value="http://www.CNN.co.jp/">Japanese</option>';
+ s += ' </select></td>';
+ s += '</form>';
+ s += ' <td><a href="/CNN/Programs/" class="cnnFormTextB" style="color:#000;">CNN TV</a></td>';
+ s += ' <td><a href="/CNNI/" class="cnnFormTextB" style="color:#000;">CNN International</a></td>';
+ s += ' <td><a href="/HLN/" class="cnnFormTextB" style="color:#000;">Headline News</a></td>';
+ s += ' <td><a href="/TRANSCRIPTS/" class="cnnFormTextB" style="color:#000;">Transcripts</a></td>';
+ s += ' <td><a href="/services/preferences/" title="Customize your CNN.com experience" class="cnnFormTextB" style="color:#000;">Preferences</a></td>';
+ s += ' <td><a href="/INDEX/about.us/" class="cnnFormTextB" style="color:#000;">About CNN.com</a></td>';
+ s += ' </tr>';
+ s += '</table>';
+ s += '';
+ s += '<div><img src="http://i.cnn.net/cnn/images/1.gif" alt="" width="1" height="1"></div>';
+ s += '';
+ s += '<table width="100%" bgcolor="#EFEFEF" border="0" cellpadding="4" cellspacing="0">';
+ s += ' <tr valign="top"> ';
+ s += ' <td style="padding-left:10px"><div class="cnnSectCopyright">';
+ s += '<b>&copy; 2003 Cable News Network LP, LLLP.</b><br>';
+ s += 'An AOL Time Warner Company. All Rights Reserved.<br>';
+ s += '<a href="/interactive_legal.html">Terms</a> under which this service is provided to you.<br>';
+ s += 'Read our <a href="/privacy.html">privacy guidelines</a>. <a href="/feedback/">Contact us</a>.';
+ s += ' </div></td>';
+ s += ' <td align="right"><table border="0" cellpadding="4" cellspacing="0">';
+ s += ' <tr> ';
+ s += ' <td rowspan="2" align="middle"><img src="http://i.a.cnn.net/cnn/.element/img/1.0/sect/SEARCH/dotted.line.gif" alt="" width="7" height="46"></td>';
+ s += ' <td><img src="http://i.a.cnn.net/cnn/.element/img/1.0/misc/icon.external.links.gif" alt="external link" width="20" height="13"></td>';
+ s += ' <td><div class="cnnSectExtSites">All external sites will open in a new browser.<br>';
+ s += ' CNN.com does not endorse external sites.</div></td>';
+ s += ' <td rowspan="2" align="middle"><img src="http://i.a.cnn.net/cnn/.element/img/1.0/sect/SEARCH/dotted.line.gif" alt="" width="7" height="46"></td>';
+ s += ' <td rowspan="2"><!-- home/powered_by/sponsor.88x31 -->';
+ s += '<script language="JavaScript1.1">';
+ s += '<!--';
+ s += 'adSetTarget("_top");';
+ s += 'htmlAdWH( (new Array(93103308,93103308,93103308,93103308))[document.adoffset||0] , 88, 31);';
+ s += '//-->';
+ s += '</script><noscript><a href="http://ar.atwola.com/link/93103308/aol" target="_top"><img src="http://ar.atwola.com/image/93103308/aol" alt="Click here for our advertiser" width="88" height="31" border="0"></a></noscript>';
+ s += '</td>';
+ s += ' </tr>';
+ s += ' <tr valign="top"> ';
+ s += ' <td><img src="http://i.a.cnn.net/cnn/.element/img/1.0/main/icon_premium.gif" alt=" Premium content icon " width="9" height="11"></td>';
+ s += ' <td><span class="cnnSectExtSites">Denotes premium content.</span></td>';
+ s += ' </tr>';
+ s += ' </table></td>';
+ s += ' </tr>';
+ s += '</table>';
+ s += '';
+ s += '<!-- /floor --></td>';
+ s += ' </tr>';
+ s += '</table>';
+ s += '';
+ s += '';
+ s += '';
+ s += '<!-- popunder ad generic/popunder_launch.720x300 -->';
+ s += '<script language="JavaScript1.1" type="text/javascript">';
+ s += '<!--';
+ s += 'if (document.adPopupFile) {';
+ s += ' if (document.adPopupInterval == null) {';
+ s += ' document.adPopupInterval = "0";';
+ s += ' }';
+ s += ' if (document.adPopunderInterval == null) {';
+ s += ' document.adPopunderInterval = document.adPopupInterval;';
+ s += ' }';
+ s += ' if (document.adPopupDomain != null) {';
+ s += ' adSetPopDm(document.adPopupDomain);';
+ s += ' }';
+ s += ' adSetPopupWH("93162673", "720", "300", document.adPopupFile, document.adPopunderInterval, 20, 50, -1);';
+ s += '}';
+ s += '// -->';
+ s += '</script>';
+ s += ' ';
+ s += '<!-- home/bottom.eyeblaster -->';
+ s += '<script language="JavaScript1.1" type="text/javascript">';
+ s += '<!--';
+ s += 'var MacPPC = (navigator.platform == "MacPPC") ? true : false;';
+ s += 'if (!MacPPC) {';
+ s += 'adSetType("J");';
+ s += 'htmlAdWH( (new Array(93137910,93137910,93137910,93137910))[document.adoffset||0], 101, 1);';
+ s += 'adSetType("");';
+ s += '}';
+ s += '// -->';
+ s += '</script>';
+ s += '';
+ s += '<script language="JavaScript1.1" src="http://ar.atwola.com/file/adsEnd.js"></script>';
+ s += '';
+ s += '<img src="/cookie.crumb" alt="" width="1" height="1">';
+ s += '<!--include virtual="/virtual/2002/main/survey.html"-->';
+ s += '</body>';
+ s += '</html>';
+
+ return s;
+ }
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-209919.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-209919.js
new file mode 100644
index 0000000000..62c3cd86f0
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-209919.js
@@ -0,0 +1,174 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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):
+ * sagdjb@softwareag.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: 19 June 2003
+ * SUMMARY: Testing regexp submatches with quantifiers
+ *
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=209919
+ *
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-209919.js';
+var i = 0;
+var BUGNUMBER = 209919;
+var summary = 'Testing regexp submatches with quantifiers';
+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();
+
+
+/*
+ * Waldemar: "ECMA-262 15.10.2.5, third algorithm, step 2.1 states that
+ * once the minimum repeat count (which is 0 for *, 1 for +, etc.) has
+ * been satisfied, an atom being repeated must not match the empty string."
+ *
+ * In this example, the minimum repeat count is 0, so the last thing the
+ * capturing parens is permitted to contain is the 'a'. It may NOT go on
+ * to capture the '' at the $ position of 'a', even though '' satifies
+ * the condition b*
+ *
+ */
+status = inSection(1);
+string = 'a';
+pattern = /(a|b*)*/;
+actualmatch = string.match(pattern);
+expectedmatch = Array(string, 'a');
+addThis();
+
+
+/*
+ * In this example, the minimum repeat count is 5, so the capturing parens
+ * captures the 'a', then goes on to capture the '' at the $ position of 'a'
+ * 4 times before it has to stop. Therefore the last thing it contains is ''.
+ */
+status = inSection(2);
+string = 'a';
+pattern = /(a|b*){5,}/;
+actualmatch = string.match(pattern);
+expectedmatch = Array(string, '');
+addThis();
+
+
+/*
+ * Reduction of the above examples to contain only the condition b*
+ * inside the capturing parens. This can be even harder to grasp!
+ *
+ * The global match is the '' at the ^ position of 'a', but the parens
+ * is NOT permitted to capture it since the minimum repeat count is 0!
+ */
+status = inSection(3);
+string = 'a';
+pattern = /(b*)*/;
+actualmatch = string.match(pattern);
+expectedmatch = Array('', undefined);
+addThis();
+
+
+/*
+ * Here we have used the + quantifier (repeat count 1) outside the parens.
+ * Therefore the parens must capture at least once before stopping, so it
+ * does capture the '' this time -
+ */
+status = inSection(4);
+string = 'a';
+pattern = /(b*)+/;
+actualmatch = string.match(pattern);
+expectedmatch = Array('', '');
+addThis();
+
+
+/*
+ * More complex examples -
+ */
+pattern = /^\-?(\d{1,}|\.{0,})*(\,\d{1,})?$/;
+
+status = inSection(5);
+string = '100.00';
+actualmatch = string.match(pattern);
+expectedmatch = Array(string, '00', undefined);
+addThis();
+
+status = inSection(6);
+string = '100,00';
+actualmatch = string.match(pattern);
+expectedmatch = Array(string, '100', ',00');
+addThis();
+
+status = inSection(7);
+string = '1.000,00';
+actualmatch = string.match(pattern);
+expectedmatch = Array(string, '000', ',00');
+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/qml/parserstress/tests/ecma_3/RegExp/regress-216591.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-216591.js
new file mode 100644
index 0000000000..455565ae36
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-216591.js
@@ -0,0 +1,117 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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):
+ * okin7@yahoo.fr, 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 August 2003
+ * SUMMARY: Regexp conformance test
+ *
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=216591
+ *
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-216591.js';
+var i = 0;
+var BUGNUMBER = 216591;
+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);
+string = 'a {result.data.DATA} b';
+pattern = /\{(([a-z0-9\-_]+?\.)+?)([a-z0-9\-_]+?)\}/i;
+actualmatch = string.match(pattern);
+expectedmatch = Array('{result.data.DATA}', 'result.data.', 'data.', 'DATA');
+addThis();
+
+/*
+ * Add a global flag to the regexp. In Perl 5, this gives the same results as above. Compare:
+ *
+ * [ ] perl -e '"a {result.data.DATA} b" =~ /\{(([a-z0-9\-_]+?\.)+?)([a-z0-9\-_]+?)\}/i; print("$&, $1, $2, $3");'
+ * {result.data.DATA}, result.data., data., DATA
+ *
+ * [ ] perl -e '"a {result.data.DATA} b" =~ /\{(([a-z0-9\-_]+?\.)+?)([a-z0-9\-_]+?)\}/gi; print("$&, $1, $2, $3");'
+ * {result.data.DATA}, result.data., data., DATA
+ *
+ *
+ * But in JavaScript, there will no longer be any sub-captures:
+ */
+status = inSection(2);
+string = 'a {result.data.DATA} b';
+pattern = /\{(([a-z0-9\-_]+?\.)+?)([a-z0-9\-_]+?)\}/gi;
+actualmatch = string.match(pattern);
+expectedmatch = Array('{result.data.DATA}');
+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/qml/parserstress/tests/ecma_3/RegExp/regress-220367-001.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-220367-001.js
new file mode 100644
index 0000000000..59abc0c4b0
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-220367-001.js
@@ -0,0 +1,104 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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: 26 September 2003
+ * SUMMARY: Regexp conformance test
+ *
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=220367
+ *
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-220367-001.js';
+var i = 0;
+var BUGNUMBER = 220367;
+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);
+string = 'a';
+pattern = /(a)|(b)/;
+actualmatch = string.match(pattern);
+expectedmatch = Array(string, 'a', undefined);
+addThis();
+
+status = inSection(2);
+string = 'b';
+pattern = /(a)|(b)/;
+actualmatch = string.match(pattern);
+expectedmatch = Array(string, undefined, 'b');
+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/qml/parserstress/tests/ecma_3/RegExp/regress-223273.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-223273.js
new file mode 100644
index 0000000000..2858e85487
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-223273.js
@@ -0,0 +1,279 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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):
+ * 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 2003
+ * SUMMARY: Unescaped, unbalanced parens in a regexp should cause SyntaxError.
+ *
+ * The same would also be true for unescaped, unbalanced brackets or braces
+ * if we followed the ECMA-262 Ed. 3 spec on this. But it was decided for
+ * backward compatibility reasons to follow Perl 5, which permits
+ *
+ * 1. an unescaped, unbalanced right bracket ]
+ * 2. an unescaped, unbalanced left brace {
+ * 3. an unescaped, unbalanced right brace }
+ *
+ * If any of these should occur, Perl treats each as a literal
+ * character. Therefore we permit all three of these cases, even
+ * though not ECMA-compliant. Note Perl errors on an unescaped,
+ * unbalanced left bracket; so will we.
+ *
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=223273
+ *
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-223273.js';
+var UBound = 0;
+var BUGNUMBER = 223273;
+var summary = 'Unescaped, unbalanced parens in regexp should be a SyntaxError';
+var TEST_PASSED = 'SyntaxError';
+var TEST_FAILED = 'Generated an error, but NOT a SyntaxError!';
+var TEST_FAILED_BADLY = 'Did not generate ANY error!!!';
+var CHECK_PASSED = 'Should not generate an error';
+var CHECK_FAILED = 'Generated an error!';
+var status = '';
+var statusitems = [];
+var actual = '';
+var actualvalues = [];
+var expect= '';
+var expectedvalues = [];
+
+
+/*
+ * All the following contain unescaped, unbalanced parens and
+ * should generate SyntaxErrors. That's what we're testing for.
+ *
+ * To allow the test to compile and run, we have to hide the errors
+ * inside eval strings, and check they are caught at run-time.
+ *
+ * Inside such strings, remember to escape any escape character!
+ */
+status = inSection(1);
+testThis(' /(/ ');
+
+status = inSection(2);
+testThis(' /)/ ');
+
+status = inSection(3);
+testThis(' /(abc\\)def(g/ ');
+
+status = inSection(4);
+testThis(' /\\(abc)def)g/ ');
+
+
+/*
+ * These regexp patterns are correct and should not generate
+ * any errors. Note we use checkThis() instead of testThis().
+ */
+status = inSection(5);
+checkThis(' /\\(/ ');
+
+status = inSection(6);
+checkThis(' /\\)/ ');
+
+status = inSection(7);
+checkThis(' /(abc)def\\(g/ ');
+
+status = inSection(8);
+checkThis(' /(abc\\)def)g/ ');
+
+status = inSection(9);
+checkThis(' /(abc(\\))def)g/ ');
+
+status = inSection(10);
+checkThis(' /(abc([x\\)yz]+)def)g/ ');
+
+
+
+/*
+ * Unescaped, unbalanced left brackets should be a SyntaxError
+ */
+status = inSection(11);
+testThis(' /[/ ');
+
+status = inSection(12);
+testThis(' /[abc\\]def[g/ ');
+
+
+/*
+ * We permit unescaped, unbalanced right brackets, as does Perl.
+ * No error should result, even though this is not ECMA-compliant.
+ * Note we use checkThis() instead of testThis().
+ */
+status = inSection(13);
+checkThis(' /]/ ');
+
+status = inSection(14);
+checkThis(' /\\[abc]def]g/ ');
+
+
+/*
+ * These regexp patterns are correct and should not generate
+ * any errors. Note we use checkThis() instead of testThis().
+ */
+status = inSection(15);
+checkThis(' /\\[/ ');
+
+status = inSection(16);
+checkThis(' /\\]/ ');
+
+status = inSection(17);
+checkThis(' /[abc]def\\[g/ ');
+
+status = inSection(18);
+checkThis(' /[abc\\]def]g/ ');
+
+status = inSection(19);
+checkThis(' /(abc[\\]]def)g/ ');
+
+status = inSection(20);
+checkThis(' /[abc(x\\]yz+)def]g/ ');
+
+
+
+/*
+ * Run some tests for unbalanced braces. We again follow Perl, and
+ * thus permit unescaped unbalanced braces - both left and right,
+ * even though this is not ECMA-compliant.
+ *
+ * Note we use checkThis() instead of testThis().
+ */
+status = inSection(21);
+checkThis(' /abc{def/ ');
+
+status = inSection(22);
+checkThis(' /abc}def/ ');
+
+status = inSection(23);
+checkThis(' /a{2}bc{def/ ');
+
+status = inSection(24);
+checkThis(' /a}b{3}c}def/ ');
+
+
+/*
+ * These regexp patterns are correct and should not generate
+ * any errors. Note we use checkThis() instead of testThis().
+ */
+status = inSection(25);
+checkThis(' /abc\\{def/ ');
+
+status = inSection(26);
+checkThis(' /abc\\}def/ ');
+
+status = inSection(27);
+checkThis(' /a{2}bc\\{def/ ');
+
+status = inSection(28);
+checkThis(' /a\\}b{3}c\\}def/ ');
+
+
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+
+
+
+/*
+ * Invalid syntax should generate a SyntaxError
+ */
+function testThis(sInvalidSyntax)
+{
+ expect = TEST_PASSED;
+ actual = TEST_FAILED_BADLY;
+
+ try
+ {
+ eval(sInvalidSyntax);
+ }
+ catch(e)
+ {
+ if (e instanceof SyntaxError)
+ actual = TEST_PASSED;
+ else
+ actual = TEST_FAILED;
+ }
+
+ statusitems[UBound] = status;
+ expectedvalues[UBound] = expect;
+ actualvalues[UBound] = actual;
+ UBound++;
+}
+
+
+/*
+ * Valid syntax shouldn't generate any errors
+ */
+function checkThis(sValidSyntax)
+{
+ expect = CHECK_PASSED;
+ actual = CHECK_PASSED;
+
+ try
+ {
+ eval(sValidSyntax);
+ }
+ catch(e)
+ {
+ actual = CHECK_FAILED;
+ }
+
+ statusitems[UBound] = status;
+ expectedvalues[UBound] = expect;
+ actualvalues[UBound] = actual;
+ 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/qml/parserstress/tests/ecma_3/RegExp/regress-223535.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-223535.js
new file mode 100644
index 0000000000..82305502fd
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-223535.js
@@ -0,0 +1,133 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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):
+ * zack-weg@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: 24 October 2003
+ * SUMMARY: Testing regexps with empty alternatives
+ *
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=223535
+ *
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-223535.js';
+var i = 0;
+var BUGNUMBER = 223535;
+var summary = 'Testing regexps with empty alternatives';
+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();
+
+
+string = 'a';
+status = inSection(1);
+pattern = /a|/;
+actualmatch = string.match(pattern);
+expectedmatch = Array('a');
+addThis();
+
+status = inSection(2);
+pattern = /|a/;
+actualmatch = string.match(pattern);
+expectedmatch = Array('');
+addThis();
+
+status = inSection(3);
+pattern = /|/;
+actualmatch = string.match(pattern);
+expectedmatch = Array('');
+addThis();
+
+status = inSection(4);
+pattern = /(a|)/;
+actualmatch = string.match(pattern);
+expectedmatch = Array('a', 'a');
+addThis();
+
+status = inSection(5);
+pattern = /(a||)/;
+actualmatch = string.match(pattern);
+expectedmatch = Array('a', 'a');
+addThis();
+
+status = inSection(6);
+pattern = /(|a)/;
+actualmatch = string.match(pattern);
+expectedmatch = Array('', '');
+addThis();
+
+status = inSection(7);
+pattern = /(|a|)/;
+actualmatch = string.match(pattern);
+expectedmatch = Array('', '');
+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/qml/parserstress/tests/ecma_3/RegExp/regress-224676.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-224676.js
new file mode 100644
index 0000000000..88e89ee609
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-224676.js
@@ -0,0 +1,232 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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):
+ * zack-weg@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: 04 November 2003
+ * SUMMARY: Testing regexps with various disjunction + character class patterns
+ *
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=224676
+ *
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-224676.js';
+var i = 0;
+var BUGNUMBER = 224676;
+var summary = 'Regexps with various disjunction + character class patterns';
+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();
+
+
+string = 'ZZZxZZZ';
+status = inSection(1);
+pattern = /[x]|x/;
+actualmatch = string.match(pattern);
+expectedmatch = Array('x');
+addThis();
+
+status = inSection(2);
+pattern = /x|[x]/;
+actualmatch = string.match(pattern);
+expectedmatch = Array('x');
+addThis();
+
+
+string = 'ZZZxbZZZ';
+status = inSection(3);
+pattern = /a|[x]b/;
+actualmatch = string.match(pattern);
+expectedmatch = Array('xb');
+addThis();
+
+status = inSection(4);
+pattern = /[x]b|a/;
+actualmatch = string.match(pattern);
+expectedmatch = Array('xb');
+addThis();
+
+status = inSection(5);
+pattern = /([x]b|a)/;
+actualmatch = string.match(pattern);
+expectedmatch = Array('xb', 'xb');
+addThis();
+
+status = inSection(6);
+pattern = /([x]b|a)|a/;
+actualmatch = string.match(pattern);
+expectedmatch = Array('xb', 'xb');
+addThis();
+
+status = inSection(7);
+pattern = /^[x]b|a/;
+actualmatch = string.match(pattern);
+expectedmatch = null;
+addThis();
+
+
+string = 'xb';
+status = inSection(8);
+pattern = /^[x]b|a/;
+actualmatch = string.match(pattern);
+expectedmatch = Array('xb');
+addThis();
+
+
+string = 'ZZZxbZZZ';
+status = inSection(9);
+pattern = /([x]b)|a/;
+actualmatch = string.match(pattern);
+expectedmatch = Array('xb', 'xb');
+addThis();
+
+status = inSection(10);
+pattern = /()[x]b|a/;
+actualmatch = string.match(pattern);
+expectedmatch = Array('xb', '');
+addThis();
+
+status = inSection(11);
+pattern = /x[b]|a/;
+actualmatch = string.match(pattern);
+expectedmatch = Array('xb');
+addThis();
+
+status = inSection(12);
+pattern = /[x]{1}b|a/;
+actualmatch = string.match(pattern);
+expectedmatch = Array('xb');
+addThis();
+
+status = inSection(13);
+pattern = /[x]b|a|a/;
+actualmatch = string.match(pattern);
+expectedmatch = Array('xb');
+addThis();
+
+status = inSection(14);
+pattern = /[x]b|[a]/;
+actualmatch = string.match(pattern);
+expectedmatch = Array('xb');
+addThis();
+
+status = inSection(15);
+pattern = /[x]b|a+/;
+actualmatch = string.match(pattern);
+expectedmatch = Array('xb');
+addThis();
+
+status = inSection(16);
+pattern = /[x]b|a{1}/;
+actualmatch = string.match(pattern);
+expectedmatch = Array('xb');
+addThis();
+
+status = inSection(17);
+pattern = /[x]b|(a)/;
+actualmatch = string.match(pattern);
+expectedmatch = Array('xb', undefined);
+addThis();
+
+status = inSection(18);
+pattern = /[x]b|()a/;
+actualmatch = string.match(pattern);
+expectedmatch = Array('xb', undefined);
+addThis();
+
+status = inSection(19);
+pattern = /[x]b|^a/;
+actualmatch = string.match(pattern);
+expectedmatch = Array('xb');
+addThis();
+
+status = inSection(20);
+pattern = /a|[^b]b/;
+actualmatch = string.match(pattern);
+expectedmatch = Array('xb');
+addThis();
+
+status = inSection(21);
+pattern = /a|[^b]{1}b/;
+actualmatch = string.match(pattern);
+expectedmatch = Array('xb');
+addThis();
+
+
+string = 'hallo\";'
+ status = inSection(22);
+pattern = /^((\\[^\x00-\x1f]|[^\x00-\x1f"\\])*)"/;
+ actualmatch = string.match(pattern);
+ expectedmatch = Array('hallo"', 'hallo', 'o');
+ 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/qml/parserstress/tests/ecma_3/RegExp/regress-225289.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-225289.js
new file mode 100644
index 0000000000..6e05d12ead
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-225289.js
@@ -0,0 +1,176 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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):
+ * PhilSchwartau@aol.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: 10 November 2003
+ * SUMMARY: Testing regexps with complementary alternatives
+ *
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=225289
+ *
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-225289.js';
+var i = 0;
+var BUGNUMBER = 225289;
+var summary = 'Testing regexps with complementary alternatives';
+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();
+
+
+// this pattern should match any string!
+pattern = /a|[^a]/;
+
+status = inSection(1);
+string = 'a';
+actualmatch = string.match(pattern);
+expectedmatch = Array('a');
+addThis();
+
+status = inSection(2);
+string = '';
+actualmatch = string.match(pattern);
+expectedmatch = null;
+addThis();
+
+status = inSection(3);
+string = '()';
+actualmatch = string.match(pattern);
+expectedmatch = Array('(');
+addThis();
+
+
+pattern = /(a|[^a])/;
+
+status = inSection(4);
+string = 'a';
+actualmatch = string.match(pattern);
+expectedmatch = Array('a', 'a');
+addThis();
+
+status = inSection(5);
+string = '';
+actualmatch = string.match(pattern);
+expectedmatch = null;
+addThis();
+
+status = inSection(6);
+string = '()';
+actualmatch = string.match(pattern);
+expectedmatch = Array('(', '(');
+addThis();
+
+
+pattern = /(a)|([^a])/;
+
+status = inSection(7);
+string = 'a';
+actualmatch = string.match(pattern);
+expectedmatch = Array('a', 'a', undefined);
+addThis();
+
+status = inSection(8);
+string = '';
+actualmatch = string.match(pattern);
+expectedmatch = null;
+addThis();
+
+status = inSection(9);
+string = '()';
+actualmatch = string.match(pattern);
+expectedmatch = Array('(', undefined, '(');
+addThis();
+
+
+// note this pattern has one non-capturing parens
+pattern = /((?:a|[^a])*)/g;
+
+status = inSection(10);
+string = 'a';
+actualmatch = string.match(pattern);
+expectedmatch = Array('a', ''); // see bug 225289 comment 6
+addThis();
+
+status = inSection(11);
+string = '';
+actualmatch = string.match(pattern);
+expectedmatch = Array(''); // see bug 225289 comment 9
+addThis();
+
+status = inSection(12);
+string = '()';
+actualmatch = string.match(pattern);
+expectedmatch = Array('()', ''); // see bug 225289 comment 6
+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/qml/parserstress/tests/ecma_3/RegExp/regress-225343.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-225343.js
new file mode 100644
index 0000000000..25e248adaa
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-225343.js
@@ -0,0 +1,125 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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):
+ * PhilSchwartau@aol.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 November 2003
+ * SUMMARY: Testing regexp character classes and the case-insensitive flag
+ *
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=225343
+ *
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-225343.js';
+var i = 0;
+var BUGNUMBER = 225343;
+var summary = 'Testing regexp character classes and the case-insensitive 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();
+
+
+status = inSection(1);
+string = 'a';
+pattern = /[A]/i;
+actualmatch = string.match(pattern);
+expectedmatch = Array('a');
+addThis();
+
+status = inSection(2);
+string = 'A';
+pattern = /[a]/i;
+actualmatch = string.match(pattern);
+expectedmatch = Array('A');
+addThis();
+
+status = inSection(3);
+string = '123abc123';
+pattern = /([A-Z]+)/i;
+actualmatch = string.match(pattern);
+expectedmatch = Array('abc', 'abc');
+addThis();
+
+status = inSection(4);
+string = '123abc123';
+pattern = /([A-Z])+/i;
+actualmatch = string.match(pattern);
+expectedmatch = Array('abc', 'c');
+addThis();
+
+status = inSection(5);
+string = 'abc@test.com';
+pattern = /^[-!#$%&\'*+\.\/0-9=?A-Z^_`{|}~]+@([-0-9A-Z]+\.)+([0-9A-Z]){2,4}$/i;
+actualmatch = string.match(pattern);
+expectedmatch = Array('abc@test.com', 'test.', 'm');
+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/qml/parserstress/tests/ecma_3/RegExp/regress-24712.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-24712.js
new file mode 100644
index 0000000000..c94472195f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-24712.js
@@ -0,0 +1,59 @@
+/* -*- 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 = 'regress-24712.js';
+
+test();
+
+function test()
+{
+ enterFunc ("test");
+
+ printBugNumber (24712);
+
+ var re = /([\S]+([ \t]+[\S]+)*)[ \t]*=[ \t]*[\S]+/;
+ var result = re.exec("Course_Creator = Test") + '';
+
+ reportCompare('Course_Creator = Test,Course_Creator,', result, 'exec() returned null');
+
+ exitFunc ("test");
+
+}
+
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-285219.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-285219.js
new file mode 100755
index 0000000000..9d462359fa
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-285219.js
@@ -0,0 +1,51 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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): 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 = 'regress-285219.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 285219;
+var summary = 'Do not crash on RangeError: reserved slot out of range';
+var actual = 'No Crash';
+var expect = 'No Crash';
+
+printBugNumber(BUGNUMBER);
+printStatus (summary);
+
+var o = {hi: 'there'};
+eval("var r = /re(1)(2)(3)/g", o);
+
+reportCompare(expect, actual, summary);
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-28686.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-28686.js
new file mode 100644
index 0000000000..b3e355fa1c
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-28686.js
@@ -0,0 +1,57 @@
+/* -*- 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 = 'regress-28686.js';
+
+test();
+
+function test()
+{
+ enterFunc ("test");
+
+ printBugNumber (28686);
+
+ var str = 'foo "bar" baz';
+ reportCompare ('foo \\"bar\\" baz', str.replace(/([\'\"])/g, "\\$1"),
+ "str.replace failed.");
+
+ exitFunc ("test");
+
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-289669.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-289669.js
new file mode 100755
index 0000000000..2e3d044b74
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-289669.js
@@ -0,0 +1,88 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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): Bug Tracker
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient 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-289669.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 289669;
+var summary = 'O(N^2) behavior on String.replace(/RegExp/, ...)';
+var actual = '';
+var expect = '';
+
+printBugNumber(BUGNUMBER);
+printStatus (summary);
+
+
+var data = {X: [], Y:[]};
+
+function replace(str) {
+ var stra=str.replace(new RegExp('<a>','g'),"<span id=\"neurodna\" style=\"background-color:blue\"/>");
+ stra=stra.replace(new RegExp('</a>','g'),"</span><br>");
+}
+
+function runTest() {
+ for (var j = 1000; j <= 10000; j += 1000)
+ {
+ neurodna(j);
+ }
+}
+
+function neurodna(limit) {
+ var prepare="<go>";
+ for(var i=0;i<limit;i++) {
+ prepare += "<a>neurodna</a>";
+ }
+ prepare+="</go>";
+ var da1=new Date();
+ replace(prepare);
+ var da2=new Date();
+ data.X.push(limit);
+ data.Y.push(da2-da1);
+ gc();
+}
+
+runTest();
+
+var order = BigO(data);
+
+var msg = '';
+for (var p = 0; p < data.X.length; p++)
+{
+ msg += '(' + data.X[p] + ', ' + data.Y[p] + '); ';
+}
+printStatus(msg);
+printStatus('Order: ' + order);
+reportCompare(true, order < 2, summary + ' BigO ' + order + ' < 2');
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-307456.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-307456.js
new file mode 100755
index 0000000000..dd2f540f6c
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-307456.js
@@ -0,0 +1,54 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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): Lupin.wp@gmail.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-307456.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 307456;
+var summary = 'Do not Freeze with RegExp';
+var actual = 'No Crash';
+var expect = 'No Crash';
+
+printBugNumber(BUGNUMBER);
+printStatus (summary);
+
+var data='<!---<->---->\n\n<><>--!!!<><><><><><>\n!!<>\n\n<>\n<><><><>!\n\n\n\n--\n--\n--\n\n--\n--\n\n\n-------\n--\n--\n\n\n--\n\n\n\n----\n\n\n\n--\n\n\n-\n\n\n-\n\n-\n\n-\n\n-\n-\n\n----\n\n-\n\n\n\n\n-\n\n\n\n\n\n\n\n\n-----\n\n\n-\n------\n-------\n\n----\n\n\n\n!\n\n\n\n\n\n\n\n!!!\n\n\n--------\n\n\n\n-\n\n\n-\n--\n\n----\n\n\n\n\n\n-\n\n\n----\n\n\n\n\n\n--------\n!\n\n\n\n\n-\n---\n--\n\n----\n\n-\n\n-\n\n-\n\n\n\n-----\n\n\n\n-\n\n\n-\n\n\n--\n-\n\n\n-\n\n----\n\n---\n\n---\n\n----\n\n\n\n---\n\n-++\n\n-------<>\n\n-!\n\n--\n\n----!-\n\n\n\n';
+
+printStatus(data);
+data=data.replace(RegExp('<!--(\\n[^\\n]|[^-]|-[^-]|--[^>])*-->', 'g'), '');
+printStatus(data);
+
+reportCompare(expect, actual, summary);
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-309840.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-309840.js
new file mode 100755
index 0000000000..8680b7bcfd
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-309840.js
@@ -0,0 +1,58 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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 <pschwartau@meer.net>
+ * Bob Clary <bob@bclary.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-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/qml/parserstress/tests/ecma_3/RegExp/regress-311414.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-311414.js
new file mode 100755
index 0000000000..a24a07bb2b
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-311414.js
@@ -0,0 +1,101 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_3/RegExp/regress-312351.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-312351.js
new file mode 100755
index 0000000000..a9b00d317c
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-312351.js
@@ -0,0 +1,50 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_3/RegExp/regress-31316.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-31316.js
new file mode 100644
index 0000000000..594913f07c
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-31316.js
@@ -0,0 +1,96 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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 = '<p>Some<br />test</p>';
+actualmatch = string.match(pattern);
+expectedmatch = Array('<p>', 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/qml/parserstress/tests/ecma_3/RegExp/regress-330684.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-330684.js
new file mode 100755
index 0000000000..b097fbc3d7
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-330684.js
@@ -0,0 +1,53 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_3/RegExp/regress-334158.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-334158.js
new file mode 100755
index 0000000000..41ebf0a731
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-334158.js
@@ -0,0 +1,58 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_3/RegExp/regress-346090.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-346090.js
new file mode 100755
index 0000000000..dfd53a9922
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-346090.js
@@ -0,0 +1,63 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_3/RegExp/regress-367888.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-367888.js
new file mode 100755
index 0000000000..923c1e5ab3
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-367888.js
@@ -0,0 +1,62 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_3/RegExp/regress-375642.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-375642.js
new file mode 100755
index 0000000000..236eb00d28
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-375642.js
@@ -0,0 +1,61 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_3/RegExp/regress-375711.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-375711.js
new file mode 100755
index 0000000000..6e7339f9e9
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-375711.js
@@ -0,0 +1,118 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_3/RegExp/regress-375715-01-n.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-375715-01-n.js
new file mode 100755
index 0000000000..437dcbd5c5
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-375715-01-n.js
@@ -0,0 +1,63 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_3/RegExp/regress-375715-02.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-375715-02.js
new file mode 100755
index 0000000000..3cd858e845
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-375715-02.js
@@ -0,0 +1,60 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_3/RegExp/regress-375715-03.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-375715-03.js
new file mode 100755
index 0000000000..ffc5c5a4cc
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-375715-03.js
@@ -0,0 +1,60 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_3/RegExp/regress-375715-04.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-375715-04.js
new file mode 100755
index 0000000000..0c78a372ee
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-375715-04.js
@@ -0,0 +1,68 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_3/RegExp/regress-57572.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-57572.js
new file mode 100644
index 0000000000..c7abd410bf
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-57572.js
@@ -0,0 +1,150 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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/qml/parserstress/tests/ecma_3/RegExp/regress-57631.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-57631.js
new file mode 100644
index 0000000000..dc222bfc0f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-57631.js
@@ -0,0 +1,152 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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/qml/parserstress/tests/ecma_3/RegExp/regress-67773.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-67773.js
new file mode 100644
index 0000000000..4ee0d52854
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-67773.js
@@ -0,0 +1,211 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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/qml/parserstress/tests/ecma_3/RegExp/regress-72964.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-72964.js
new file mode 100644
index 0000000000..67a41e505c
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-72964.js
@@ -0,0 +1,121 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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/qml/parserstress/tests/ecma_3/RegExp/regress-76683.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-76683.js
new file mode 100644
index 0000000000..8792e379ca
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-76683.js
@@ -0,0 +1,114 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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/qml/parserstress/tests/ecma_3/RegExp/regress-78156.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-78156.js
new file mode 100644
index 0000000000..dd42ce060b
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-78156.js
@@ -0,0 +1,123 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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/qml/parserstress/tests/ecma_3/RegExp/regress-85721.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-85721.js
new file mode 100644
index 0000000000..bca1a15e19
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-85721.js
@@ -0,0 +1,276 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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='<sql:connection id="conn1"> <sql:url>www.m.com</sql:url> <sql:driver>drive.class</sql:driver>\n<sql:userId>foo</sql:userId> <sql:password>goo</sql:password> </sql:connection>';
+re = /<sql:connection id="([^\r\n]*?)">\s*<sql:url>\s*([^\r\n]*?)\s*<\/sql:url>\s*<sql:driver>\s*([^\r\n]*?)\s*<\/sql:driver>\s*(\s*<sql:userId>\s*([^\r\n]*?)\s*<\/sql:userId>\s*)?\s*(\s*<sql:password>\s*([^\r\n]*?)\s*<\/sql:password>\s*)?\s*<\/sql:connection>/;
+expect = Array("<sql:connection id=\"conn1\"> <sql:url>www.m.com</sql:url> <sql:driver>drive.class</sql:driver>\n<sql:userId>foo</sql:userId> <sql:password>goo</sql:password> </sql:connection>","conn1","www.m.com","drive.class","<sql:userId>foo</sql:userId> ","foo","<sql:password>goo</sql:password> ","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-spec>
+$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/qml/parserstress/tests/ecma_3/RegExp/regress-87231.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-87231.js
new file mode 100644
index 0000000000..b5467322eb
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-87231.js
@@ -0,0 +1,145 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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/qml/parserstress/tests/ecma_3/RegExp/regress-98306.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-98306.js
new file mode 100644
index 0000000000..a2bfc2bf93
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/regress-98306.js
@@ -0,0 +1,99 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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<cnUBOUND; i++)
+ {
+ try
+ {
+ eval(sCode);
+ }
+ catch(e)
+ {
+ // do nothing; keep going -
+ }
+ }
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/RegExp/shell.js b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/shell.js
new file mode 100644
index 0000000000..dbc733c376
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/RegExp/shell.js
@@ -0,0 +1,266 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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: 07 February 2001
+ *
+ * Functionality common to RegExp testing -
+ */
+//-----------------------------------------------------------------------------
+
+gTestsubsuite = 'RegExp';
+
+var MSG_PATTERN = '\nregexp = ';
+var MSG_STRING = '\nstring = ';
+var MSG_EXPECT = '\nExpect: ';
+var MSG_ACTUAL = '\nActual: ';
+var ERR_LENGTH = '\nERROR !!! match arrays have different lengths:';
+var ERR_MATCH = '\nERROR !!! regexp failed to give expected match array:';
+var ERR_NO_MATCH = '\nERROR !!! regexp FAILED to match anything !!!';
+var ERR_UNEXP_MATCH = '\nERROR !!! regexp MATCHED when we expected it to fail !!!';
+var CHAR_LBRACKET = '[';
+var CHAR_RBRACKET = ']';
+var CHAR_QT_DBL = '"';
+var CHAR_QT = "'";
+var CHAR_NL = '\n';
+var CHAR_COMMA = ',';
+var CHAR_SPACE = ' ';
+var TYPE_STRING = typeof 'abc';
+
+
+
+function testRegExp(statuses, patterns, strings, actualmatches, expectedmatches)
+{
+ var status = '';
+ var pattern = new RegExp();
+ var string = '';
+ var actualmatch = new Array();
+ var expectedmatch = new Array();
+ var state = '';
+ var lActual = -1;
+ var lExpect = -1;
+
+
+ for (var i=0; i != patterns.length; i++)
+ {
+ status = statuses[i];
+ pattern = patterns[i];
+ string = strings[i];
+ actualmatch=actualmatches[i];
+ expectedmatch=expectedmatches[i];
+ state = getState(status, pattern, string);
+
+ description = status;
+
+ if(actualmatch)
+ {
+ actual = formatArray(actualmatch);
+ if(expectedmatch)
+ {
+ // expectedmatch and actualmatch are arrays -
+ lExpect = expectedmatch.length;
+ lActual = actualmatch.length;
+
+ var expected = formatArray(expectedmatch);
+
+ if (lActual != lExpect)
+ {
+ reportCompare(lExpect, lActual,
+ state + ERR_LENGTH +
+ MSG_EXPECT + expected +
+ MSG_ACTUAL + actual +
+ CHAR_NL
+ );
+ continue;
+ }
+
+ // OK, the arrays have same length -
+ if (expected != actual)
+ {
+ reportCompare(expected, actual,
+ state + ERR_MATCH +
+ MSG_EXPECT + expected +
+ MSG_ACTUAL + actual +
+ CHAR_NL
+ );
+ }
+ else
+ {
+ reportCompare(expected, actual, state)
+ }
+
+ }
+ else //expectedmatch is null - that is, we did not expect a match -
+ {
+ expected = expectedmatch;
+ reportCompare(expected, actual,
+ state + ERR_UNEXP_MATCH +
+ MSG_EXPECT + expectedmatch +
+ MSG_ACTUAL + actual +
+ CHAR_NL
+ );
+ }
+
+ }
+ else // actualmatch is null
+ {
+ if (expectedmatch)
+ {
+ actual = actualmatch;
+ reportCompare(expected, actual,
+ state + ERR_NO_MATCH +
+ MSG_EXPECT + expectedmatch +
+ MSG_ACTUAL + actualmatch +
+ CHAR_NL
+ );
+ }
+ else // we did not expect a match
+ {
+ // Being ultra-cautious. Presumably expectedmatch===actualmatch===null
+ expected = expectedmatch;
+ actual = actualmatch;
+ reportCompare (expectedmatch, actualmatch, state);
+ }
+ }
+ }
+}
+
+
+function getState(status, pattern, string)
+{
+ /*
+ * Escape \n's, etc. to make them LITERAL in the presentation string.
+ * We don't have to worry about this in |pattern|; such escaping is
+ * done automatically by pattern.toString(), invoked implicitly below.
+ *
+ * One would like to simply do: string = string.replace(/(\s)/g, '\$1').
+ * However, the backreference $1 is not a literal string value,
+ * so this method doesn't work.
+ *
+ * Also tried string = string.replace(/(\s)/g, escape('$1'));
+ * but this just inserts the escape of the literal '$1', i.e. '%241'.
+ */
+ string = string.replace(/\n/g, '\\n');
+ string = string.replace(/\r/g, '\\r');
+ string = string.replace(/\t/g, '\\t');
+ string = string.replace(/\v/g, '\\v');
+ string = string.replace(/\f/g, '\\f');
+
+ return (status + MSG_PATTERN + pattern + MSG_STRING + singleQuote(string));
+}
+
+
+/*
+ * If available, arr.toSource() gives more detail than arr.toString()
+ *
+ * var arr = Array(1,2,'3');
+ *
+ * arr.toSource()
+ * [1, 2, "3"]
+ *
+ * arr.toString()
+ * 1,2,3
+ *
+ * But toSource() doesn't exist in Rhino, so use our own imitation, below -
+ *
+ */
+function formatArray(arr)
+{
+ try
+ {
+ return arr.toSource();
+ }
+ catch(e)
+ {
+ return toSource(arr);
+ }
+}
+
+
+/*
+ * Imitate SpiderMonkey's arr.toSource() method:
+ *
+ * a) Double-quote each array element that is of string type
+ * b) Represent |undefined| and |null| by empty strings
+ * c) Delimit elements by a comma + single space
+ * d) Do not add delimiter at the end UNLESS the last element is |undefined|
+ * e) Add square brackets to the beginning and end of the string
+ */
+function toSource(arr)
+{
+ var delim = CHAR_COMMA + CHAR_SPACE;
+ var elt = '';
+ var ret = '';
+ var len = arr.length;
+
+ for (i=0; i<len; i++)
+ {
+ elt = arr[i];
+
+ switch(true)
+ {
+ case (typeof elt === TYPE_STRING) :
+ ret += doubleQuote(elt);
+ break;
+
+ case (elt === undefined || elt === null) :
+ break; // add nothing but the delimiter, below -
+
+ default:
+ ret += elt.toString();
+ }
+
+ if ((i < len-1) || (elt === undefined))
+ ret += delim;
+ }
+
+ return CHAR_LBRACKET + ret + CHAR_RBRACKET;
+}
+
+
+function doubleQuote(text)
+{
+ return CHAR_QT_DBL + text + CHAR_QT_DBL;
+}
+
+
+function singleQuote(text)
+{
+ return CHAR_QT + text + CHAR_QT;
+}
+
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Regress/browser.js b/tests/auto/qml/parserstress/tests/ecma_3/Regress/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Regress/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Regress/regress-385393-04.js b/tests/auto/qml/parserstress/tests/ecma_3/Regress/regress-385393-04.js
new file mode 100755
index 0000000000..6e735fd1d2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Regress/regress-385393-04.js
@@ -0,0 +1,66 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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-385393-04.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 385393;
+var summary = 'Regression test for bug 385393';
+var actual = 'No Crash';
+var expect = 'No Crash';
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ try
+ {
+ 'a'.replace(/a/g, eval);
+ }
+ catch(ex)
+ {
+ }
+
+ reportCompare(expect, actual, summary);
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Regress/regress-419152.js b/tests/auto/qml/parserstress/tests/ecma_3/Regress/regress-419152.js
new file mode 100755
index 0000000000..f57f3a4f98
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Regress/regress-419152.js
@@ -0,0 +1,90 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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): Mike Shaver
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient 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-419152.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 419152;
+var summary = 'Shaver can not contain himself';
+var actual = '';
+var expect = '';
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ var a = [1,2,3];
+
+ a[5] = 6;
+ expect = '1,2,3,,,6:6';
+ actual = a + ':' + a.length;
+ reportCompare(expect, actual, summary + ': 1');
+
+ a = [1,2,3,4];
+ expect = 'undefined';
+ actual = a[-1] + '';
+ reportCompare(expect, actual, summary + ': 2');
+
+ a = [1,2,3];
+ a[-1] = 55;
+
+ expect = 3;
+ actual = a.length;
+ reportCompare(expect, actual, summary + ': 3');
+
+ expect = '1,2,3';
+ actual = a + '';
+ reportCompare(expect, actual, summary + ': 4');
+
+ expect = 55;
+ actual = a[-1];
+ reportCompare(expect, actual, summary + ': 5');
+
+ var s = "abcdef";
+
+ expect = 'undefined';
+ actual = s[-2] + '';
+ reportCompare(expect, actual, summary + ': 6');
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Regress/regress-420087.js b/tests/auto/qml/parserstress/tests/ecma_3/Regress/regress-420087.js
new file mode 100755
index 0000000000..1f21d19739
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Regress/regress-420087.js
@@ -0,0 +1,64 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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): Mike Shaver
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient 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-420087.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 420087;
+var summary = 'Do not assert: PCVCAP_MAKE(sprop->shape, 0, 0) == entry->vcap';
+var actual = 'No Crash';
+var expect = 'No Crash';
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ var dict;
+
+ for (var i = 0; i < 2; i++)
+ dict = {p: 1, q: 1, p:1};
+
+ reportCompare(expect, actual, summary);
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Regress/regress-420610.js b/tests/auto/qml/parserstress/tests/ecma_3/Regress/regress-420610.js
new file mode 100755
index 0000000000..ecd5a2dd42
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Regress/regress-420610.js
@@ -0,0 +1,50 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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-420610.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 420610;
+var summary = 'Do not crash with eval("this.x")';
+var actual = 'No Crash';
+var expect = 'No Crash';
+
+printBugNumber(BUGNUMBER);
+printStatus (summary);
+
+(function(){ eval("this.x") })();
+
+reportCompare(expect, actual, summary);
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Regress/regress-441477-01.js b/tests/auto/qml/parserstress/tests/ecma_3/Regress/regress-441477-01.js
new file mode 100755
index 0000000000..1be199743d
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Regress/regress-441477-01.js
@@ -0,0 +1,73 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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): Jason Orendorff
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient 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-441477-01.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 441477-01;
+var summary = '';
+var actual = 'No Exception';
+var expect = 'No Exception';
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ try
+ {
+ for (i = 0; i < 5;)
+ {
+ if (i > 5)
+ throw "bad";
+ i++;
+ continue;
+ }
+ }
+ catch(ex)
+ {
+ actual = ex + '';
+ }
+ reportCompare(expect, actual, summary);
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Regress/shell.js b/tests/auto/qml/parserstress/tests/ecma_3/Regress/shell.js
new file mode 100644
index 0000000000..8c83369020
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Regress/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'Regress';
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Statements/12.6.3.js b/tests/auto/qml/parserstress/tests/ecma_3/Statements/12.6.3.js
new file mode 100755
index 0000000000..97c3ca3136
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Statements/12.6.3.js
@@ -0,0 +1,80 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_3/Statements/browser.js b/tests/auto/qml/parserstress/tests/ecma_3/Statements/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Statements/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-121744.js b/tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-121744.js
new file mode 100644
index 0000000000..828cc5d8d5
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-121744.js
@@ -0,0 +1,217 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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<UBound; i++)
+ {
+ reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
+ }
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-131348.js b/tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-131348.js
new file mode 100644
index 0000000000..013e114178
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-131348.js
@@ -0,0 +1,184 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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: 10 Apr 2002
+ * Revised: 14 July 2002
+ *
+ * SUMMARY: JS should NOT error on |for(i in undefined)|, |for(i in null)|
+ *
+ * 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
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-131348.js';
+var UBound = 0;
+var BUGNUMBER = 131348;
+var summary = 'JS should not error on |for(i in undefined)|, |for(i in null)|';
+var TEST_PASSED = 'No error';
+var TEST_FAILED = 'An error was generated!!!';
+var status = '';
+var statusitems = [];
+var actual = '';
+var actualvalues = [];
+var expect= '';
+var expectedvalues = [];
+
+
+
+status = inSection(1);
+expect = TEST_PASSED;
+actual = TEST_PASSED;
+try
+{
+ for (var i in undefined)
+ {
+ print(i);
+ }
+}
+catch(e)
+{
+ actual = TEST_FAILED;
+}
+addThis();
+
+
+
+status = inSection(2);
+expect = TEST_PASSED;
+actual = TEST_PASSED;
+try
+{
+ for (var i in null)
+ {
+ print(i);
+ }
+}
+catch(e)
+{
+ actual = TEST_FAILED;
+}
+addThis();
+
+
+
+status = inSection(3);
+expect = TEST_PASSED;
+actual = TEST_PASSED;
+/*
+ * 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)
+{
+ actual = TEST_FAILED;
+}
+addThis();
+
+
+
+status = inSection(4);
+expect = TEST_PASSED;
+actual = TEST_PASSED;
+/*
+ * 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)
+{
+ 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<UBound; i++)
+ {
+ reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
+ }
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-157509.js b/tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-157509.js
new file mode 100644
index 0000000000..0b1319ebba
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-157509.js
@@ -0,0 +1,111 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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):
+ * igor3@apochta.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 for SyntaxError on usage of '\' in identifiers
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=157509
+ *
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-157509.js';
+var UBound = 0;
+var BUGNUMBER = 157509;
+var summary = "Testing for SyntaxError on usage of '\\' in identifiers";
+var TEST_PASSED = 'SyntaxError';
+var TEST_FAILED = 'Generated an error, but NOT a SyntaxError!';
+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;
+/*
+ * OK, this should generate a SyntaxError
+ */
+try
+{
+ eval('var a\\1 = 0;');
+}
+catch(e)
+{
+ if (e instanceof SyntaxError)
+ 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<UBound; i++)
+ {
+ reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
+ }
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-194364.js b/tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-194364.js
new file mode 100644
index 0000000000..a139f2b985
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-194364.js
@@ -0,0 +1,152 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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@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: 21 February 2003
+ * SUMMARY: Testing eval statements containing conditional function expressions
+ *
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=194364
+ *
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-194364.js';
+var UBound = 0;
+var BUGNUMBER = 194364;
+var summary = 'Testing eval statements with conditional function expressions';
+var status = '';
+var statusitems = [];
+var actual = '';
+var actualvalues = [];
+var expect= '';
+var expectedvalues = [];
+
+/*
+ From ECMA-262 Edition 3, 12.4:
+
+ 12.4 Expression Statement
+
+ Syntax
+ ExpressionStatement : [lookahead not in {{, function}] Expression ;
+
+ Note that an ExpressionStatement cannot start with an opening curly brace
+ because that might make it ambiguous with a Block. Also, an ExpressionStatement
+ cannot start with the function keyword because that might make it ambiguous with
+ a FunctionDeclaration.
+*/
+
+status = inSection(1);
+actual = eval('(function() {}); 1');
+expect = 1;
+addThis();
+
+status = inSection(2);
+actual = eval('(function f() {}); 2');
+expect = 2;
+addThis();
+
+status = inSection(3);
+actual = eval('if (true) (function() {}); 3');
+expect = 3;
+addThis();
+
+status = inSection(4);
+actual = eval('if (true) (function f() {}); 4');
+expect = 4;
+addThis();
+
+status = inSection(5);
+actual = eval('if (false) (function() {}); 5');
+expect = 5;
+addThis();
+
+status = inSection(6);
+actual = eval('if (false) (function f() {}); 6');
+expect = 6;
+addThis();
+
+status = inSection(7);
+actual = eval('switch(true) { case true: (function() {}) }; 7');
+expect = 7;
+addThis();
+
+status = inSection(8);
+actual = eval('switch(true) { case true: (function f() {}) }; 8');
+expect = 8;
+addThis();
+
+status = inSection(9);
+actual = eval('switch(false) { case false: (function() {}) }; 9');
+expect = 9;
+addThis();
+
+status = inSection(10);
+actual = eval('switch(false) { case false: (function f() {}) }; 10');
+expect = 10;
+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<UBound; i++)
+ {
+ reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
+ }
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-226517.js b/tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-226517.js
new file mode 100644
index 0000000000..d99bfb503e
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-226517.js
@@ -0,0 +1,112 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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, PhilSchwartau@aol.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 Dec 2003
+ * SUMMARY: |finally| statement should execute even after a |return|
+ *
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=226517
+ *
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-226517.js';
+var UBound = 0;
+var BUGNUMBER = 226517;
+var summary = '|finally| statement should execute even after a |return|';
+var status = '';
+var statusitems = [];
+var actual = '';
+var actualvalues = [];
+var expect= '';
+var expectedvalues = [];
+
+
+/*
+ * We can only use a return statement within a function.
+ * That makes the testcase more complicated to set up -
+ */
+function f()
+{
+ var return_expression_was_calculated = false;
+ try
+ {
+ return (return_expression_was_calculated = true);
+ }
+ finally
+ {
+ actual = return_expression_was_calculated;
+ }
+}
+
+
+status = inSection(1);
+f(); // sets |actual|
+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<UBound; i++)
+ {
+ reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
+ }
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-302439.js b/tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-302439.js
new file mode 100755
index 0000000000..e1ebdb6e30
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-302439.js
@@ -0,0 +1,1368 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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): Silviu Trasca
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient 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-302439.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 302439;
+var summary = 'spandep fu should skip unused JSOP_TABLESWITCH jump table entries';
+var actual = 'No Crash';
+var expect = 'No Crash';
+
+printBugNumber(BUGNUMBER);
+printStatus (summary);
+
+function productList(catID,famID) {
+ clearBox(document.Support_Form.Product_ID);
+
+ switch(parseInt(catID)) {
+
+ case 1 : // Sound Blaster
+ switch(parseInt(famID)) {
+
+ case 434 : // Audigy 4
+ break;
+
+ case 204 : // Audigy 2
+ break;
+
+ case 205 : // Audigy
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Audigy Platinum eX', '45'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Audigy Platinum', '4846'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Audigy LS (SE)', '10365'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Audigy Digital Entertainment', '5085'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Audigy ES', '5086'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 206 : // Live!
+ try { addBoxItem(document.Support_Form.Product_ID, 'Live! 24-bit External', '10702'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Sound Blaster Live! MP3+ 5.1', '573'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Live! 5.1', '50'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Live! Digital Entertainment 5.1 (SE)', '4855'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Live! Platinum 5.1', '572'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Sound Blaster Live! 5.1 Digital (Dell)', '1853'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Live! Platinum', '3203'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Sound Blaster Live! Value', '4856'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Sound Blaster Live!', '4857'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 207 : // Others
+ try { addBoxItem(document.Support_Form.Product_ID, 'Extigy', '585'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Ensoniq AudioPCI', '420'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'PCI4.1 Digital', '681'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Vibra128 4D', '9032'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Digital Music', '154'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Vibra 128', '4851'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Sound Blaster 32', '1844'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'SB AWE64 Digital', '1821'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'SB PCI 5.1', '1828'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Sound Blaster\u00AE', '1841'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Sound Blaster\u00AE 16', '1842'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Sound Blaster 16 Wave Effects', '1843'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Sound Blaster AWE32', '1848'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Sound Blaster AWE64', '1849'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Sound Blaster AWE64 Gold', '1850'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Sound Blaster Microchannels', '1861'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Sound Blaster PCI 128', '1864'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Sound Blaster PCI 64', '1865'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Sound Blaster Pro', '1866'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Sound Blaster Audio PCI', '1559'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 16 : // Accessories
+ try { addBoxItem(document.Support_Form.Product_ID, 'Live!Drive II', '9278'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Sound Blaster MIDI Adapter', '251'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Mini to Standard MIDI Adapter', '252'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+
+ }
+ break;
+
+ case 210 : // Portable Media Players
+ switch(parseInt(famID)) {
+
+ case 211 : // Zen
+ try { addBoxItem(document.Support_Form.Product_ID, 'Zen Portable Media Center', '9882'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 212 : // Accessories
+ try { addBoxItem(document.Support_Form.Product_ID, 'Zen PMC Docking Station', '10756'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Zen PMC Li-ion Polymer Battery', '10679'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Zen PMC FM Wired Remote', '10663'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+
+ }
+ break;
+
+ case 213 : // MP3 Players
+ switch(parseInt(famID)) {
+
+ case 214 : // Zen
+ try { addBoxItem(document.Support_Form.Product_ID, 'Zen Touch', '10274'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Zen Micro', '10795'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Zen', '11519'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Zen Xtra', '9288'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Zen NX', '4836'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Zen USB 2.0', '9019'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Creative NOMAD Jukebox Zen', '117'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 215 : // MuVo
+ try { addBoxItem(document.Support_Form.Product_ID, 'MuVo Micro N200', '10737'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'MuVo\u00B2 X-Trainer', '5080'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'MuVo Slim', '10052'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'MuVo Sport C100', '10794'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'MuVo V200', '10732'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'MuVo TX FM', '9771'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'MuVo USB 2.0', '10919'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'MuVo', '110'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'MuVo NX', '4884'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'MuVo\u00B2', '4908'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'MuVo TX', '9672'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 216 : // Digital MP3 Player
+ try { addBoxItem(document.Support_Form.Product_ID, 'Zen Xtra', '9288'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Rhomba NX', '10302'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'MP3 Player FX120', '11010'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'DXT 200', '4996'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Zen USB 2.0', '9019'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Jukebox 3', '296'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Creative CD-MP3 Slim 600', '1582'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Zen NX', '4836'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'MP3 Player', '4983'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'MP3 Player 2', '4984'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'MP3 Player MX', '4985'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Creative NOMAD Jukebox Zen', '117'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'JukeBox 2', '239'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Creative NOMAD JukeBox', '241'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Creative NOMAD JukeBox C', '242'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Jukebox 10GB', '261'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Creative CD-MP3 M100', '264'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 217 : // Accessories
+ try { addBoxItem(document.Support_Form.Product_ID, 'Zen Micro Battery', '11215'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Universal Travel Adapter for Zen Micro', '11711'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Zen Neeon Stik-On', '12982'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Zen Neeon Universal Travel Adapter', '12979'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Leather Case', '11511'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Zen Neeon Leather Case', '12978'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Home Kit - Jukebox 3', '497'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Creative NOMAD Jukebox 3 Leather Case', '498'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Faceplates - Jukebox 3', '499'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'MuVo Armband', '511'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'NOMAD II MG Wired Remote', '515'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Creative NOMAD Jukebox Accessory Kit', '533'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Creative NOMAD Jukebox Battery Charger Kit', '538'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Creative NOMAD Jukebox Battery Pack', '539'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'NOMAD II MG Travel Cable', '560'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Leather Case - Jukebox 2', '562'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Battery - Jukebox 2', '563'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'MuVo Battery Modules', '999'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'PlayDock PD200', '31'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'TravelSound', '80'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Li-Ion Battery - Jukebox 3', '86'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'FM Wired Remote - Jukebox 3/Jukebox Zen/MuVo\u00B2', '115'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Creative NOMAD Jukebox Power Adapter', '125'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Cassette Adapter Kit', '401'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Car Kit - Jukebox 3/Jukebox 2/Jukebox Zen/MuVo\u00B2', '496'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Battery Pack', '4997'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Battery Modules - MuVo NX / TX / TX FM', '9217'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Armband - MuVo NX / TX / TX FM', '10126'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+
+ }
+ break;
+
+ case 4 : // Speaker Systems
+ switch(parseInt(famID)) {
+
+ case 113 : // 7.1 Systems
+ try { addBoxItem(document.Support_Form.Product_ID, 'Inspire T7700', '5076'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 24 : // 6.1 Systems
+ try { addBoxItem(document.Support_Form.Product_ID, 'Inspire 6.1 6600', '465'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 25 : // 5.1 Systems
+ try { addBoxItem(document.Support_Form.Product_ID, 'Creative Inspire 5.1 5100', '1704'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'PCWorks LX520', '9412'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'I-Trigue 5600', '10736'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Inspire T5900', '10323'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Inspire P5800', '10596'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Desktop Theater 5.1 DTT2200', '428'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Inspire 5.1 5700 Digital', '439'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Creative Inspire 5.1 Digital 5500', '990'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Inspire 5.1 5200', '55'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Creative Inspire 5.1 5300', '238'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'MegaWorks THX 5.1 550', '240'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Desktop Theater 5.1 DTT3500 Digital', '290'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'PlayWorks DTT2500 Digital', '291'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Creative Inspire 5.1 5600', '1705'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Inspire T5400', '5077'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'PlayWorks PS2000 Digital', '427'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Desktop Theater 5.1', '1628'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Desktop Theater 5.1 DTT2500 Digital', '1629'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Cambridge SoundWorks MegaWorks 510D', '478'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 26 : // 4.1 Systems
+ try { addBoxItem(document.Support_Form.Product_ID, 'FPS1600', '47'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'FPS2000 Digital', '297'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Inspire 4.1 4400', '446'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'FPS1800', '424'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'PC-Works FourPointSurround FPS1000', '378'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'FPS1500', '388'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 27 : // 2.1 Systems
+ try { addBoxItem(document.Support_Form.Product_ID, 'I-Trigue 3600', '10735'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Inspire T3000', '10329'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'I-Trigue 3400', '10733'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Inspire G380', '9276'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Creative I-Trigue 3200', '10327'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'PCWorks LX220', '9407'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Creative Inspire 2.1 Slim 2600', '434'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Inspire 2.1 2500', '461'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'I-Trigue L3500', '4912'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'I-Trigue L3450', '4913'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Inspire T2900', '9025'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Inspire P380', '9026'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'SoundWorks SW320', '48'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'MegaWorks THX 2.1 250D', '124'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'I-Trigue 2.1 3300', '139'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Creative SBS 2.1 350 Speakers', '281'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'SBS 370', '283'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'PCWorks', '284'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Creative Inspire Slim 500', '289'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Creative Inspire 2.1 2400', '298'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'SoundWorks Digital', '299'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'SoundWorks SW310', '304'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'I-Trigue i3350', '279'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 28 : // 2.0 Systems
+ try { addBoxItem(document.Support_Form.Product_ID, 'Inspire Monitor M85-D', '4910'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Inspire 2.0 1300', '4918'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'SBS 230 Speakers', '4905'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'SBS52', '1'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'SBS16', '2'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Cambridge SBS20', '3'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'SBS50', '1834'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'SBS10', '1831'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Creative SBS15', '4906'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 29 : // Portable Systems
+ try { addBoxItem(document.Support_Form.Product_ID, 'TravelSound 200', '10164'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'TravelSound MP3', '1874'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'PlayDock PD200', '31'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'TravelSound', '80'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'TravelSound i-300', '9022'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Creative TravelSound MP3 Titanium', '991'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 136 : // Decoders
+ try { addBoxItem(document.Support_Form.Product_ID, 'Decoder DDTS-100', '9468'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 30 : // Accessories
+ try { addBoxItem(document.Support_Form.Product_ID, 'MT-1100 Speaker Stands', '166'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Headphones HQ-1700', '11164'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Headphones HQ-1300', '4936'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Headphones HN-505', '4938'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Backphones HQ-65', '4916'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Backphones HQ-60', '4937'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Earphones EP-880', '11156'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Earphones EP-480', '11708'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Headset HE-100', '11023'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Headset HS-300', '4939'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'MT-1200 Speaker Stands', '9515'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'SurroundStation', '32'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Creative HQ-2000 Headphones', '4'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'MT-500 Speaker Tripods', '399'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Inspire 2600 Spkr Grilles', '636'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Inspire 5300 Spkr Grilles', '637'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Inspire 5700 Spkr Grilles', '664'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Creative HQ-1000 Headphones', '4988'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+
+ }
+ break;
+
+ case 218 : // Web Cameras
+ switch(parseInt(famID)) {
+
+ case 219 : // WebCam
+ try { addBoxItem(document.Support_Form.Product_ID, 'WebCam Live! Ultra for Notebooks', '11491'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'WebCam Live! Ultra', '10451'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'WebCam Live! Pro', '10450'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'WebCam Live!', '10412'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'WebCam Instant', '10410'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'WebCam NX Ultra', '9340'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'WebCam NX Pro', '628'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'WebCam NX', '627'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'WebCam PRO eX', '243'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'WebCam PRO', '616'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'WebCam Go Plus', '15'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Webcam Go ES', '1898'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'WebCam Go Mini', '1900'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'WebCam Go', '17'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Video Blaster WebCam Plus', '16'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'WebCam Notebook', '629'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'WebCam Mobile', '4890'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'WebCam 5', '1896'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'WebCam Vista Pro', '11053'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'WebCam Vista Plus', '11043'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'WebCam', '65'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'WebCam II', '4900'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'WebCam 3', '1908'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'WebCam Vista', '1907'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 220 : // PC-CAM
+ try { addBoxItem(document.Support_Form.Product_ID, 'PC-CAM 900', '10119'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'PC-CAM 930 Slim', '11431'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'PC-CAM 920 Slim', '10823'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'PC-CAM 880', '308'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'PC-CAM 750', '4878'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'PC-CAM 850', '4879'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Creative PC-CAM 300', '49'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'PC-CAM 350', '106'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'PC-CAM 550', '107'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'CardCam Value', '116'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'PC-CAM 600', '260'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+
+ }
+ break;
+
+ case 437 : // Headphones &amp; Headsets
+ switch(parseInt(famID)) {
+
+ case 438 : // Headphones
+ try { addBoxItem(document.Support_Form.Product_ID, 'Headphones HQ-1700', '11164'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Headphones HQ-1300', '4936'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Headphones CB2530', '11644'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 439 : // Noise-Cancelling Headphones
+ try { addBoxItem(document.Support_Form.Product_ID, 'Headphones HN-505', '4938'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 440 : // Backphones
+ try { addBoxItem(document.Support_Form.Product_ID, 'Backphones HQ-65', '4916'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Backphones HQ-60', '4937'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 441 : // Earphones
+ try { addBoxItem(document.Support_Form.Product_ID, 'Earphones EP-880', '11156'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Earphones EP-630', '11397'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Earphones EP-480', '11708'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Earphones EP-380', '11229'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 442 : // Headsets
+ try { addBoxItem(document.Support_Form.Product_ID, 'Headset HE-100', '11023'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Headset HS-300', '4939'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+
+ }
+ break;
+
+ case 9 : // Storage Devices
+ switch(parseInt(famID)) {
+
+ case 259 : // DVD±RW Drive
+ try { addBoxItem(document.Support_Form.Product_ID, 'DVD±RW Dual 8X', '9599'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'DVD±RW Dual 8x8', '10305'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'DVD+RW Dual External 8x8', '10583'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 47 : // Combo Drive
+ try { addBoxItem(document.Support_Form.Product_ID, 'Combo Drive 52.32.52x/16x', '11712'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Combo Drive 40-12-40/16', '4998'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Combo Drive NS', '9454'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 46 : // CD-RW Drive
+ try { addBoxItem(document.Support_Form.Product_ID, 'CD-RW External 52-32-52x', '9481'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'CD-RW Blaster 12-10-32', '8'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'CD-RW 52.24.52', '1590'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'CD-RW Blaster 24-10-40 External', '4944'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'CD-RW External 52-24-52x', '9027'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'CD-RW 52-32-52x', '9453'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'CD-RW Blaster 48-12-48 External', '9020'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'CD-RW Blaster 48-12-48', '4941'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 45 : // PC-DVD Drive
+ try { addBoxItem(document.Support_Form.Product_ID, 'PC-DVD Encore 12x', '6'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'PC-DVD ROM 12x', '1486'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'PC-DVD DVD-ROM 16x', '1490'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'PC-DVD MPEG-1 Decoder Board', '1801'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 44 : // CD-ROM Drive
+ try { addBoxItem(document.Support_Form.Product_ID, 'CD-ROM Blaster Digital iR52X', '3562'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'CD-ROM Blaster 52X', '11'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, '12x CD-ROM Drives', '1485'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, '16x CD-ROM Drives', '1489'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, '48x CD-ROM Drives', '1548'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, '1x & 2x CD-ROM Drives', '1493'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, '24x CD-ROM Drives', '1495'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, '2x & 3x CD-ROM (SCSI)', '1496'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, '32x CD-ROM Drives', '1498'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, '36x CD-ROM Drives', '1499'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, '40x CD-Rom Drives', '1547'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, '4x CD-ROM Drives', '1549'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, '6x CD-ROM Drives', '1552'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, '8x CD-ROM Drives', '1554'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 49 : // Portable Harddisk
+ try { addBoxItem(document.Support_Form.Product_ID, 'Storage Blaster Portable Harddisk', '8996'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 265 : // Portable Storage
+ try { addBoxItem(document.Support_Form.Product_ID, 'ThumbDrive', '10681'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+
+ }
+ break;
+
+ case 12 : // PC Barebone
+ switch(parseInt(famID)) {
+
+ case 54 : // SLiX PC
+ try { addBoxItem(document.Support_Form.Product_ID, 'SLiX PC MPC61Y0', '11766'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+
+ }
+ break;
+
+ case 11 : // Monitors
+ switch(parseInt(famID)) {
+
+ case 53 : // LCD
+ try { addBoxItem(document.Support_Form.Product_ID, '17" TFT LCD Monitor With DVI', '9980'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+
+ }
+ break;
+
+ case 60 : // Video
+ switch(parseInt(famID)) {
+
+ case 96 : // Video Editing
+ try { addBoxItem(document.Support_Form.Product_ID, 'Video Blaster MovieMaker', '13'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+
+ }
+ break;
+
+ case 13 : // Accessories
+ switch(parseInt(famID)) {
+
+ case 55 : // Sound Blaster
+ try { addBoxItem(document.Support_Form.Product_ID, 'Optical Digital I/O Card II', '30'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Sound Blaster MIDI Adapter', '251'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Mini to Standard MIDI Adapter', '252'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Live!Drive II', '9278'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Sound Blaster Audigy Internal Drive', '88'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Sound Blaster Audigy External Drive', '89'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Live! Drive IR', '26'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Live! Drive I', '27'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Remote Controller SBLive', '1816'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 449 : // Zen Micro
+ try { addBoxItem(document.Support_Form.Product_ID, 'Universal Travel Adapter for Zen Micro', '11711'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Leather Case', '11511'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 483 : // Zen Neeon
+ try { addBoxItem(document.Support_Form.Product_ID, 'Zen Neeon Stik-On', '12982'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Zen Neeon Leather Case', '12978'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Zen Neeon Universal Travel Adapter', '12979'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 264 : // Portable Media Center
+ try { addBoxItem(document.Support_Form.Product_ID, 'Zen PMC Docking Station', '10756'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Zen PMC Li-ion Polymer Battery', '10679'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Zen PMC FM Wired Remote', '10663'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 57 : // MP3 Players
+ try { addBoxItem(document.Support_Form.Product_ID, 'Creative NOMAD JukeBox 3 Car Kit', '4894'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Home Kit - Jukebox 3', '497'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Creative NOMAD Jukebox 3 Leather Case', '498'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Faceplates - Jukebox 3', '499'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'MuVo Armband', '511'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Creative NOMAD Jukebox Accessory Kit', '533'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Creative NOMAD Jukebox Battery Charger Kit', '538'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Creative NOMAD Jukebox Battery Pack', '539'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Leather Case - Jukebox 2', '562'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Battery - Jukebox 2', '563'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Li-Ion Battery - Jukebox 3', '86'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'FM Wired Remote - Jukebox 3/Jukebox Zen/MuVo\u00B2', '115'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Creative NOMAD Jukebox Power Adapter', '125'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Cassette Adapter Kit', '401'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Car Kit - Jukebox 3/Jukebox 2/Jukebox Zen/MuVo\u00B2', '496'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Battery Modules - MuVo NX / TX / TX FM', '9217'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Armband - MuVo NX / TX / TX FM', '10126'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 58 : // Speaker Systems
+ try { addBoxItem(document.Support_Form.Product_ID, 'MT-1100 Speaker Stands', '166'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Headphones HQ-1700', '11164'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Earphones EP-880', '11156'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Headset HE-100', '11023'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'MT-500 Speaker Tripods', '399'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Speaker Extension Cables', '415'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Inspire 5300 Spkr Grilles', '637'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Inspire 5700 Spkr Grilles', '664'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 256 : // Wireless
+ try { addBoxItem(document.Support_Form.Product_ID, 'Wireless Headset for Bluetooth', '10287'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Headset CB2455', '11394'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Headphones CB2530', '11644'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 59 : // Storage
+ try { addBoxItem(document.Support_Form.Product_ID, 'S-Video Cable Coupler', '250'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'IDE Cable Set', '255'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Dxr2 Decoder Board', '1648'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Dxr3 Decoder Card', '12'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+
+ }
+ break;
+
+ case 118 : // Digital Cameras
+ switch(parseInt(famID)) {
+
+ case 117 : // Digital Still Cameras
+ try { addBoxItem(document.Support_Form.Product_ID, 'DC-CAM 4200ZS', '10822'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'DC-CAM 3200Z', '9762'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'DC-CAM 3000Z', '9028'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'CardCam', '120'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'CardCam Value', '116'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 309 : // Digital Video Cameras
+ try { addBoxItem(document.Support_Form.Product_ID, 'DiVi CAM 316', '11175'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+
+ }
+ break;
+
+ case 10 : // Mice & Keyboards
+ switch(parseInt(famID)) {
+
+ case 223 : // Wired Mice
+ try { addBoxItem(document.Support_Form.Product_ID, 'Mouse 5500', '11387'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Mouse 3500', '11388'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Mouse Classic', '4919'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Mouse Optical Lite', '4920'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Mouse Optical 3000', '4924'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Creative Optical Mouse', '262'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Mouse Notebook Optical', '9147'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 224 : // Wireless Mice
+ try { addBoxItem(document.Support_Form.Product_ID, 'FreePoint Travel', '11165'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'FreePoint Travel Mini', '11166'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'FreePoint 5500', '11178'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'FreePoint 3500', '11386'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Mouse Wireless Optical 5000', '9145'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Mouse Wireless Optical', '263'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Mouse Wireless Optical 3000', '4923'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 227 : // Wireless Mice & Keyboards
+ try { addBoxItem(document.Support_Form.Product_ID, 'Desktop Wireless 9000 Pro', '11493'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Desktop Wireless 8000', '10104'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Desktop Wireless 6000', '5039'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 228 : // Wired PC & MIDI Keyboards
+ try { addBoxItem(document.Support_Form.Product_ID, 'Prodikeys DM', '9389'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Prodikeys DM Value', '9600'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Prodikeys', '504'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 52 : // Gaming Devices
+ try { addBoxItem(document.Support_Form.Product_ID, 'Avant Force NX', '9394'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Cobra Force 3D', '9396'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Gamepad I', '1658'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+
+ }
+ break;
+
+ case 8 : // Musical Keyboards
+ switch(parseInt(famID)) {
+
+ case 234 : // PC & MIDI Keyboards
+ try { addBoxItem(document.Support_Form.Product_ID, 'Prodikeys DM', '9389'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Prodikeys DM Value', '9600'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Prodikeys', '504'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 231 : // MIDI Keyboards
+ try { addBoxItem(document.Support_Form.Product_ID, 'Creative Blasterkeys', '40'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+
+ }
+ break;
+
+ case 237 : // Creative Professional
+ switch(parseInt(famID)) {
+
+ case 239 : // Digital Audio Systems
+ try { addBoxItem(document.Support_Form.Product_ID, 'E-MU 1820M', '10496'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'E-MU 1212M', '10500'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'E-MU 1820', '10494'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'E-MU 0404', '10498'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 240 : // Desktop Sampling Systems
+ try { addBoxItem(document.Support_Form.Product_ID, 'Emulator X', '10502'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Emulator X Studio', '10504'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Proteus X', '11074'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 421 : // Desktop Sound Modules
+ try { addBoxItem(document.Support_Form.Product_ID, 'Proteus X', '11074'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 258 : // Accessories and Upgrades
+ try { addBoxItem(document.Support_Form.Product_ID, 'Proteus X Software Upgrade', '11073'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Emulator X OS Upgrade', '10225'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Mo\'Phatt X', '11329'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Planet Earth X', '11330'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Virtuoso X', '11332'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Vintage X Pro Collection', '11072'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Street Kits', '11331'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'AudioDock M', '10229'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Audio Dock', '10230'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Beat Shop 2', '10404'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'EDI Cable', '10227'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Sync Daughter Card', '10576'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+
+ }
+ break;
+
+ case 243 : // Wireless
+ switch(parseInt(famID)) {
+
+ case 246 : // Mice & Keyboards
+ try { addBoxItem(document.Support_Form.Product_ID, 'FreePoint 5500', '11178'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'FreePoint 3500', '11386'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Mouse Wireless Optical 5000', '9145'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Desktop Wireless 8000', '10104'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Desktop Wireless 6000', '5039'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Mouse Wireless Optical', '263'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Mouse Wireless Optical 3000', '4923'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 248 : // Accessories
+ try { addBoxItem(document.Support_Form.Product_ID, 'Headset CB2460', '11238'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Headset CB2455', '11394'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Wireless Headset for Bluetooth', '10287'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Headphones CB2530', '11644'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+
+ }
+ break;
+
+ case 244 : // Notebook Products
+ switch(parseInt(famID)) {
+
+ case 250 : // PCMCIA Sound Blaster
+ try { addBoxItem(document.Support_Form.Product_ID, 'Audigy 2 ZS Notebook', '10769'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 249 : // USB Sound Blaster
+ try { addBoxItem(document.Support_Form.Product_ID, 'Audigy 2 NX', '9103'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Live! 24-bit External', '10702'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Digital Music LX', '10246'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Digital Music', '154'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Extigy', '585'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 251 : // Portable Speaker Systems
+ try { addBoxItem(document.Support_Form.Product_ID, 'TravelSound 200', '10164'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'TravelSound i-300', '9022'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'TravelSound MP3', '1874'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 252 : // Mice & Keyboards
+ try { addBoxItem(document.Support_Form.Product_ID, 'Mouse Wireless NoteBook Optical', '10188'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Mouse Notebook Optical', '9147'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 253 : // Web Cameras
+ try { addBoxItem(document.Support_Form.Product_ID, 'WebCam Live! Ultra for Notebooks', '11491'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'WebCam Notebook', '629'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'WebCam Mobile', '4890'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+
+ }
+ break;
+
+ case 6 : // Graphics
+ switch(parseInt(famID)) {
+
+ case 37 : // ATI Radeon 9000 series
+ try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster RX9250', '11489'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster RX9250 Xtreme', '11490'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 230 : // 3D Labs
+ try { addBoxItem(document.Support_Form.Product_ID, 'Graphics Blaster Picture Perfect', '164'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 99 : // NVIDIA GeForce
+ try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster GeForce', '1500'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster GeForce 2', '1501'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster GeForce Pro', '1505'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster GeForce2 ULTRA 64MB AGP', '1512'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 98 : // NVIDIA Riva TNT Series
+ try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster RIVA TNT2 Pro', '1527'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Graphics Blaster RIVA128ZX', '1689'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster Riva TNT2', '4841'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster RIVA TNT2 Value', '4842'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster TNT2 Ultra', '4843'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 73 : // 3D Blaster
+ try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster 4 Titanium 4200', '1516'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster 5 RX9700 Pro', '1524'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster 4 MX440', '1539'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster 5 RX9000 64MB', '1540'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster 5 RX9000 Pro', '1541'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster 4 MX420', '4869'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster 5 RX9800 Pro', '4917'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster 4 MX460', '4969'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster 5 RX9600', '4973'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster 5 RX9000 Pro 128MB', '8995'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster 5 RX9200 SE', '9024'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster 5 RX9600 Pro', '9576'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster 5 RX9600 XT', '10311'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster 5 RX9600 SE', '10335'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster Savage 4', '1536'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster VLB', '1537'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster Voodoo 2', '1538'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster PCI', '1523'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster Banshee', '1506'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, '3D Blaster Banshee AGP', '1507'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+
+ }
+ break;
+
+ case 7 : // Modems & Networking
+ switch(parseInt(famID)) {
+
+ case 41 : // Wireless
+ try { addBoxItem(document.Support_Form.Product_ID, 'USB Adapter CB2431', '10863'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Network Blaster Wireless PCMCIA Card', '3868'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 42 : // Broadband
+ try { addBoxItem(document.Support_Form.Product_ID, 'Broadband Blaster DSL Router 8015U', '11176'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Broadband Blaster Router 8110', '10280'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Broadband Blaster ADSL Bridge ', '4873'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Broadband Blaster USB Modem', '4871'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Broadband Blaster DSL', '4921'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 40 : // Analog
+ try { addBoxItem(document.Support_Form.Product_ID, 'Modem Blaster PCMCIA', '24'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Modem Blaster V.92 PCI', '52'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Modem Blaster V.92 Serial', '258'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Modem Blaster V.92 USB', '266'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Modem 56k Internal', '1715'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Modem Blaster Flash 56II ISA', '18'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Modem Blaster V.90 ISA', '19'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Modem Blaster Flash 56 PCI', '21'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Modem Blaster V.90 USB', '22'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Modem Blaster V.90 External', '23'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Modem Blaster USB (DE5675)', '8992'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Modem Blaster USB (DE5673)', '8991'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Modem Blaster PCI (DI5663)', '4999'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Modem Blaster PCI (DI5656)', '8988'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Modem Blaster PCI (DI5655)', '8989'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Modem Blaster External (DE5625)', '8990'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Modem Blaster 28.8 External', '5000'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'CT5451 Modem Blaster Voice PnP', '5001'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'Phone Blaster', '1809'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+
+ }
+ break;
+
+ case 106 : // Software
+ switch(parseInt(famID)) {
+
+ case 241 : // HansVision DXT
+ try { addBoxItem(document.Support_Form.Product_ID, 'HansVision DXT 2005 Edition', '12218'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 242 : // Children\'s Multimedia Educational
+ try { addBoxItem(document.Support_Form.Product_ID, 'WaWaYaYa Happy Mandarin Series', '11269'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ try { addBoxItem(document.Support_Form.Product_ID, 'WaWaYaYa Happy English Series', '4932'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 107 : // HansVision
+ try { addBoxItem(document.Support_Form.Product_ID, 'HansVision DXT', '4928'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 108 : // WaWaYaYa
+ try { addBoxItem(document.Support_Form.Product_ID, 'WaWaYaYa Comprehensive Ability Series', '4930'); } catch(e) {addBoxItem(document.Support_Form.Product_ID, '1', '2'); } //
+
+ break;
+
+ case 109 : // Others
+
+ break;
+
+
+ }
+ break;
+
+ }
+ // addBoxItem(document.Support_Form.Product_ID, 'Zen Portable Media Center', 'DUMMYPREFIX_ZenPMC_Temp|9882');
+}
+
+try
+{
+ productList(0,0);
+}
+catch(e)
+{
+}
+
+reportCompare(expect, actual, summary);
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-324650.js b/tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-324650.js
new file mode 100755
index 0000000000..003cd0fa42
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-324650.js
@@ -0,0 +1,5461 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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): Philipp Vogt
+ * 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 = 'regress-324650.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 324650;
+var summary = 'Switch Statement with many cases';
+var actual = 'No Hang';
+var expect = 'No Hang';
+
+printBugNumber(BUGNUMBER);
+printStatus (summary);
+
+var notevil = "z1";
+var notevil2 = "z2";
+var notevil3 = "z3";
+var dut = 7;
+var dut2 = 7;
+var dut3 = 7;
+
+/* shouldn't be evil */
+
+switch ( notevil ) {
+case "z1": dut = 2;
+ break;
+case "z2":
+ notevil = (notevil + 2)/2;
+ break;
+case "z3":
+ notevil = (notevil + 3)/2;
+ break;
+case "z4":
+ notevil = (notevil + 4)/2;
+ break;
+case "z5":
+ notevil = (notevil + 5)/2;
+ break;
+case "z6":
+ notevil = (notevil + 6)/2;
+ break;
+case "z7":
+ notevil = (notevil + 7)/2;
+ break;
+case "z8":
+ notevil = (notevil + 8)/2;
+ break;
+case "z9":
+ notevil = (notevil + 9)/2;
+ break;
+case "z10":
+ notevil = (notevil + 10)/2;
+ break;
+case "z11":
+ notevil = (notevil + 11)/2;
+ break;
+case "z12":
+ notevil = (notevil + 12)/2;
+ break;
+case "z13":
+ notevil = (notevil + 13)/2;
+ break;
+case "z14":
+ notevil = (notevil + 14)/2;
+ break;
+case "z15":
+ notevil = (notevil + 15)/2;
+ break;
+case "z16":
+ notevil = (notevil + 16)/2;
+ break;
+case "z17":
+ notevil = (notevil + 17)/2;
+ break;
+case "z18":
+ notevil = (notevil + 18)/2;
+ break;
+case "z19":
+ notevil = (notevil + 19)/2;
+ break;
+case "z20":
+ notevil = (notevil + 20)/2;
+ break;
+case "z21":
+ notevil = (notevil + 21)/2;
+ break;
+case "z22":
+ notevil = (notevil + 22)/2;
+ break;
+case "z23":
+ notevil = (notevil + 23)/2;
+ break;
+case "z24":
+ notevil = (notevil + 24)/2;
+ break;
+case "z25":
+ notevil = (notevil + 25)/2;
+ break;
+case "z26":
+ notevil = (notevil + 26)/2;
+ break;
+case "z27":
+ notevil = (notevil + 27)/2;
+ break;
+case "z28":
+ notevil = (notevil + 28)/2;
+ break;
+case "z29":
+ notevil = (notevil + 29)/2;
+ break;
+case "z30":
+ notevil = (notevil + 30)/2;
+ break;
+case "z31":
+ notevil = (notevil + 31)/2;
+ break;
+case "z32":
+ notevil = (notevil + 32)/2;
+ break;
+case "z33":
+ notevil = (notevil + 33)/2;
+ break;
+case "z34":
+ notevil = (notevil + 34)/2;
+ break;
+case "z35":
+ notevil = (notevil + 35)/2;
+ break;
+case "z36":
+ notevil = (notevil + 36)/2;
+ break;
+case "z37":
+ notevil = (notevil + 37)/2;
+ break;
+case "z38":
+ notevil = (notevil + 38)/2;
+ break;
+case "z39":
+ notevil = (notevil + 39)/2;
+ break;
+case "z40":
+ notevil = (notevil + 40)/2;
+ break;
+case "z41":
+ notevil = (notevil + 41)/2;
+ break;
+case "z42":
+ notevil = (notevil + 42)/2;
+ break;
+case "z43":
+ notevil = (notevil + 43)/2;
+ break;
+case "z44":
+ notevil = (notevil + 44)/2;
+ break;
+case "z45":
+ notevil = (notevil + 45)/2;
+ break;
+case "z46":
+ notevil = (notevil + 46)/2;
+ break;
+case "z47":
+ notevil = (notevil + 47)/2;
+ break;
+case "z48":
+ notevil = (notevil + 48)/2;
+ break;
+case "z49":
+ notevil = (notevil + 49)/2;
+ break;
+case "z50":
+ notevil = (notevil + 50)/2;
+ break;
+case "z51":
+ notevil = (notevil + 51)/2;
+ break;
+case "z52":
+ notevil = (notevil + 52)/2;
+ break;
+case "z53":
+ notevil = (notevil + 53)/2;
+ break;
+case "z54":
+ notevil = (notevil + 54)/2;
+ break;
+case "z55":
+ notevil = (notevil + 55)/2;
+ break;
+case "z56":
+ notevil = (notevil + 56)/2;
+ break;
+case "z57":
+ notevil = (notevil + 57)/2;
+ break;
+case "z58":
+ notevil = (notevil + 58)/2;
+ break;
+case "z59":
+ notevil = (notevil + 59)/2;
+ break;
+case "z60":
+ notevil = (notevil + 60)/2;
+ break;
+case "z61":
+ notevil = (notevil + 61)/2;
+ break;
+case "z62":
+ notevil = (notevil + 62)/2;
+ break;
+case "z63":
+ notevil = (notevil + 63)/2;
+ break;
+case "z64":
+ notevil = (notevil + 64)/2;
+ break;
+case "z65":
+ notevil = (notevil + 65)/2;
+ break;
+case "z66":
+ notevil = (notevil + 66)/2;
+ break;
+case "z67":
+ notevil = (notevil + 67)/2;
+ break;
+case "z68":
+ notevil = (notevil + 68)/2;
+ break;
+case "z69":
+ notevil = (notevil + 69)/2;
+ break;
+case "z70":
+ notevil = (notevil + 70)/2;
+ break;
+case "z71":
+ notevil = (notevil + 71)/2;
+ break;
+case "z72":
+ notevil = (notevil + 72)/2;
+ break;
+case "z73":
+ notevil = (notevil + 73)/2;
+ break;
+case "z74":
+ notevil = (notevil + 74)/2;
+ break;
+case "z75":
+ notevil = (notevil + 75)/2;
+ break;
+case "z76":
+ notevil = (notevil + 76)/2;
+ break;
+case "z77":
+ notevil = (notevil + 77)/2;
+ break;
+case "z78":
+ notevil = (notevil + 78)/2;
+ break;
+case "z79":
+ notevil = (notevil + 79)/2;
+ break;
+case "z80":
+ notevil = (notevil + 80)/2;
+ break;
+case "z81":
+ notevil = (notevil + 81)/2;
+ break;
+case "z82":
+ notevil = (notevil + 82)/2;
+ break;
+case "z83":
+ notevil = (notevil + 83)/2;
+ break;
+case "z84":
+ notevil = (notevil + 84)/2;
+ break;
+case "z85":
+ notevil = (notevil + 85)/2;
+ break;
+case "z86":
+ notevil = (notevil + 86)/2;
+ break;
+case "z87":
+ notevil = (notevil + 87)/2;
+ break;
+case "z88":
+ notevil = (notevil + 88)/2;
+ break;
+case "z89":
+ notevil = (notevil + 89)/2;
+ break;
+case "z90":
+ notevil = (notevil + 90)/2;
+ break;
+case "z91":
+ notevil = (notevil + 91)/2;
+ break;
+case "z92":
+ notevil = (notevil + 92)/2;
+ break;
+case "z93":
+ notevil = (notevil + 93)/2;
+ break;
+case "z94":
+ notevil = (notevil + 94)/2;
+ break;
+case "z95":
+ notevil = (notevil + 95)/2;
+ break;
+case "z96":
+ notevil = (notevil + 96)/2;
+ break;
+case "z97":
+ notevil = (notevil + 97)/2;
+ break;
+case "z98":
+ notevil = (notevil + 98)/2;
+ break;
+case "z99":
+ notevil = (notevil + 99)/2;
+ break;
+case "z100":
+ notevil = (notevil + 100)/2;
+ break;
+case "z101":
+ notevil = (notevil + 101)/2;
+ break;
+case "z102":
+ notevil = (notevil + 102)/2;
+ break;
+case "z103":
+ notevil = (notevil + 103)/2;
+ break;
+case "z104":
+ notevil = (notevil + 104)/2;
+ break;
+case "z105":
+ notevil = (notevil + 105)/2;
+ break;
+case "z106":
+ notevil = (notevil + 106)/2;
+ break;
+case "z107":
+ notevil = (notevil + 107)/2;
+ break;
+case "z108":
+ notevil = (notevil + 108)/2;
+ break;
+case "z109":
+ notevil = (notevil + 109)/2;
+ break;
+case "z110":
+ notevil = (notevil + 110)/2;
+ break;
+case "z111":
+ notevil = (notevil + 111)/2;
+ break;
+case "z112":
+ notevil = (notevil + 112)/2;
+ break;
+case "z113":
+ notevil = (notevil + 113)/2;
+ break;
+case "z114":
+ notevil = (notevil + 114)/2;
+ break;
+case "z115":
+ notevil = (notevil + 115)/2;
+ break;
+case "z116":
+ notevil = (notevil + 116)/2;
+ break;
+case "z117":
+ notevil = (notevil + 117)/2;
+ break;
+case "z118":
+ notevil = (notevil + 118)/2;
+ break;
+case "z119":
+ notevil = (notevil + 119)/2;
+ break;
+case "z120":
+ notevil = (notevil + 120)/2;
+ break;
+case "z121":
+ notevil = (notevil + 121)/2;
+ break;
+case "z122":
+ notevil = (notevil + 122)/2;
+ break;
+case "z123":
+ notevil = (notevil + 123)/2;
+ break;
+case "z124":
+ notevil = (notevil + 124)/2;
+ break;
+case "z125":
+ notevil = (notevil + 125)/2;
+ break;
+case "z126":
+ notevil = (notevil + 126)/2;
+ break;
+case "z127":
+ notevil = (notevil + 127)/2;
+ break;
+case "z128":
+ notevil = (notevil + 128)/2;
+ break;
+case "z129":
+ notevil = (notevil + 129)/2;
+ break;
+case "z130":
+ notevil = (notevil + 130)/2;
+ break;
+case "z131":
+ notevil = (notevil + 131)/2;
+ break;
+case "z132":
+ notevil = (notevil + 132)/2;
+ break;
+case "z133":
+ notevil = (notevil + 133)/2;
+ break;
+case "z134":
+ notevil = (notevil + 134)/2;
+ break;
+case "z135":
+ notevil = (notevil + 135)/2;
+ break;
+case "z136":
+ notevil = (notevil + 136)/2;
+ break;
+case "z137":
+ notevil = (notevil + 137)/2;
+ break;
+case "z138":
+ notevil = (notevil + 138)/2;
+ break;
+case "z139":
+ notevil = (notevil + 139)/2;
+ break;
+case "z140":
+ notevil = (notevil + 140)/2;
+ break;
+case "z141":
+ notevil = (notevil + 141)/2;
+ break;
+case "z142":
+ notevil = (notevil + 142)/2;
+ break;
+case "z143":
+ notevil = (notevil + 143)/2;
+ break;
+case "z144":
+ notevil = (notevil + 144)/2;
+ break;
+case "z145":
+ notevil = (notevil + 145)/2;
+ break;
+case "z146":
+ notevil = (notevil + 146)/2;
+ break;
+case "z147":
+ notevil = (notevil + 147)/2;
+ break;
+case "z148":
+ notevil = (notevil + 148)/2;
+ break;
+case "z149":
+ notevil = (notevil + 149)/2;
+ break;
+case "z150":
+ notevil = (notevil + 150)/2;
+ break;
+case "z151":
+ notevil = (notevil + 151)/2;
+ break;
+case "z152":
+ notevil = (notevil + 152)/2;
+ break;
+case "z153":
+ notevil = (notevil + 153)/2;
+ break;
+case "z154":
+ notevil = (notevil + 154)/2;
+ break;
+case "z155":
+ notevil = (notevil + 155)/2;
+ break;
+case "z156":
+ notevil = (notevil + 156)/2;
+ break;
+case "z157":
+ notevil = (notevil + 157)/2;
+ break;
+case "z158":
+ notevil = (notevil + 158)/2;
+ break;
+case "z159":
+ notevil = (notevil + 159)/2;
+ break;
+case "z160":
+ notevil = (notevil + 160)/2;
+ break;
+case "z161":
+ notevil = (notevil + 161)/2;
+ break;
+case "z162":
+ notevil = (notevil + 162)/2;
+ break;
+case "z163":
+ notevil = (notevil + 163)/2;
+ break;
+case "z164":
+ notevil = (notevil + 164)/2;
+ break;
+case "z165":
+ notevil = (notevil + 165)/2;
+ break;
+case "z166":
+ notevil = (notevil + 166)/2;
+ break;
+case "z167":
+ notevil = (notevil + 167)/2;
+ break;
+case "z168":
+ notevil = (notevil + 168)/2;
+ break;
+case "z169":
+ notevil = (notevil + 169)/2;
+ break;
+case "z170":
+ notevil = (notevil + 170)/2;
+ break;
+case "z171":
+ notevil = (notevil + 171)/2;
+ break;
+case "z172":
+ notevil = (notevil + 172)/2;
+ break;
+case "z173":
+ notevil = (notevil + 173)/2;
+ break;
+case "z174":
+ notevil = (notevil + 174)/2;
+ break;
+case "z175":
+ notevil = (notevil + 175)/2;
+ break;
+case "z176":
+ notevil = (notevil + 176)/2;
+ break;
+case "z177":
+ notevil = (notevil + 177)/2;
+ break;
+case "z178":
+ notevil = (notevil + 178)/2;
+ break;
+case "z179":
+ notevil = (notevil + 179)/2;
+ break;
+case "z180":
+ notevil = (notevil + 180)/2;
+ break;
+case "z181":
+ notevil = (notevil + 181)/2;
+ break;
+case "z182":
+ notevil = (notevil + 182)/2;
+ break;
+case "z183":
+ notevil = (notevil + 183)/2;
+ break;
+case "z184":
+ notevil = (notevil + 184)/2;
+ break;
+case "z185":
+ notevil = (notevil + 185)/2;
+ break;
+case "z186":
+ notevil = (notevil + 186)/2;
+ break;
+case "z187":
+ notevil = (notevil + 187)/2;
+ break;
+case "z188":
+ notevil = (notevil + 188)/2;
+ break;
+case "z189":
+ notevil = (notevil + 189)/2;
+ break;
+case "z190":
+ notevil = (notevil + 190)/2;
+ break;
+case "z191":
+ notevil = (notevil + 191)/2;
+ break;
+case "z192":
+ notevil = (notevil + 192)/2;
+ break;
+case "z193":
+ notevil = (notevil + 193)/2;
+ break;
+case "z194":
+ notevil = (notevil + 194)/2;
+ break;
+case "z195":
+ notevil = (notevil + 195)/2;
+ break;
+case "z196":
+ notevil = (notevil + 196)/2;
+ break;
+case "z197":
+ notevil = (notevil + 197)/2;
+ break;
+case "z198":
+ notevil = (notevil + 198)/2;
+ break;
+case "z199":
+ notevil = (notevil + 199)/2;
+ break;
+case "z200":
+ notevil = (notevil + 200)/2;
+ break;
+case "z201":
+ notevil = (notevil + 201)/2;
+ break;
+case "z202":
+ notevil = (notevil + 202)/2;
+ break;
+case "z203":
+ notevil = (notevil + 203)/2;
+ break;
+case "z204":
+ notevil = (notevil + 204)/2;
+ break;
+case "z205":
+ notevil = (notevil + 205)/2;
+ break;
+case "z206":
+ notevil = (notevil + 206)/2;
+ break;
+case "z207":
+ notevil = (notevil + 207)/2;
+ break;
+case "z208":
+ notevil = (notevil + 208)/2;
+ break;
+case "z209":
+ notevil = (notevil + 209)/2;
+ break;
+case "z210":
+ notevil = (notevil + 210)/2;
+ break;
+case "z211":
+ notevil = (notevil + 211)/2;
+ break;
+case "z212":
+ notevil = (notevil + 212)/2;
+ break;
+case "z213":
+ notevil = (notevil + 213)/2;
+ break;
+case "z214":
+ notevil = (notevil + 214)/2;
+ break;
+case "z215":
+ notevil = (notevil + 215)/2;
+ break;
+case "z216":
+ notevil = (notevil + 216)/2;
+ break;
+case "z217":
+ notevil = (notevil + 217)/2;
+ break;
+case "z218":
+ notevil = (notevil + 218)/2;
+ break;
+case "z219":
+ notevil = (notevil + 219)/2;
+ break;
+case "z220":
+ notevil = (notevil + 220)/2;
+ break;
+case "z221":
+ notevil = (notevil + 221)/2;
+ break;
+case "z222":
+ notevil = (notevil + 222)/2;
+ break;
+case "z223":
+ notevil = (notevil + 223)/2;
+ break;
+case "z224":
+ notevil = (notevil + 224)/2;
+ break;
+case "z225":
+ notevil = (notevil + 225)/2;
+ break;
+case "z226":
+ notevil = (notevil + 226)/2;
+ break;
+case "z227":
+ notevil = (notevil + 227)/2;
+ break;
+case "z228":
+ notevil = (notevil + 228)/2;
+ break;
+case "z229":
+ notevil = (notevil + 229)/2;
+ break;
+case "z230":
+ notevil = (notevil + 230)/2;
+ break;
+case "z231":
+ notevil = (notevil + 231)/2;
+ break;
+case "z232":
+ notevil = (notevil + 232)/2;
+ break;
+case "z233":
+ notevil = (notevil + 233)/2;
+ break;
+case "z234":
+ notevil = (notevil + 234)/2;
+ break;
+case "z235":
+ notevil = (notevil + 235)/2;
+ break;
+case "z236":
+ notevil = (notevil + 236)/2;
+ break;
+case "z237":
+ notevil = (notevil + 237)/2;
+ break;
+case "z238":
+ notevil = (notevil + 238)/2;
+ break;
+case "z239":
+ notevil = (notevil + 239)/2;
+ break;
+case "z240":
+ notevil = (notevil + 240)/2;
+ break;
+case "z241":
+ notevil = (notevil + 241)/2;
+ break;
+case "z242":
+ notevil = (notevil + 242)/2;
+ break;
+case "z243":
+ notevil = (notevil + 243)/2;
+ break;
+case "z244":
+ notevil = (notevil + 244)/2;
+ break;
+case "z245":
+ notevil = (notevil + 245)/2;
+ break;
+case "z246":
+ notevil = (notevil + 246)/2;
+ break;
+case "z247":
+ notevil = (notevil + 247)/2;
+ break;
+case "z248":
+ notevil = (notevil + 248)/2;
+ break;
+case "z249":
+ notevil = (notevil + 249)/2;
+ break;
+case "z250":
+ notevil = (notevil + 250)/2;
+ break;
+case "z251":
+ notevil = (notevil + 251)/2;
+ break;
+case "z252":
+ notevil = (notevil + 252)/2;
+ break;
+case "z253":
+ notevil = (notevil + 253)/2;
+ break;
+case "z254":
+ notevil = (notevil + 254)/2;
+ break;
+case "z255":
+ notevil = (notevil + 255)/2;
+ break;
+case "z256":
+ notevil = (notevil + 256)/2;
+ break;
+case "z257":
+ notevil = (notevil + 257)/2;
+ break;
+case "z258":
+ notevil = (notevil + 258)/2;
+ break;
+case "z259":
+ notevil = (notevil + 259)/2;
+ break;
+case "z260":
+ notevil = (notevil + 260)/2;
+ break;
+case "z261":
+ notevil = (notevil + 261)/2;
+ break;
+case "z262":
+ notevil = (notevil + 262)/2;
+ break;
+case "z263":
+ notevil = (notevil + 263)/2;
+ break;
+case "z264":
+ notevil = (notevil + 264)/2;
+ break;
+case "z265":
+ notevil = (notevil + 265)/2;
+ break;
+case "z266":
+ notevil = (notevil + 266)/2;
+ break;
+case "z267":
+ notevil = (notevil + 267)/2;
+ break;
+case "z268":
+ notevil = (notevil + 268)/2;
+ break;
+case "z269":
+ notevil = (notevil + 269)/2;
+ break;
+case "z270":
+ notevil = (notevil + 270)/2;
+ break;
+case "z271":
+ notevil = (notevil + 271)/2;
+ break;
+case "z272":
+ notevil = (notevil + 272)/2;
+ break;
+case "z273":
+ notevil = (notevil + 273)/2;
+ break;
+case "z274":
+ notevil = (notevil + 274)/2;
+ break;
+case "z275":
+ notevil = (notevil + 275)/2;
+ break;
+case "z276":
+ notevil = (notevil + 276)/2;
+ break;
+case "z277":
+ notevil = (notevil + 277)/2;
+ break;
+case "z278":
+ notevil = (notevil + 278)/2;
+ break;
+case "z279":
+ notevil = (notevil + 279)/2;
+ break;
+case "z280":
+ notevil = (notevil + 280)/2;
+ break;
+case "z281":
+ notevil = (notevil + 281)/2;
+ break;
+case "z282":
+ notevil = (notevil + 282)/2;
+ break;
+case "z283":
+ notevil = (notevil + 283)/2;
+ break;
+case "z284":
+ notevil = (notevil + 284)/2;
+ break;
+case "z285":
+ notevil = (notevil + 285)/2;
+ break;
+case "z286":
+ notevil = (notevil + 286)/2;
+ break;
+case "z287":
+ notevil = (notevil + 287)/2;
+ break;
+case "z288":
+ notevil = (notevil + 288)/2;
+ break;
+case "z289":
+ notevil = (notevil + 289)/2;
+ break;
+case "z290":
+ notevil = (notevil + 290)/2;
+ break;
+case "z291":
+ notevil = (notevil + 291)/2;
+ break;
+case "z292":
+ notevil = (notevil + 292)/2;
+ break;
+case "z293":
+ notevil = (notevil + 293)/2;
+ break;
+case "z294":
+ notevil = (notevil + 294)/2;
+ break;
+case "z295":
+ notevil = (notevil + 295)/2;
+ break;
+case "z296":
+ notevil = (notevil + 296)/2;
+ break;
+case "z297":
+ notevil = (notevil + 297)/2;
+ break;
+case "z298":
+ notevil = (notevil + 298)/2;
+ break;
+case "z299":
+ notevil = (notevil + 299)/2;
+ break;
+case "z300":
+ notevil = (notevil + 300)/2;
+ break;
+case "z301":
+ notevil = (notevil + 301)/2;
+ break;
+case "z302":
+ notevil = (notevil + 302)/2;
+ break;
+case "z303":
+ notevil = (notevil + 303)/2;
+ break;
+case "z304":
+ notevil = (notevil + 304)/2;
+ break;
+case "z305":
+ notevil = (notevil + 305)/2;
+ break;
+case "z306":
+ notevil = (notevil + 306)/2;
+ break;
+case "z307":
+ notevil = (notevil + 307)/2;
+ break;
+case "z308":
+ notevil = (notevil + 308)/2;
+ break;
+case "z309":
+ notevil = (notevil + 309)/2;
+ break;
+case "z310":
+ notevil = (notevil + 310)/2;
+ break;
+case "z311":
+ notevil = (notevil + 311)/2;
+ break;
+case "z312":
+ notevil = (notevil + 312)/2;
+ break;
+case "z313":
+ notevil = (notevil + 313)/2;
+ break;
+case "z314":
+ notevil = (notevil + 314)/2;
+ break;
+case "z315":
+ notevil = (notevil + 315)/2;
+ break;
+case "z316":
+ notevil = (notevil + 316)/2;
+ break;
+case "z317":
+ notevil = (notevil + 317)/2;
+ break;
+case "z318":
+ notevil = (notevil + 318)/2;
+ break;
+case "z319":
+ notevil = (notevil + 319)/2;
+ break;
+case "z320":
+ notevil = (notevil + 320)/2;
+ break;
+case "z321":
+ notevil = (notevil + 321)/2;
+ break;
+case "z322":
+ notevil = (notevil + 322)/2;
+ break;
+case "z323":
+ notevil = (notevil + 323)/2;
+ break;
+case "z324":
+ notevil = (notevil + 324)/2;
+ break;
+case "z325":
+ notevil = (notevil + 325)/2;
+ break;
+case "z326":
+ notevil = (notevil + 326)/2;
+ break;
+case "z327":
+ notevil = (notevil + 327)/2;
+ break;
+case "z328":
+ notevil = (notevil + 328)/2;
+ break;
+case "z329":
+ notevil = (notevil + 329)/2;
+ break;
+case "z330":
+ notevil = (notevil + 330)/2;
+ break;
+case "z331":
+ notevil = (notevil + 331)/2;
+ break;
+case "z332":
+ notevil = (notevil + 332)/2;
+ break;
+case "z333":
+ notevil = (notevil + 333)/2;
+ break;
+case "z334":
+ notevil = (notevil + 334)/2;
+ break;
+case "z335":
+ notevil = (notevil + 335)/2;
+ break;
+case "z336":
+ notevil = (notevil + 336)/2;
+ break;
+case "z337":
+ notevil = (notevil + 337)/2;
+ break;
+case "z338":
+ notevil = (notevil + 338)/2;
+ break;
+case "z339":
+ notevil = (notevil + 339)/2;
+ break;
+case "z340":
+ notevil = (notevil + 340)/2;
+ break;
+case "z341":
+ notevil = (notevil + 341)/2;
+ break;
+case "z342":
+ notevil = (notevil + 342)/2;
+ break;
+case "z343":
+ notevil = (notevil + 343)/2;
+ break;
+case "z344":
+ notevil = (notevil + 344)/2;
+ break;
+case "z345":
+ notevil = (notevil + 345)/2;
+ break;
+case "z346":
+ notevil = (notevil + 346)/2;
+ break;
+case "z347":
+ notevil = (notevil + 347)/2;
+ break;
+case "z348":
+ notevil = (notevil + 348)/2;
+ break;
+case "z349":
+ notevil = (notevil + 349)/2;
+ break;
+case "z350":
+ notevil = (notevil + 350)/2;
+ break;
+case "z351":
+ notevil = (notevil + 351)/2;
+ break;
+case "z352":
+ notevil = (notevil + 352)/2;
+ break;
+case "z353":
+ notevil = (notevil + 353)/2;
+ break;
+case "z354":
+ notevil = (notevil + 354)/2;
+ break;
+case "z355":
+ notevil = (notevil + 355)/2;
+ break;
+case "z356":
+ notevil = (notevil + 356)/2;
+ break;
+case "z357":
+ notevil = (notevil + 357)/2;
+ break;
+case "z358":
+ notevil = (notevil + 358)/2;
+ break;
+case "z359":
+ notevil = (notevil + 359)/2;
+ break;
+case "z360":
+ notevil = (notevil + 360)/2;
+ break;
+case "z361":
+ notevil = (notevil + 361)/2;
+ break;
+case "z362":
+ notevil = (notevil + 362)/2;
+ break;
+case "z363":
+ notevil = (notevil + 363)/2;
+ break;
+case "z364":
+ notevil = (notevil + 364)/2;
+ break;
+case "z365":
+ notevil = (notevil + 365)/2;
+ break;
+case "z366":
+ notevil = (notevil + 366)/2;
+ break;
+case "z367":
+ notevil = (notevil + 367)/2;
+ break;
+case "z368":
+ notevil = (notevil + 368)/2;
+ break;
+case "z369":
+ notevil = (notevil + 369)/2;
+ break;
+case "z370":
+ notevil = (notevil + 370)/2;
+ break;
+case "z371":
+ notevil = (notevil + 371)/2;
+ break;
+case "z372":
+ notevil = (notevil + 372)/2;
+ break;
+case "z373":
+ notevil = (notevil + 373)/2;
+ break;
+case "z374":
+ notevil = (notevil + 374)/2;
+ break;
+case "z375":
+ notevil = (notevil + 375)/2;
+ break;
+case "z376":
+ notevil = (notevil + 376)/2;
+ break;
+case "z377":
+ notevil = (notevil + 377)/2;
+ break;
+case "z378":
+ notevil = (notevil + 378)/2;
+ break;
+case "z379":
+ notevil = (notevil + 379)/2;
+ break;
+case "z380":
+ notevil = (notevil + 380)/2;
+ break;
+case "z381":
+ notevil = (notevil + 381)/2;
+ break;
+case "z382":
+ notevil = (notevil + 382)/2;
+ break;
+case "z383":
+ notevil = (notevil + 383)/2;
+ break;
+case "z384":
+ notevil = (notevil + 384)/2;
+ break;
+case "z385":
+ notevil = (notevil + 385)/2;
+ break;
+case "z386":
+ notevil = (notevil + 386)/2;
+ break;
+case "z387":
+ notevil = (notevil + 387)/2;
+ break;
+case "z388":
+ notevil = (notevil + 388)/2;
+ break;
+case "z389":
+ notevil = (notevil + 389)/2;
+ break;
+case "z390":
+ notevil = (notevil + 390)/2;
+ break;
+case "z391":
+ notevil = (notevil + 391)/2;
+ break;
+case "z392":
+ notevil = (notevil + 392)/2;
+ break;
+case "z393":
+ notevil = (notevil + 393)/2;
+ break;
+case "z394":
+ notevil = (notevil + 394)/2;
+ break;
+case "z395":
+ notevil = (notevil + 395)/2;
+ break;
+case "z396":
+ notevil = (notevil + 396)/2;
+ break;
+case "z397":
+ notevil = (notevil + 397)/2;
+ break;
+case "z398":
+ notevil = (notevil + 398)/2;
+ break;
+case "z399":
+ notevil = (notevil + 399)/2;
+ break;
+case "z400":
+ notevil = (notevil + 400)/2;
+ break;
+case "z401":
+ notevil = (notevil + 401)/2;
+ break;
+case "z402":
+ notevil = (notevil + 402)/2;
+ break;
+case "z403":
+ notevil = (notevil + 403)/2;
+ break;
+case "z404":
+ notevil = (notevil + 404)/2;
+ break;
+case "z405":
+ notevil = (notevil + 405)/2;
+ break;
+case "z406":
+ notevil = (notevil + 406)/2;
+ break;
+case "z407":
+ notevil = (notevil + 407)/2;
+ break;
+case "z408":
+ notevil = (notevil + 408)/2;
+ break;
+case "z409":
+ notevil = (notevil + 409)/2;
+ break;
+case "z410":
+ notevil = (notevil + 410)/2;
+ break;
+case "z411":
+ notevil = (notevil + 411)/2;
+ break;
+case "z412":
+ notevil = (notevil + 412)/2;
+ break;
+case "z413":
+ notevil = (notevil + 413)/2;
+ break;
+case "z414":
+ notevil = (notevil + 414)/2;
+ break;
+case "z415":
+ notevil = (notevil + 415)/2;
+ break;
+case "z416":
+ notevil = (notevil + 416)/2;
+ break;
+case "z417":
+ notevil = (notevil + 417)/2;
+ break;
+case "z418":
+ notevil = (notevil + 418)/2;
+ break;
+case "z419":
+ notevil = (notevil + 419)/2;
+ break;
+case "z420":
+ notevil = (notevil + 420)/2;
+ break;
+case "z421":
+ notevil = (notevil + 421)/2;
+ break;
+case "z422":
+ notevil = (notevil + 422)/2;
+ break;
+case "z423":
+ notevil = (notevil + 423)/2;
+ break;
+case "z424":
+ notevil = (notevil + 424)/2;
+ break;
+case "z425":
+ notevil = (notevil + 425)/2;
+ break;
+case "z426":
+ notevil = (notevil + 426)/2;
+ break;
+case "z427":
+ notevil = (notevil + 427)/2;
+ break;
+case "z428":
+ notevil = (notevil + 428)/2;
+ break;
+case "z429":
+ notevil = (notevil + 429)/2;
+ break;
+case "z430":
+ notevil = (notevil + 430)/2;
+ break;
+case "z431":
+ notevil = (notevil + 431)/2;
+ break;
+case "z432":
+ notevil = (notevil + 432)/2;
+ break;
+case "z433":
+ notevil = (notevil + 433)/2;
+ break;
+case "z434":
+ notevil = (notevil + 434)/2;
+ break;
+case "z435":
+ notevil = (notevil + 435)/2;
+ break;
+case "z436":
+ notevil = (notevil + 436)/2;
+ break;
+case "z437":
+ notevil = (notevil + 437)/2;
+ break;
+case "z438":
+ notevil = (notevil + 438)/2;
+ break;
+case "z439":
+ notevil = (notevil + 439)/2;
+ break;
+case "z440":
+ notevil = (notevil + 440)/2;
+ break;
+case "z441":
+ notevil = (notevil + 441)/2;
+ break;
+case "z442":
+ notevil = (notevil + 442)/2;
+ break;
+case "z443":
+ notevil = (notevil + 443)/2;
+ break;
+case "z444":
+ notevil = (notevil + 444)/2;
+ break;
+case "z445":
+ notevil = (notevil + 445)/2;
+ break;
+case "z446":
+ notevil = (notevil + 446)/2;
+ break;
+case "z447":
+ notevil = (notevil + 447)/2;
+ break;
+case "z448":
+ notevil = (notevil + 448)/2;
+ break;
+case "z449":
+ notevil = (notevil + 449)/2;
+ break;
+case "z450":
+ notevil = (notevil + 450)/2;
+ break;
+case "z451":
+ notevil = (notevil + 451)/2;
+ break;
+case "z452":
+ notevil = (notevil + 452)/2;
+ break;
+case "z453":
+ notevil = (notevil + 453)/2;
+ break;
+case "z454":
+ notevil = (notevil + 454)/2;
+ break;
+case "z455":
+ notevil = (notevil + 455)/2;
+ break;
+case "z456":
+ notevil = (notevil + 456)/2;
+ break;
+case "z457":
+ notevil = (notevil + 457)/2;
+ break;
+case "z458":
+ notevil = (notevil + 458)/2;
+ break;
+case "z459":
+ notevil = (notevil + 459)/2;
+ break;
+case "z460":
+ notevil = (notevil + 460)/2;
+ break;
+case "z461":
+ notevil = (notevil + 461)/2;
+ break;
+case "z462":
+ notevil = (notevil + 462)/2;
+ break;
+case "z463":
+ notevil = (notevil + 463)/2;
+ break;
+case "z464":
+ notevil = (notevil + 464)/2;
+ break;
+case "z465":
+ notevil = (notevil + 465)/2;
+ break;
+case "z466":
+ notevil = (notevil + 466)/2;
+ break;
+case "z467":
+ notevil = (notevil + 467)/2;
+ break;
+case "z468":
+ notevil = (notevil + 468)/2;
+ break;
+case "z469":
+ notevil = (notevil + 469)/2;
+ break;
+case "z470":
+ notevil = (notevil + 470)/2;
+ break;
+case "z471":
+ notevil = (notevil + 471)/2;
+ break;
+case "z472":
+ notevil = (notevil + 472)/2;
+ break;
+case "z473":
+ notevil = (notevil + 473)/2;
+ break;
+case "z474":
+ notevil = (notevil + 474)/2;
+ break;
+case "z475":
+ notevil = (notevil + 475)/2;
+ break;
+case "z476":
+ notevil = (notevil + 476)/2;
+ break;
+case "z477":
+ notevil = (notevil + 477)/2;
+ break;
+case "z478":
+ notevil = (notevil + 478)/2;
+ break;
+case "z479":
+ notevil = (notevil + 479)/2;
+ break;
+case "z480":
+ notevil = (notevil + 480)/2;
+ break;
+case "z481":
+ notevil = (notevil + 481)/2;
+ break;
+case "z482":
+ notevil = (notevil + 482)/2;
+ break;
+case "z483":
+ notevil = (notevil + 483)/2;
+ break;
+case "z484":
+ notevil = (notevil + 484)/2;
+ break;
+case "z485":
+ notevil = (notevil + 485)/2;
+ break;
+case "z486":
+ notevil = (notevil + 486)/2;
+ break;
+case "z487":
+ notevil = (notevil + 487)/2;
+ break;
+case "z488":
+ notevil = (notevil + 488)/2;
+ break;
+case "z489":
+ notevil = (notevil + 489)/2;
+ break;
+case "z490":
+ notevil = (notevil + 490)/2;
+ break;
+case "z491":
+ notevil = (notevil + 491)/2;
+ break;
+case "z492":
+ notevil = (notevil + 492)/2;
+ break;
+case "z493":
+ notevil = (notevil + 493)/2;
+ break;
+case "z494":
+ notevil = (notevil + 494)/2;
+ break;
+case "z495":
+ notevil = (notevil + 495)/2;
+ break;
+case "z496":
+ notevil = (notevil + 496)/2;
+ break;
+case "z497":
+ notevil = (notevil + 497)/2;
+ break;
+case "z498":
+ notevil = (notevil + 498)/2;
+ break;
+case "z499":
+ notevil = (notevil + 499)/2;
+ break;
+case "z500":
+ notevil = (notevil + 500)/2;
+ break;
+case "z501":
+ notevil = (notevil + 501)/2;
+ break;
+case "z502":
+ notevil = (notevil + 502)/2;
+ break;
+case "z503":
+ notevil = (notevil + 503)/2;
+ break;
+case "z504":
+ notevil = (notevil + 504)/2;
+ break;
+case "z505":
+ notevil = (notevil + 505)/2;
+ break;
+case "z506":
+ notevil = (notevil + 506)/2;
+ break;
+case "z507":
+ notevil = (notevil + 507)/2;
+ break;
+case "z508":
+ notevil = (notevil + 508)/2;
+ break;
+case "z509":
+ notevil = (notevil + 509)/2;
+ break;
+case "z510":
+ notevil = (notevil + 510)/2;
+ break;
+case "z511":
+ notevil = (notevil + 511)/2;
+ break;
+case "z512":
+ notevil = (notevil + 512)/2;
+ break;
+case "z513":
+ notevil = (notevil + 513)/2;
+ break;
+case "z514":
+ notevil = (notevil + 514)/2;
+ break;
+case "z515":
+ notevil = (notevil + 515)/2;
+ break;
+case "z516":
+ notevil = (notevil + 516)/2;
+ break;
+case "z517":
+ notevil = (notevil + 517)/2;
+ break;
+case "z518":
+ notevil = (notevil + 518)/2;
+ break;
+case "z519":
+ notevil = (notevil + 519)/2;
+ break;
+case "z520":
+ notevil = (notevil + 520)/2;
+ break;
+case "z521":
+ notevil = (notevil + 521)/2;
+ break;
+case "z522":
+ notevil = (notevil + 522)/2;
+ break;
+case "z523":
+ notevil = (notevil + 523)/2;
+ break;
+case "z524":
+ notevil = (notevil + 524)/2;
+ break;
+case "z525":
+ notevil = (notevil + 525)/2;
+ break;
+case "z526":
+ notevil = (notevil + 526)/2;
+ break;
+case "z527":
+ notevil = (notevil + 527)/2;
+ break;
+case "z528":
+ notevil = (notevil + 528)/2;
+ break;
+case "z529":
+ notevil = (notevil + 529)/2;
+ break;
+case "z530":
+ notevil = (notevil + 530)/2;
+ break;
+case "z531":
+ notevil = (notevil + 531)/2;
+ break;
+case "z532":
+ notevil = (notevil + 532)/2;
+ break;
+case "z533":
+ notevil = (notevil + 533)/2;
+ break;
+case "z534":
+ notevil = (notevil + 534)/2;
+ break;
+case "z535":
+ notevil = (notevil + 535)/2;
+ break;
+case "z536":
+ notevil = (notevil + 536)/2;
+ break;
+case "z537":
+ notevil = (notevil + 537)/2;
+ break;
+case "z538":
+ notevil = (notevil + 538)/2;
+ break;
+case "z539":
+ notevil = (notevil + 539)/2;
+ break;
+case "z540":
+ notevil = (notevil + 540)/2;
+ break;
+case "z541":
+ notevil = (notevil + 541)/2;
+ break;
+case "z542":
+ notevil = (notevil + 542)/2;
+ break;
+case "z543":
+ notevil = (notevil + 543)/2;
+ break;
+case "z544":
+ notevil = (notevil + 544)/2;
+ break;
+case "z545":
+ notevil = (notevil + 545)/2;
+ break;
+case "z546":
+ notevil = (notevil + 546)/2;
+ break;
+case "z547":
+ notevil = (notevil + 547)/2;
+ break;
+case "z548":
+ notevil = (notevil + 548)/2;
+ break;
+case "z549":
+ notevil = (notevil + 549)/2;
+ break;
+case "z550":
+ notevil = (notevil + 550)/2;
+ break;
+case "z551":
+ notevil = (notevil + 551)/2;
+ break;
+case "z552":
+ notevil = (notevil + 552)/2;
+ break;
+case "z553":
+ notevil = (notevil + 553)/2;
+ break;
+case "z554":
+ notevil = (notevil + 554)/2;
+ break;
+case "z555":
+ notevil = (notevil + 555)/2;
+ break;
+case "z556":
+ notevil = (notevil + 556)/2;
+ break;
+case "z557":
+ notevil = (notevil + 557)/2;
+ break;
+case "z558":
+ notevil = (notevil + 558)/2;
+ break;
+case "z559":
+ notevil = (notevil + 559)/2;
+ break;
+case "z560":
+ notevil = (notevil + 560)/2;
+ break;
+case "z561":
+ notevil = (notevil + 561)/2;
+ break;
+case "z562":
+ notevil = (notevil + 562)/2;
+ break;
+case "z563":
+ notevil = (notevil + 563)/2;
+ break;
+case "z564":
+ notevil = (notevil + 564)/2;
+ break;
+case "z565":
+ notevil = (notevil + 565)/2;
+ break;
+case "z566":
+ notevil = (notevil + 566)/2;
+ break;
+case "z567":
+ notevil = (notevil + 567)/2;
+ break;
+case "z568":
+ notevil = (notevil + 568)/2;
+ break;
+case "z569":
+ notevil = (notevil + 569)/2;
+ break;
+case "z570":
+ notevil = (notevil + 570)/2;
+ break;
+case "z571":
+ notevil = (notevil + 571)/2;
+ break;
+case "z572":
+ notevil = (notevil + 572)/2;
+ break;
+case "z573":
+ notevil = (notevil + 573)/2;
+ break;
+case "z574":
+ notevil = (notevil + 574)/2;
+ break;
+case "z575":
+ notevil = (notevil + 575)/2;
+ break;
+case "z576":
+ notevil = (notevil + 576)/2;
+ break;
+case "z577":
+ notevil = (notevil + 577)/2;
+ break;
+case "z578":
+ notevil = (notevil + 578)/2;
+ break;
+case "z579":
+ notevil = (notevil + 579)/2;
+ break;
+case "z580":
+ notevil = (notevil + 580)/2;
+ break;
+case "z581":
+ notevil = (notevil + 581)/2;
+ break;
+case "z582":
+ notevil = (notevil + 582)/2;
+ break;
+case "z583":
+ notevil = (notevil + 583)/2;
+ break;
+case "z584":
+ notevil = (notevil + 584)/2;
+ break;
+case "z585":
+ notevil = (notevil + 585)/2;
+ break;
+case "z586":
+ notevil = (notevil + 586)/2;
+ break;
+case "z587":
+ notevil = (notevil + 587)/2;
+ break;
+case "z588":
+ notevil = (notevil + 588)/2;
+ break;
+case "z589":
+ notevil = (notevil + 589)/2;
+ break;
+case "z590":
+ notevil = (notevil + 590)/2;
+ break;
+case "z591":
+ notevil = (notevil + 591)/2;
+ break;
+case "z592":
+ notevil = (notevil + 592)/2;
+ break;
+case "z593":
+ notevil = (notevil + 593)/2;
+ break;
+case "z594":
+ notevil = (notevil + 594)/2;
+ break;
+case "z595":
+ notevil = (notevil + 595)/2;
+ break;
+case "z596":
+ notevil = (notevil + 596)/2;
+ break;
+case "z597":
+ notevil = (notevil + 597)/2;
+ break;
+case "z598":
+ notevil = (notevil + 598)/2;
+ break;
+case "z599":
+ notevil = (notevil + 599)/2;
+ break;
+case "z600":
+ notevil = (notevil + 600)/2;
+ break;
+case "z601":
+ notevil = (notevil + 601)/2;
+ break;
+case "z602":
+ notevil = (notevil + 602)/2;
+ break;
+case "z603":
+ notevil = (notevil + 603)/2;
+ break;
+case "z604":
+ notevil = (notevil + 604)/2;
+ break;
+case "z605":
+ notevil = (notevil + 605)/2;
+ break;
+case "z606":
+ notevil = (notevil + 606)/2;
+ break;
+case "z607":
+ notevil = (notevil + 607)/2;
+ break;
+case "z608":
+ notevil = (notevil + 608)/2;
+ break;
+case "z609":
+ notevil = (notevil + 609)/2;
+ break;
+case "z610":
+ notevil = (notevil + 610)/2;
+ break;
+case "z611":
+ notevil = (notevil + 611)/2;
+ break;
+case "z612":
+ notevil = (notevil + 612)/2;
+ break;
+case "z613":
+ notevil = (notevil + 613)/2;
+ break;
+case "z614":
+ notevil = (notevil + 614)/2;
+ break;
+case "z615":
+ notevil = (notevil + 615)/2;
+ break;
+case "z616":
+ notevil = (notevil + 616)/2;
+ break;
+case "z617":
+ notevil = (notevil + 617)/2;
+ break;
+case "z618":
+ notevil = (notevil + 618)/2;
+ break;
+case "z619":
+ notevil = (notevil + 619)/2;
+ break;
+case "z620":
+ notevil = (notevil + 620)/2;
+ break;
+case "z621":
+ notevil = (notevil + 621)/2;
+ break;
+case "z622":
+ notevil = (notevil + 622)/2;
+ break;
+case "z623":
+ notevil = (notevil + 623)/2;
+ break;
+case "z624":
+ notevil = (notevil + 624)/2;
+ break;
+case "z625":
+ notevil = (notevil + 625)/2;
+ break;
+case "z626":
+ notevil = (notevil + 626)/2;
+ break;
+case "z627":
+ notevil = (notevil + 627)/2;
+ break;
+case "z628":
+ notevil = (notevil + 628)/2;
+ break;
+case "z629":
+ notevil = (notevil + 629)/2;
+ break;
+case "z630":
+ notevil = (notevil + 630)/2;
+ break;
+case "z631":
+ notevil = (notevil + 631)/2;
+ break;
+case "z632":
+ notevil = (notevil + 632)/2;
+ break;
+case "z633":
+ notevil = (notevil + 633)/2;
+ break;
+case "z634":
+ notevil = (notevil + 634)/2;
+ break;
+case "z635":
+ notevil = (notevil + 635)/2;
+ break;
+case "z636":
+ notevil = (notevil + 636)/2;
+ break;
+case "z637":
+ notevil = (notevil + 637)/2;
+ break;
+case "z638":
+ notevil = (notevil + 638)/2;
+ break;
+case "z639":
+ notevil = (notevil + 639)/2;
+ break;
+case "z640":
+ notevil = (notevil + 640)/2;
+ break;
+case "z641":
+ notevil = (notevil + 641)/2;
+ break;
+case "z642":
+ notevil = (notevil + 642)/2;
+ break;
+case "z643":
+ notevil = (notevil + 643)/2;
+ break;
+case "z644":
+ notevil = (notevil + 644)/2;
+ break;
+case "z645":
+ notevil = (notevil + 645)/2;
+ break;
+case "z646":
+ notevil = (notevil + 646)/2;
+ break;
+case "z647":
+ notevil = (notevil + 647)/2;
+ break;
+case "z648":
+ notevil = (notevil + 648)/2;
+ break;
+case "z649":
+ notevil = (notevil + 649)/2;
+ break;
+case "z650":
+ notevil = (notevil + 650)/2;
+ break;
+case "z651":
+ notevil = (notevil + 651)/2;
+ break;
+case "z652":
+ notevil = (notevil + 652)/2;
+ break;
+case "z653":
+ notevil = (notevil + 653)/2;
+ break;
+case "z654":
+ notevil = (notevil + 654)/2;
+ break;
+case "z655":
+ notevil = (notevil + 655)/2;
+ break;
+case "z656":
+ notevil = (notevil + 656)/2;
+ break;
+case "z657":
+ notevil = (notevil + 657)/2;
+ break;
+case "z658":
+ notevil = (notevil + 658)/2;
+ break;
+case "z659":
+ notevil = (notevil + 659)/2;
+ break;
+case "z660":
+ notevil = (notevil + 660)/2;
+ break;
+case "z661":
+ notevil = (notevil + 661)/2;
+ break;
+case "z662":
+ notevil = (notevil + 662)/2;
+ break;
+case "z663":
+ notevil = (notevil + 663)/2;
+ break;
+case "z664":
+ notevil = (notevil + 664)/2;
+ break;
+case "z665":
+ notevil = (notevil + 665)/2;
+ break;
+case "z666":
+ notevil = (notevil + 666)/2;
+ break;
+case "z667":
+ notevil = (notevil + 667)/2;
+ break;
+case "z668":
+ notevil = (notevil + 668)/2;
+ break;
+case "z669":
+ notevil = (notevil + 669)/2;
+ break;
+case "z670":
+ notevil = (notevil + 670)/2;
+ break;
+case "z671":
+ notevil = (notevil + 671)/2;
+ break;
+case "z672":
+ notevil = (notevil + 672)/2;
+ break;
+case "z673":
+ notevil = (notevil + 673)/2;
+ break;
+case "z674":
+ notevil = (notevil + 674)/2;
+ break;
+case "z675":
+ notevil = (notevil + 675)/2;
+ break;
+case "z676":
+ notevil = (notevil + 676)/2;
+ break;
+case "z677":
+ notevil = (notevil + 677)/2;
+ break;
+case "z678":
+ notevil = (notevil + 678)/2;
+ break;
+case "z679":
+ notevil = (notevil + 679)/2;
+ break;
+case "z680":
+ notevil = (notevil + 680)/2;
+ break;
+case "z681":
+ notevil = (notevil + 681)/2;
+ break;
+case "z682":
+ notevil = (notevil + 682)/2;
+ break;
+case "z683":
+ notevil = (notevil + 683)/2;
+ break;
+case "z684":
+ notevil = (notevil + 684)/2;
+ break;
+case "z685":
+ notevil = (notevil + 685)/2;
+ break;
+case "z686":
+ notevil = (notevil + 686)/2;
+ break;
+case "z687":
+ notevil = (notevil + 687)/2;
+ break;
+case "z688":
+ notevil = (notevil + 688)/2;
+ break;
+case "z689":
+ notevil = (notevil + 689)/2;
+ break;
+case "z690":
+ notevil = (notevil + 690)/2;
+ break;
+case "z691":
+ notevil = (notevil + 691)/2;
+ break;
+case "z692":
+ notevil = (notevil + 692)/2;
+ break;
+case "z693":
+ notevil = (notevil + 693)/2;
+ break;
+case "z694":
+ notevil = (notevil + 694)/2;
+ break;
+case "z695":
+ notevil = (notevil + 695)/2;
+ break;
+case "z696":
+ notevil = (notevil + 696)/2;
+ break;
+case "z697":
+ notevil = (notevil + 697)/2;
+ break;
+case "z698":
+ notevil = (notevil + 698)/2;
+ break;
+case "z699":
+ notevil = (notevil + 699)/2;
+ break;
+case "z700":
+ notevil = (notevil + 700)/2;
+ break;
+case "z701":
+ notevil = (notevil + 701)/2;
+ break;
+case "z702":
+ notevil = (notevil + 702)/2;
+ break;
+case "z703":
+ notevil = (notevil + 703)/2;
+ break;
+case "z704":
+ notevil = (notevil + 704)/2;
+ break;
+case "z705":
+ notevil = (notevil + 705)/2;
+ break;
+case "z706":
+ notevil = (notevil + 706)/2;
+ break;
+case "z707":
+ notevil = (notevil + 707)/2;
+ break;
+case "z708":
+ notevil = (notevil + 708)/2;
+ break;
+case "z709":
+ notevil = (notevil + 709)/2;
+ break;
+case "z710":
+ notevil = (notevil + 710)/2;
+ break;
+case "z711":
+ notevil = (notevil + 711)/2;
+ break;
+case "z712":
+ notevil = (notevil + 712)/2;
+ break;
+case "z713":
+ notevil = (notevil + 713)/2;
+ break;
+case "z714":
+ notevil = (notevil + 714)/2;
+ break;
+case "z715":
+ notevil = (notevil + 715)/2;
+ break;
+case "z716":
+ notevil = (notevil + 716)/2;
+ break;
+case "z717":
+ notevil = (notevil + 717)/2;
+ break;
+case "z718":
+ notevil = (notevil + 718)/2;
+ break;
+case "z719":
+ notevil = (notevil + 719)/2;
+ break;
+case "z720":
+ notevil = (notevil + 720)/2;
+ break;
+case "z721":
+ notevil = (notevil + 721)/2;
+ break;
+case "z722":
+ notevil = (notevil + 722)/2;
+ break;
+case "z723":
+ notevil = (notevil + 723)/2;
+ break;
+case "z724":
+ notevil = (notevil + 724)/2;
+ break;
+case "z725":
+ notevil = (notevil + 725)/2;
+ break;
+case "z726":
+ notevil = (notevil + 726)/2;
+ break;
+case "z727":
+ notevil = (notevil + 727)/2;
+ break;
+case "z728":
+ notevil = (notevil + 728)/2;
+ break;
+case "z729":
+ notevil = (notevil + 729)/2;
+ break;
+case "z730":
+ notevil = (notevil + 730)/2;
+ break;
+case "z731":
+ notevil = (notevil + 731)/2;
+ break;
+case "z732":
+ notevil = (notevil + 732)/2;
+ break;
+case "z733":
+ notevil = (notevil + 733)/2;
+ break;
+case "z734":
+ notevil = (notevil + 734)/2;
+ break;
+case "z735":
+ notevil = (notevil + 735)/2;
+ break;
+case "z736":
+ notevil = (notevil + 736)/2;
+ break;
+case "z737":
+ notevil = (notevil + 737)/2;
+ break;
+case "z738":
+ notevil = (notevil + 738)/2;
+ break;
+case "z739":
+ notevil = (notevil + 739)/2;
+ break;
+case "z740":
+ notevil = (notevil + 740)/2;
+ break;
+case "z741":
+ notevil = (notevil + 741)/2;
+ break;
+case "z742":
+ notevil = (notevil + 742)/2;
+ break;
+case "z743":
+ notevil = (notevil + 743)/2;
+ break;
+case "z744":
+ notevil = (notevil + 744)/2;
+ break;
+case "z745":
+ notevil = (notevil + 745)/2;
+ break;
+case "z746":
+ notevil = (notevil + 746)/2;
+ break;
+case "z747":
+ notevil = (notevil + 747)/2;
+ break;
+case "z748":
+ notevil = (notevil + 748)/2;
+ break;
+case "z749":
+ notevil = (notevil + 749)/2;
+ break;
+case "z750":
+ notevil = (notevil + 750)/2;
+ break;
+case "z751":
+ notevil = (notevil + 751)/2;
+ break;
+case "z752":
+ notevil = (notevil + 752)/2;
+ break;
+case "z753":
+ notevil = (notevil + 753)/2;
+ break;
+case "z754":
+ notevil = (notevil + 754)/2;
+ break;
+case "z755":
+ notevil = (notevil + 755)/2;
+ break;
+case "z756":
+ notevil = (notevil + 756)/2;
+ break;
+case "z757":
+ notevil = (notevil + 757)/2;
+ break;
+case "z758":
+ notevil = (notevil + 758)/2;
+ break;
+case "z759":
+ notevil = (notevil + 759)/2;
+ break;
+case "z760":
+ notevil = (notevil + 760)/2;
+ break;
+case "z761":
+ notevil = (notevil + 761)/2;
+ break;
+case "z762":
+ notevil = (notevil + 762)/2;
+ break;
+case "z763":
+ notevil = (notevil + 763)/2;
+ break;
+case "z764":
+ notevil = (notevil + 764)/2;
+ break;
+case "z765":
+ notevil = (notevil + 765)/2;
+ break;
+case "z766":
+ notevil = (notevil + 766)/2;
+ break;
+case "z767":
+ notevil = (notevil + 767)/2;
+ break;
+case "z768":
+ notevil = (notevil + 768)/2;
+ break;
+case "z769":
+ notevil = (notevil + 769)/2;
+ break;
+case "z770":
+ notevil = (notevil + 770)/2;
+ break;
+case "z771":
+ notevil = (notevil + 771)/2;
+ break;
+case "z772":
+ notevil = (notevil + 772)/2;
+ break;
+case "z773":
+ notevil = (notevil + 773)/2;
+ break;
+case "z774":
+ notevil = (notevil + 774)/2;
+ break;
+case "z775":
+ notevil = (notevil + 775)/2;
+ break;
+case "z776":
+ notevil = (notevil + 776)/2;
+ break;
+case "z777":
+ notevil = (notevil + 777)/2;
+ break;
+case "z778":
+ notevil = (notevil + 778)/2;
+ break;
+case "z779":
+ notevil = (notevil + 779)/2;
+ break;
+case "z780":
+ notevil = (notevil + 780)/2;
+ break;
+case "z781":
+ notevil = (notevil + 781)/2;
+ break;
+case "z782":
+ notevil = (notevil + 782)/2;
+ break;
+case "z783":
+ notevil = (notevil + 783)/2;
+ break;
+case "z784":
+ notevil = (notevil + 784)/2;
+ break;
+case "z785":
+ notevil = (notevil + 785)/2;
+ break;
+case "z786":
+ notevil = (notevil + 786)/2;
+ break;
+case "z787":
+ notevil = (notevil + 787)/2;
+ break;
+case "z788":
+ notevil = (notevil + 788)/2;
+ break;
+case "z789":
+ notevil = (notevil + 789)/2;
+ break;
+case "z790":
+ notevil = (notevil + 790)/2;
+ break;
+case "z791":
+ notevil = (notevil + 791)/2;
+ break;
+case "z792":
+ notevil = (notevil + 792)/2;
+ break;
+case "z793":
+ notevil = (notevil + 793)/2;
+ break;
+case "z794":
+ notevil = (notevil + 794)/2;
+ break;
+case "z795":
+ notevil = (notevil + 795)/2;
+ break;
+case "z796":
+ notevil = (notevil + 796)/2;
+ break;
+case "z797":
+ notevil = (notevil + 797)/2;
+ break;
+case "z798":
+ notevil = (notevil + 798)/2;
+ break;
+case "z799":
+ notevil = (notevil + 799)/2;
+ break;
+case "z800":
+ notevil = (notevil + 800)/2;
+ break;
+case "z801":
+ notevil = (notevil + 801)/2;
+ break;
+case "z802":
+ notevil = (notevil + 802)/2;
+ break;
+case "z803":
+ notevil = (notevil + 803)/2;
+ break;
+case "z804":
+ notevil = (notevil + 804)/2;
+ break;
+case "z805":
+ notevil = (notevil + 805)/2;
+ break;
+case "z806":
+ notevil = (notevil + 806)/2;
+ break;
+case "z807":
+ notevil = (notevil + 807)/2;
+ break;
+case "z808":
+ notevil = (notevil + 808)/2;
+ break;
+case "z809":
+ notevil = (notevil + 809)/2;
+ break;
+case "z810":
+ notevil = (notevil + 810)/2;
+ break;
+case "z811":
+ notevil = (notevil + 811)/2;
+ break;
+case "z812":
+ notevil = (notevil + 812)/2;
+ break;
+case "z813":
+ notevil = (notevil + 813)/2;
+ break;
+case "z814":
+ notevil = (notevil + 814)/2;
+ break;
+case "z815":
+ notevil = (notevil + 815)/2;
+ break;
+case "z816":
+ notevil = (notevil + 816)/2;
+ break;
+case "z817":
+ notevil = (notevil + 817)/2;
+ break;
+case "z818":
+ notevil = (notevil + 818)/2;
+ break;
+case "z819":
+ notevil = (notevil + 819)/2;
+ break;
+case "z820":
+ notevil = (notevil + 820)/2;
+ break;
+case "z821":
+ notevil = (notevil + 821)/2;
+ break;
+case "z822":
+ notevil = (notevil + 822)/2;
+ break;
+case "z823":
+ notevil = (notevil + 823)/2;
+ break;
+case "z824":
+ notevil = (notevil + 824)/2;
+ break;
+case "z825":
+ notevil = (notevil + 825)/2;
+ break;
+case "z826":
+ notevil = (notevil + 826)/2;
+ break;
+case "z827":
+ notevil = (notevil + 827)/2;
+ break;
+case "z828":
+ notevil = (notevil + 828)/2;
+ break;
+case "z829":
+ notevil = (notevil + 829)/2;
+ break;
+case "z830":
+ notevil = (notevil + 830)/2;
+ break;
+case "z831":
+ notevil = (notevil + 831)/2;
+ break;
+case "z832":
+ notevil = (notevil + 832)/2;
+ break;
+case "z833":
+ notevil = (notevil + 833)/2;
+ break;
+case "z834":
+ notevil = (notevil + 834)/2;
+ break;
+case "z835":
+ notevil = (notevil + 835)/2;
+ break;
+case "z836":
+ notevil = (notevil + 836)/2;
+ break;
+case "z837":
+ notevil = (notevil + 837)/2;
+ break;
+case "z838":
+ notevil = (notevil + 838)/2;
+ break;
+case "z839":
+ notevil = (notevil + 839)/2;
+ break;
+case "z840":
+ notevil = (notevil + 840)/2;
+ break;
+case "z841":
+ notevil = (notevil + 841)/2;
+ break;
+case "z842":
+ notevil = (notevil + 842)/2;
+ break;
+case "z843":
+ notevil = (notevil + 843)/2;
+ break;
+case "z844":
+ notevil = (notevil + 844)/2;
+ break;
+case "z845":
+ notevil = (notevil + 845)/2;
+ break;
+case "z846":
+ notevil = (notevil + 846)/2;
+ break;
+case "z847":
+ notevil = (notevil + 847)/2;
+ break;
+case "z848":
+ notevil = (notevil + 848)/2;
+ break;
+case "z849":
+ notevil = (notevil + 849)/2;
+ break;
+case "z850":
+ notevil = (notevil + 850)/2;
+ break;
+case "z851":
+ notevil = (notevil + 851)/2;
+ break;
+case "z852":
+ notevil = (notevil + 852)/2;
+ break;
+case "z853":
+ notevil = (notevil + 853)/2;
+ break;
+case "z854":
+ notevil = (notevil + 854)/2;
+ break;
+case "z855":
+ notevil = (notevil + 855)/2;
+ break;
+case "z856":
+ notevil = (notevil + 856)/2;
+ break;
+case "z857":
+ notevil = (notevil + 857)/2;
+ break;
+case "z858":
+ notevil = (notevil + 858)/2;
+ break;
+case "z859":
+ notevil = (notevil + 859)/2;
+ break;
+case "z860":
+ notevil = (notevil + 860)/2;
+ break;
+case "z861":
+ notevil = (notevil + 861)/2;
+ break;
+case "z862":
+ notevil = (notevil + 862)/2;
+ break;
+case "z863":
+ notevil = (notevil + 863)/2;
+ break;
+case "z864":
+ notevil = (notevil + 864)/2;
+ break;
+case "z865":
+ notevil = (notevil + 865)/2;
+ break;
+case "z866":
+ notevil = (notevil + 866)/2;
+ break;
+case "z867":
+ notevil = (notevil + 867)/2;
+ break;
+case "z868":
+ notevil = (notevil + 868)/2;
+ break;
+case "z869":
+ notevil = (notevil + 869)/2;
+ break;
+case "z870":
+ notevil = (notevil + 870)/2;
+ break;
+case "z871":
+ notevil = (notevil + 871)/2;
+ break;
+case "z872":
+ notevil = (notevil + 872)/2;
+ break;
+case "z873":
+ notevil = (notevil + 873)/2;
+ break;
+case "z874":
+ notevil = (notevil + 874)/2;
+ break;
+case "z875":
+ notevil = (notevil + 875)/2;
+ break;
+case "z876":
+ notevil = (notevil + 876)/2;
+ break;
+case "z877":
+ notevil = (notevil + 877)/2;
+ break;
+case "z878":
+ notevil = (notevil + 878)/2;
+ break;
+case "z879":
+ notevil = (notevil + 879)/2;
+ break;
+case "z880":
+ notevil = (notevil + 880)/2;
+ break;
+case "z881":
+ notevil = (notevil + 881)/2;
+ break;
+case "z882":
+ notevil = (notevil + 882)/2;
+ break;
+case "z883":
+ notevil = (notevil + 883)/2;
+ break;
+case "z884":
+ notevil = (notevil + 884)/2;
+ break;
+case "z885":
+ notevil = (notevil + 885)/2;
+ break;
+case "z886":
+ notevil = (notevil + 886)/2;
+ break;
+case "z887":
+ notevil = (notevil + 887)/2;
+ break;
+case "z888":
+ notevil = (notevil + 888)/2;
+ break;
+case "z889":
+ notevil = (notevil + 889)/2;
+ break;
+case "z890":
+ notevil = (notevil + 890)/2;
+ break;
+case "z891":
+ notevil = (notevil + 891)/2;
+ break;
+case "z892":
+ notevil = (notevil + 892)/2;
+ break;
+case "z893":
+ notevil = (notevil + 893)/2;
+ break;
+case "z894":
+ notevil = (notevil + 894)/2;
+ break;
+case "z895":
+ notevil = (notevil + 895)/2;
+ break;
+case "z896":
+ notevil = (notevil + 896)/2;
+ break;
+case "z897":
+ notevil = (notevil + 897)/2;
+ break;
+case "z898":
+ notevil = (notevil + 898)/2;
+ break;
+case "z899":
+ notevil = (notevil + 899)/2;
+ break;
+case "z900":
+ notevil = (notevil + 900)/2;
+ break;
+case "z901":
+ notevil = (notevil + 901)/2;
+ break;
+case "z902":
+ notevil = (notevil + 902)/2;
+ break;
+case "z903":
+ notevil = (notevil + 903)/2;
+ break;
+case "z904":
+ notevil = (notevil + 904)/2;
+ break;
+case "z905":
+ notevil = (notevil + 905)/2;
+ break;
+case "z906":
+ notevil = (notevil + 906)/2;
+ break;
+case "z907":
+ notevil = (notevil + 907)/2;
+ break;
+case "z908":
+ notevil = (notevil + 908)/2;
+ break;
+case "z909":
+ notevil = (notevil + 909)/2;
+ break;
+case "z910":
+ notevil = (notevil + 910)/2;
+ break;
+case "z911":
+ notevil = (notevil + 911)/2;
+ break;
+case "z912":
+ notevil = (notevil + 912)/2;
+ break;
+case "z913":
+ notevil = (notevil + 913)/2;
+ break;
+case "z914":
+ notevil = (notevil + 914)/2;
+ break;
+case "z915":
+ notevil = (notevil + 915)/2;
+ break;
+case "z916":
+ notevil = (notevil + 916)/2;
+ break;
+case "z917":
+ notevil = (notevil + 917)/2;
+ break;
+case "z918":
+ notevil = (notevil + 918)/2;
+ break;
+case "z919":
+ notevil = (notevil + 919)/2;
+ break;
+case "z920":
+ notevil = (notevil + 920)/2;
+ break;
+case "z921":
+ notevil = (notevil + 921)/2;
+ break;
+case "z922":
+ notevil = (notevil + 922)/2;
+ break;
+case "z923":
+ notevil = (notevil + 923)/2;
+ break;
+case "z924":
+ notevil = (notevil + 924)/2;
+ break;
+case "z925":
+ notevil = (notevil + 925)/2;
+ break;
+case "z926":
+ notevil = (notevil + 926)/2;
+ break;
+case "z927":
+ notevil = (notevil + 927)/2;
+ break;
+case "z928":
+ notevil = (notevil + 928)/2;
+ break;
+case "z929":
+ notevil = (notevil + 929)/2;
+ break;
+case "z930":
+ notevil = (notevil + 930)/2;
+ break;
+case "z931":
+ notevil = (notevil + 931)/2;
+ break;
+case "z932":
+ notevil = (notevil + 932)/2;
+ break;
+case "z933":
+ notevil = (notevil + 933)/2;
+ break;
+case "z934":
+ notevil = (notevil + 934)/2;
+ break;
+case "z935":
+ notevil = (notevil + 935)/2;
+ break;
+case "z936":
+ notevil = (notevil + 936)/2;
+ break;
+case "z937":
+ notevil = (notevil + 937)/2;
+ break;
+case "z938":
+ notevil = (notevil + 938)/2;
+ break;
+case "z939":
+ notevil = (notevil + 939)/2;
+ break;
+case "z940":
+ notevil = (notevil + 940)/2;
+ break;
+case "z941":
+ notevil = (notevil + 941)/2;
+ break;
+case "z942":
+ notevil = (notevil + 942)/2;
+ break;
+case "z943":
+ notevil = (notevil + 943)/2;
+ break;
+case "z944":
+ notevil = (notevil + 944)/2;
+ break;
+case "z945":
+ notevil = (notevil + 945)/2;
+ break;
+case "z946":
+ notevil = (notevil + 946)/2;
+ break;
+case "z947":
+ notevil = (notevil + 947)/2;
+ break;
+case "z948":
+ notevil = (notevil + 948)/2;
+ break;
+case "z949":
+ notevil = (notevil + 949)/2;
+ break;
+case "z950":
+ notevil = (notevil + 950)/2;
+ break;
+case "z951":
+ notevil = (notevil + 951)/2;
+ break;
+case "z952":
+ notevil = (notevil + 952)/2;
+ break;
+case "z953":
+ notevil = (notevil + 953)/2;
+ break;
+case "z954":
+ notevil = (notevil + 954)/2;
+ break;
+case "z955":
+ notevil = (notevil + 955)/2;
+ break;
+case "z956":
+ notevil = (notevil + 956)/2;
+ break;
+case "z957":
+ notevil = (notevil + 957)/2;
+ break;
+case "z958":
+ notevil = (notevil + 958)/2;
+ break;
+case "z959":
+ notevil = (notevil + 959)/2;
+ break;
+case "z960":
+ notevil = (notevil + 960)/2;
+ break;
+case "z961":
+ notevil = (notevil + 961)/2;
+ break;
+case "z962":
+ notevil = (notevil + 962)/2;
+ break;
+case "z963":
+ notevil = (notevil + 963)/2;
+ break;
+case "z964":
+ notevil = (notevil + 964)/2;
+ break;
+case "z965":
+ notevil = (notevil + 965)/2;
+ break;
+case "z966":
+ notevil = (notevil + 966)/2;
+ break;
+case "z967":
+ notevil = (notevil + 967)/2;
+ break;
+case "z968":
+ notevil = (notevil + 968)/2;
+ break;
+case "z969":
+ notevil = (notevil + 969)/2;
+ break;
+case "z970":
+ notevil = (notevil + 970)/2;
+ break;
+case "z971":
+ notevil = (notevil + 971)/2;
+ break;
+case "z972":
+ notevil = (notevil + 972)/2;
+ break;
+case "z973":
+ notevil = (notevil + 973)/2;
+ break;
+case "z974":
+ notevil = (notevil + 974)/2;
+ break;
+case "z975":
+ notevil = (notevil + 975)/2;
+ break;
+case "z976":
+ notevil = (notevil + 976)/2;
+ break;
+case "z977":
+ notevil = (notevil + 977)/2;
+ break;
+case "z978":
+ notevil = (notevil + 978)/2;
+ break;
+case "z979":
+ notevil = (notevil + 979)/2;
+ break;
+case "z980":
+ notevil = (notevil + 980)/2;
+ break;
+case "z981":
+ notevil = (notevil + 981)/2;
+ break;
+case "z982":
+ notevil = (notevil + 982)/2;
+ break;
+case "z983":
+ notevil = (notevil + 983)/2;
+ break;
+case "z984":
+ notevil = (notevil + 984)/2;
+ break;
+case "z985":
+ notevil = (notevil + 985)/2;
+ break;
+case "z986":
+ notevil = (notevil + 986)/2;
+ break;
+case "z987":
+ notevil = (notevil + 987)/2;
+ break;
+case "z988":
+ notevil = (notevil + 988)/2;
+ break;
+case "z989":
+ notevil = (notevil + 989)/2;
+ break;
+case "z990":
+ notevil = (notevil + 990)/2;
+ break;
+case "z991":
+ notevil = (notevil + 991)/2;
+ break;
+case "z992":
+ notevil = (notevil + 992)/2;
+ break;
+case "z993":
+ notevil = (notevil + 993)/2;
+ break;
+case "z994":
+ notevil = (notevil + 994)/2;
+ break;
+case "z995":
+ notevil = (notevil + 995)/2;
+ break;
+case "z996":
+ notevil = (notevil + 996)/2;
+ break;
+case "z997":
+ notevil = (notevil + 997)/2;
+ break;
+case "z998":
+ notevil = (notevil + 998)/2;
+ break;
+case "z999":
+ notevil = (notevil + 999)/2;
+ break;
+case "z1000":
+ notevil = (notevil + 1000)/2;
+ break;
+case "z1001":
+ notevil = (notevil + 1001)/2;
+ break;
+case "z1002":
+ notevil = (notevil + 1002)/2;
+ break;
+case "z1003":
+ notevil = (notevil + 1003)/2;
+ break;
+case "z1004":
+ notevil = (notevil + 1004)/2;
+ break;
+case "z1005":
+ notevil = (notevil + 1005)/2;
+ break;
+case "z1006":
+ notevil = (notevil + 1006)/2;
+ break;
+case "z1007":
+ notevil = (notevil + 1007)/2;
+ break;
+case "z1008":
+ notevil = (notevil + 1008)/2;
+ break;
+case "z1009":
+ notevil = (notevil + 1009)/2;
+ break;
+case "z1010":
+ notevil = (notevil + 1010)/2;
+ break;
+case "z1011":
+ notevil = (notevil + 1011)/2;
+ break;
+case "z1012":
+ notevil = (notevil + 1012)/2;
+ break;
+case "z1013":
+ notevil = (notevil + 1013)/2;
+ break;
+case "z1014":
+ notevil = (notevil + 1014)/2;
+ break;
+case "z1015":
+ notevil = (notevil + 1015)/2;
+ break;
+case "z1016":
+ notevil = (notevil + 1016)/2;
+ break;
+case "z1017":
+ notevil = (notevil + 1017)/2;
+ break;
+case "z1018":
+ notevil = (notevil + 1018)/2;
+ break;
+case "z1019":
+ notevil = (notevil + 1019)/2;
+ break;
+case "z1020":
+ notevil = (notevil + 1020)/2;
+ break;
+case "z1021":
+ notevil = (notevil + 1021)/2;
+ break;
+case "z1022":
+ notevil = (notevil + 1022)/2;
+ break;
+case "z1023":
+ notevil = (notevil + 1023)/2;
+ break;
+case "z1024":
+ notevil = (notevil + 1024)/2;
+ break;
+case "z1025":
+ notevil = (notevil + 1025)/2;
+ break;
+case "z1026":
+ notevil = (notevil + 1026)/2;
+ break;
+case "z1027":
+ notevil = (notevil + 1027)/2;
+ break;
+case "z1028":
+ notevil = (notevil + 1028)/2;
+ break;
+case "z1029":
+ notevil = (notevil + 1029)/2;
+ break;
+case "z1030":
+ notevil = (notevil + 1030)/2;
+ break;
+case "z1031":
+ notevil = (notevil + 1031)/2;
+ break;
+case "z1032":
+ notevil = (notevil + 1032)/2;
+ break;
+case "z1033":
+ notevil = (notevil + 1033)/2;
+ break;
+case "z1034":
+ notevil = (notevil + 1034)/2;
+ break;
+case "z1035":
+ notevil = (notevil + 1035)/2;
+ break;
+case "z1036":
+ notevil = (notevil + 1036)/2;
+ break;
+case "z1037":
+ notevil = (notevil + 1037)/2;
+ break;
+case "z1038":
+ notevil = (notevil + 1038)/2;
+ break;
+case "z1039":
+ notevil = (notevil + 1039)/2;
+ break;
+case "z1040":
+ notevil = (notevil + 1040)/2;
+ break;
+case "z1041":
+ notevil = (notevil + 1041)/2;
+ break;
+case "z1042":
+ notevil = (notevil + 1042)/2;
+ break;
+case "z1043":
+ notevil = (notevil + 1043)/2;
+ break;
+case "z1044":
+ notevil = (notevil + 1044)/2;
+ break;
+case "z1045":
+ notevil = (notevil + 1045)/2;
+ break;
+case "z1046":
+ notevil = (notevil + 1046)/2;
+ break;
+case "z1047":
+ notevil = (notevil + 1047)/2;
+ break;
+case "z1048":
+ notevil = (notevil + 1048)/2;
+ break;
+case "z1049":
+ notevil = (notevil + 1049)/2;
+ break;
+case "z1050":
+ notevil = (notevil + 1050)/2;
+ break;
+case "z1051":
+ notevil = (notevil + 1051)/2;
+ break;
+case "z1052":
+ notevil = (notevil + 1052)/2;
+ break;
+case "z1053":
+ notevil = (notevil + 1053)/2;
+ break;
+case "z1054":
+ notevil = (notevil + 1054)/2;
+ break;
+case "z1055":
+ notevil = (notevil + 1055)/2;
+ break;
+case "z1056":
+ notevil = (notevil + 1056)/2;
+ break;
+case "z1057":
+ notevil = (notevil + 1057)/2;
+ break;
+case "z1058":
+ notevil = (notevil + 1058)/2;
+ break;
+case "z1059":
+ notevil = (notevil + 1059)/2;
+ break;
+case "z1060":
+ notevil = (notevil + 1060)/2;
+ break;
+case "z1061":
+ notevil = (notevil + 1061)/2;
+ break;
+case "z1062":
+ notevil = (notevil + 1062)/2;
+ break;
+case "z1063":
+ notevil = (notevil + 1063)/2;
+ break;
+case "z1064":
+ notevil = (notevil + 1064)/2;
+ break;
+case "z1065":
+ notevil = (notevil + 1065)/2;
+ break;
+case "z1066":
+ notevil = (notevil + 1066)/2;
+ break;
+case "z1067":
+ notevil = (notevil + 1067)/2;
+ break;
+case "z1068":
+ notevil = (notevil + 1068)/2;
+ break;
+case "z1069":
+ notevil = (notevil + 1069)/2;
+ break;
+case "z1070":
+ notevil = (notevil + 1070)/2;
+ break;
+case "z1071":
+ notevil = (notevil + 1071)/2;
+ break;
+case "z1072":
+ notevil = (notevil + 1072)/2;
+ break;
+case "z1073":
+ notevil = (notevil + 1073)/2;
+ break;
+case "z1074":
+ notevil = (notevil + 1074)/2;
+ break;
+case "z1075":
+ notevil = (notevil + 1075)/2;
+ break;
+case "z1076":
+ notevil = (notevil + 1076)/2;
+ break;
+case "z1077":
+ notevil = (notevil + 1077)/2;
+ break;
+case "z1078":
+ notevil = (notevil + 1078)/2;
+ break;
+case "z1079":
+ notevil = (notevil + 1079)/2;
+ break;
+case "z1080":
+ notevil = (notevil + 1080)/2;
+ break;
+case "z1081":
+ notevil = (notevil + 1081)/2;
+ break;
+case "z1082":
+ notevil = (notevil + 1082)/2;
+ break;
+case "z1083":
+ notevil = (notevil + 1083)/2;
+ break;
+case "z1084":
+ notevil = (notevil + 1084)/2;
+ break;
+case "z1085":
+ notevil = (notevil + 1085)/2;
+ break;
+case "z1086":
+ notevil = (notevil + 1086)/2;
+ break;
+case "z1087":
+ notevil = (notevil + 1087)/2;
+ break;
+case "z1088":
+ notevil = (notevil + 1088)/2;
+ break;
+case "z1089":
+ notevil = (notevil + 1089)/2;
+ break;
+case "z1090":
+ notevil = (notevil + 1090)/2;
+ break;
+case "z1091":
+ notevil = (notevil + 1091)/2;
+ break;
+case "z1092":
+ notevil = (notevil + 1092)/2;
+ break;
+case "z1093":
+ notevil = (notevil + 1093)/2;
+ break;
+case "z1094":
+ notevil = (notevil + 1094)/2;
+ break;
+case "z1095":
+ notevil = (notevil + 1095)/2;
+ break;
+case "z1096":
+ notevil = (notevil + 1096)/2;
+ break;
+case "z1097":
+ notevil = (notevil + 1097)/2;
+ break;
+case "z1098":
+ notevil = (notevil + 1098)/2;
+ break;
+case "z1099":
+ notevil = (notevil + 1099)/2;
+ break;
+case "z1100":
+ notevil = (notevil + 1100)/2;
+ break;
+case "z1101":
+ notevil = (notevil + 1101)/2;
+ break;
+case "z1102":
+ notevil = (notevil + 1102)/2;
+ break;
+case "z1103":
+ notevil = (notevil + 1103)/2;
+ break;
+case "z1104":
+ notevil = (notevil + 1104)/2;
+ break;
+case "z1105":
+ notevil = (notevil + 1105)/2;
+ break;
+case "z1106":
+ notevil = (notevil + 1106)/2;
+ break;
+case "z1107":
+ notevil = (notevil + 1107)/2;
+ break;
+case "z1108":
+ notevil = (notevil + 1108)/2;
+ break;
+case "z1109":
+ notevil = (notevil + 1109)/2;
+ break;
+case "z1110":
+ notevil = (notevil + 1110)/2;
+ break;
+case "z1111":
+ notevil = (notevil + 1111)/2;
+ break;
+case "z1112":
+ notevil = (notevil + 1112)/2;
+ break;
+case "z1113":
+ notevil = (notevil + 1113)/2;
+ break;
+case "z1114":
+ notevil = (notevil + 1114)/2;
+ break;
+case "z1115":
+ notevil = (notevil + 1115)/2;
+ break;
+case "z1116":
+ notevil = (notevil + 1116)/2;
+ break;
+case "z1117":
+ notevil = (notevil + 1117)/2;
+ break;
+case "z1118":
+ notevil = (notevil + 1118)/2;
+ break;
+case "z1119":
+ notevil = (notevil + 1119)/2;
+ break;
+case "z1120":
+ notevil = (notevil + 1120)/2;
+ break;
+case "z1121":
+ notevil = (notevil + 1121)/2;
+ break;
+case "z1122":
+ notevil = (notevil + 1122)/2;
+ break;
+case "z1123":
+ notevil = (notevil + 1123)/2;
+ break;
+case "z1124":
+ notevil = (notevil + 1124)/2;
+ break;
+case "z1125":
+ notevil = (notevil + 1125)/2;
+ break;
+case "z1126":
+ notevil = (notevil + 1126)/2;
+ break;
+case "z1127":
+ notevil = (notevil + 1127)/2;
+ break;
+case "z1128":
+ notevil = (notevil + 1128)/2;
+ break;
+case "z1129":
+ notevil = (notevil + 1129)/2;
+ break;
+case "z1130":
+ notevil = (notevil + 1130)/2;
+ break;
+case "z1131":
+ notevil = (notevil + 1131)/2;
+ break;
+case "z1132":
+ notevil = (notevil + 1132)/2;
+ break;
+case "z1133":
+ notevil = (notevil + 1133)/2;
+ break;
+case "z1134":
+ notevil = (notevil + 1134)/2;
+ break;
+case "z1135":
+ notevil = (notevil + 1135)/2;
+ break;
+case "z1136":
+ notevil = (notevil + 1136)/2;
+ break;
+case "z1137":
+ notevil = (notevil + 1137)/2;
+ break;
+case "z1138":
+ notevil = (notevil + 1138)/2;
+ break;
+case "z1139":
+ notevil = (notevil + 1139)/2;
+ break;
+case "z1140":
+ notevil = (notevil + 1140)/2;
+ break;
+case "z1141":
+ notevil = (notevil + 1141)/2;
+ break;
+case "z1142":
+ notevil = (notevil + 1142)/2;
+ break;
+case "z1143":
+ notevil = (notevil + 1143)/2;
+ break;
+case "z1144":
+ notevil = (notevil + 1144)/2;
+ break;
+case "z1145":
+ notevil = (notevil + 1145)/2;
+ break;
+case "z1146":
+ notevil = (notevil + 1146)/2;
+ break;
+case "z1147":
+ notevil = (notevil + 1147)/2;
+ break;
+case "z1148":
+ notevil = (notevil + 1148)/2;
+ break;
+case "z1149":
+ notevil = (notevil + 1149)/2;
+ break;
+case "z1150":
+ notevil = (notevil + 1150)/2;
+ break;
+case "z1151":
+ notevil = (notevil + 1151)/2;
+ break;
+case "z1152":
+ notevil = (notevil + 1152)/2;
+ break;
+case "z1153":
+ notevil = (notevil + 1153)/2;
+ break;
+case "z1154":
+ notevil = (notevil + 1154)/2;
+ break;
+case "z1155":
+ notevil = (notevil + 1155)/2;
+ break;
+case "z1156":
+ notevil = (notevil + 1156)/2;
+ break;
+case "z1157":
+ notevil = (notevil + 1157)/2;
+ break;
+case "z1158":
+ notevil = (notevil + 1158)/2;
+ break;
+case "z1159":
+ notevil = (notevil + 1159)/2;
+ break;
+case "z1160":
+ notevil = (notevil + 1160)/2;
+ break;
+case "z1161":
+ notevil = (notevil + 1161)/2;
+ break;
+case "z1162":
+ notevil = (notevil + 1162)/2;
+ break;
+case "z1163":
+ notevil = (notevil + 1163)/2;
+ break;
+case "z1164":
+ notevil = (notevil + 1164)/2;
+ break;
+case "z1165":
+ notevil = (notevil + 1165)/2;
+ break;
+case "z1166":
+ notevil = (notevil + 1166)/2;
+ break;
+case "z1167":
+ notevil = (notevil + 1167)/2;
+ break;
+case "z1168":
+ notevil = (notevil + 1168)/2;
+ break;
+case "z1169":
+ notevil = (notevil + 1169)/2;
+ break;
+case "z1170":
+ notevil = (notevil + 1170)/2;
+ break;
+case "z1171":
+ notevil = (notevil + 1171)/2;
+ break;
+case "z1172":
+ notevil = (notevil + 1172)/2;
+ break;
+case "z1173":
+ notevil = (notevil + 1173)/2;
+ break;
+case "z1174":
+ notevil = (notevil + 1174)/2;
+ break;
+case "z1175":
+ notevil = (notevil + 1175)/2;
+ break;
+case "z1176":
+ notevil = (notevil + 1176)/2;
+ break;
+case "z1177":
+ notevil = (notevil + 1177)/2;
+ break;
+case "z1178":
+ notevil = (notevil + 1178)/2;
+ break;
+case "z1179":
+ notevil = (notevil + 1179)/2;
+ break;
+case "z1180":
+ notevil = (notevil + 1180)/2;
+ break;
+case "z1181":
+ notevil = (notevil + 1181)/2;
+ break;
+case "z1182":
+ notevil = (notevil + 1182)/2;
+ break;
+case "z1183":
+ notevil = (notevil + 1183)/2;
+ break;
+case "z1184":
+ notevil = (notevil + 1184)/2;
+ break;
+case "z1185":
+ notevil = (notevil + 1185)/2;
+ break;
+case "z1186":
+ notevil = (notevil + 1186)/2;
+ break;
+case "z1187":
+ notevil = (notevil + 1187)/2;
+ break;
+case "z1188":
+ notevil = (notevil + 1188)/2;
+ break;
+case "z1189":
+ notevil = (notevil + 1189)/2;
+ break;
+case "z1190":
+ notevil = (notevil + 1190)/2;
+ break;
+case "z1191":
+ notevil = (notevil + 1191)/2;
+ break;
+case "z1192":
+ notevil = (notevil + 1192)/2;
+ break;
+case "z1193":
+ notevil = (notevil + 1193)/2;
+ break;
+case "z1194":
+ notevil = (notevil + 1194)/2;
+ break;
+case "z1195":
+ notevil = (notevil + 1195)/2;
+ break;
+case "z1196":
+ notevil = (notevil + 1196)/2;
+ break;
+case "z1197":
+ notevil = (notevil + 1197)/2;
+ break;
+case "z1198":
+ notevil = (notevil + 1198)/2;
+ break;
+case "z1199":
+ notevil = (notevil + 1199)/2;
+ break;
+case "z1200":
+ notevil = (notevil + 1200)/2;
+ break;
+case "z1201":
+ notevil = (notevil + 1201)/2;
+ break;
+case "z1202":
+ notevil = (notevil + 1202)/2;
+ break;
+case "z1203":
+ notevil = (notevil + 1203)/2;
+ break;
+case "z1204":
+ notevil = (notevil + 1204)/2;
+ break;
+case "z1205":
+ notevil = (notevil + 1205)/2;
+ break;
+case "z1206":
+ notevil = (notevil + 1206)/2;
+ break;
+case "z1207":
+ notevil = (notevil + 1207)/2;
+ break;
+case "z1208":
+ notevil = (notevil + 1208)/2;
+ break;
+case "z1209":
+ notevil = (notevil + 1209)/2;
+ break;
+case "z1210":
+ notevil = (notevil + 1210)/2;
+ break;
+case "z1211":
+ notevil = (notevil + 1211)/2;
+ break;
+case "z1212":
+ notevil = (notevil + 1212)/2;
+ break;
+case "z1213":
+ notevil = (notevil + 1213)/2;
+ break;
+case "z1214":
+ notevil = (notevil + 1214)/2;
+ break;
+case "z1215":
+ notevil = (notevil + 1215)/2;
+ break;
+case "z1216":
+ notevil = (notevil + 1216)/2;
+ break;
+case "z1217":
+ notevil = (notevil + 1217)/2;
+ break;
+case "z1218":
+ notevil = (notevil + 1218)/2;
+ break;
+case "z1219":
+ notevil = (notevil + 1219)/2;
+ break;
+case "z1220":
+ notevil = (notevil + 1220)/2;
+ break;
+case "z1221":
+ notevil = (notevil + 1221)/2;
+ break;
+case "z1222":
+ notevil = (notevil + 1222)/2;
+ break;
+case "z1223":
+ notevil = (notevil + 1223)/2;
+ break;
+case "z1224":
+ notevil = (notevil + 1224)/2;
+ break;
+case "z1225":
+ notevil = (notevil + 1225)/2;
+ break;
+case "z1226":
+ notevil = (notevil + 1226)/2;
+ break;
+case "z1227":
+ notevil = (notevil + 1227)/2;
+ break;
+case "z1228":
+ notevil = (notevil + 1228)/2;
+ break;
+case "z1229":
+ notevil = (notevil + 1229)/2;
+ break;
+case "z1230":
+ notevil = (notevil + 1230)/2;
+ break;
+case "z1231":
+ notevil = (notevil + 1231)/2;
+ break;
+case "z1232":
+ notevil = (notevil + 1232)/2;
+ break;
+case "z1233":
+ notevil = (notevil + 1233)/2;
+ break;
+case "z1234":
+ notevil = (notevil + 1234)/2;
+ break;
+case "z1235":
+ notevil = (notevil + 1235)/2;
+ break;
+case "z1236":
+ notevil = (notevil + 1236)/2;
+ break;
+case "z1237":
+ notevil = (notevil + 1237)/2;
+ break;
+case "z1238":
+ notevil = (notevil + 1238)/2;
+ break;
+case "z1239":
+ notevil = (notevil + 1239)/2;
+ break;
+case "z1240":
+ notevil = (notevil + 1240)/2;
+ break;
+case "z1241":
+ notevil = (notevil + 1241)/2;
+ break;
+case "z1242":
+ notevil = (notevil + 1242)/2;
+ break;
+case "z1243":
+ notevil = (notevil + 1243)/2;
+ break;
+case "z1244":
+ notevil = (notevil + 1244)/2;
+ break;
+case "z1245":
+ notevil = (notevil + 1245)/2;
+ break;
+case "z1246":
+ notevil = (notevil + 1246)/2;
+ break;
+case "z1247":
+ notevil = (notevil + 1247)/2;
+ break;
+case "z1248":
+ notevil = (notevil + 1248)/2;
+ break;
+case "z1249":
+ notevil = (notevil + 1249)/2;
+ break;
+case "z1250":
+ notevil = (notevil + 1250)/2;
+ break;
+case "z1251":
+ notevil = (notevil + 1251)/2;
+ break;
+case "z1252":
+ notevil = (notevil + 1252)/2;
+ break;
+case "z1253":
+ notevil = (notevil + 1253)/2;
+ break;
+case "z1254":
+ notevil = (notevil + 1254)/2;
+ break;
+case "z1255":
+ notevil = (notevil + 1255)/2;
+ break;
+case "z1256":
+ notevil = (notevil + 1256)/2;
+ break;
+case "z1257":
+ notevil = (notevil + 1257)/2;
+ break;
+case "z1258":
+ notevil = (notevil + 1258)/2;
+ break;
+case "z1259":
+ notevil = (notevil + 1259)/2;
+ break;
+case "z1260":
+ notevil = (notevil + 1260)/2;
+ break;
+case "z1261":
+ notevil = (notevil + 1261)/2;
+ break;
+case "z1262":
+ notevil = (notevil + 1262)/2;
+ break;
+case "z1263":
+ notevil = (notevil + 1263)/2;
+ break;
+case "z1264":
+ notevil = (notevil + 1264)/2;
+ break;
+case "z1265":
+ notevil = (notevil + 1265)/2;
+ break;
+case "z1266":
+ notevil = (notevil + 1266)/2;
+ break;
+case "z1267":
+ notevil = (notevil + 1267)/2;
+ break;
+case "z1268":
+ notevil = (notevil + 1268)/2;
+ break;
+case "z1269":
+ notevil = (notevil + 1269)/2;
+ break;
+case "z1270":
+ notevil = (notevil + 1270)/2;
+ break;
+case "z1271":
+ notevil = (notevil + 1271)/2;
+ break;
+case "z1272":
+ notevil = (notevil + 1272)/2;
+ break;
+case "z1273":
+ notevil = (notevil + 1273)/2;
+ break;
+case "z1274":
+ notevil = (notevil + 1274)/2;
+ break;
+case "z1275":
+ notevil = (notevil + 1275)/2;
+ break;
+case "z1276":
+ notevil = (notevil + 1276)/2;
+ break;
+case "z1277":
+ notevil = (notevil + 1277)/2;
+ break;
+case "z1278":
+ notevil = (notevil + 1278)/2;
+ break;
+case "z1279":
+ notevil = (notevil + 1279)/2;
+ break;
+case "z1280":
+ notevil = (notevil + 1280)/2;
+ break;
+case "z1281":
+ notevil = (notevil + 1281)/2;
+ break;
+case "z1282":
+ notevil = (notevil + 1282)/2;
+ break;
+case "z1283":
+ notevil = (notevil + 1283)/2;
+ break;
+case "z1284":
+ notevil = (notevil + 1284)/2;
+ break;
+case "z1285":
+ notevil = (notevil + 1285)/2;
+ break;
+case "z1286":
+ notevil = (notevil + 1286)/2;
+ break;
+case "z1287":
+ notevil = (notevil + 1287)/2;
+ break;
+case "z1288":
+ notevil = (notevil + 1288)/2;
+ break;
+case "z1289":
+ notevil = (notevil + 1289)/2;
+ break;
+case "z1290":
+ notevil = (notevil + 1290)/2;
+ break;
+case "z1291":
+ notevil = (notevil + 1291)/2;
+ break;
+case "z1292":
+ notevil = (notevil + 1292)/2;
+ break;
+case "z1293":
+ notevil = (notevil + 1293)/2;
+ break;
+case "z1294":
+ notevil = (notevil + 1294)/2;
+ break;
+case "z1295":
+ notevil = (notevil + 1295)/2;
+ break;
+case "z1296":
+ notevil = (notevil + 1296)/2;
+ break;
+case "z1297":
+ notevil = (notevil + 1297)/2;
+ break;
+case "z1298":
+ notevil = (notevil + 1298)/2;
+ break;
+case "z1299":
+ notevil = (notevil + 1299)/2;
+ break;
+case "z1300":
+ notevil = (notevil + 1300)/2;
+ break;
+case "z1301":
+ notevil = (notevil + 1301)/2;
+ break;
+case "z1302":
+ notevil = (notevil + 1302)/2;
+ break;
+case "z1303":
+ notevil = (notevil + 1303)/2;
+ break;
+case "z1304":
+ notevil = (notevil + 1304)/2;
+ break;
+case "z1305":
+ notevil = (notevil + 1305)/2;
+ break;
+case "z1306":
+ notevil = (notevil + 1306)/2;
+ break;
+case "z1307":
+ notevil = (notevil + 1307)/2;
+ break;
+case "z1308":
+ notevil = (notevil + 1308)/2;
+ break;
+case "z1309":
+ notevil = (notevil + 1309)/2;
+ break;
+case "z1310":
+ notevil = (notevil + 1310)/2;
+ break;
+case "z1311":
+ notevil = (notevil + 1311)/2;
+ break;
+case "z1312":
+ notevil = (notevil + 1312)/2;
+ break;
+case "z1313":
+ notevil = (notevil + 1313)/2;
+ break;
+case "z1314":
+ notevil = (notevil + 1314)/2;
+ break;
+case "z1315":
+ notevil = (notevil + 1315)/2;
+ break;
+case "z1316":
+ notevil = (notevil + 1316)/2;
+ break;
+case "z1317":
+ notevil = (notevil + 1317)/2;
+ break;
+case "z1318":
+ notevil = (notevil + 1318)/2;
+ break;
+case "z1319":
+ notevil = (notevil + 1319)/2;
+ break;
+case "z1320":
+ notevil = (notevil + 1320)/2;
+ break;
+case "z1321":
+ notevil = (notevil + 1321)/2;
+ break;
+case "z1322":
+ notevil = (notevil + 1322)/2;
+ break;
+case "z1323":
+ notevil = (notevil + 1323)/2;
+ break;
+case "z1324":
+ notevil = (notevil + 1324)/2;
+ break;
+case "z1325":
+ notevil = (notevil + 1325)/2;
+ break;
+case "z1326":
+ notevil = (notevil + 1326)/2;
+ break;
+case "z1327":
+ notevil = (notevil + 1327)/2;
+ break;
+case "z1328":
+ notevil = (notevil + 1328)/2;
+ break;
+case "z1329":
+ notevil = (notevil + 1329)/2;
+ break;
+case "z1330":
+ notevil = (notevil + 1330)/2;
+ break;
+case "z1331":
+ notevil = (notevil + 1331)/2;
+ break;
+case "z1332":
+ notevil = (notevil + 1332)/2;
+ break;
+case "z1333":
+ notevil = (notevil + 1333)/2;
+ break;
+case "z1334":
+ notevil = (notevil + 1334)/2;
+ break;
+case "z1335":
+ notevil = (notevil + 1335)/2;
+ break;
+case "z1336":
+ notevil = (notevil + 1336)/2;
+ break;
+case "z1337":
+ notevil = (notevil + 1337)/2;
+ break;
+case "z1338":
+ notevil = (notevil + 1338)/2;
+ break;
+case "z1339":
+ notevil = (notevil + 1339)/2;
+ break;
+case "z1340":
+ notevil = (notevil + 1340)/2;
+ break;
+case "z1341":
+ notevil = (notevil + 1341)/2;
+ break;
+case "z1342":
+ notevil = (notevil + 1342)/2;
+ break;
+case "z1343":
+ notevil = (notevil + 1343)/2;
+ break;
+case "z1344":
+ notevil = (notevil + 1344)/2;
+ break;
+case "z1345":
+ notevil = (notevil + 1345)/2;
+ break;
+case "z1346":
+ notevil = (notevil + 1346)/2;
+ break;
+case "z1347":
+ notevil = (notevil + 1347)/2;
+ break;
+case "z1348":
+ notevil = (notevil + 1348)/2;
+ break;
+case "z1349":
+ notevil = (notevil + 1349)/2;
+ break;
+case "z1350":
+ notevil = (notevil + 1350)/2;
+ break;
+case "z1351":
+ notevil = (notevil + 1351)/2;
+ break;
+case "z1352":
+ notevil = (notevil + 1352)/2;
+ break;
+case "z1353":
+ notevil = (notevil + 1353)/2;
+ break;
+case "z1354":
+ notevil = (notevil + 1354)/2;
+ break;
+case "z1355":
+ notevil = (notevil + 1355)/2;
+ break;
+case "z1356":
+ notevil = (notevil + 1356)/2;
+ break;
+case "z1357":
+ notevil = (notevil + 1357)/2;
+ break;
+case "z1358":
+ notevil = (notevil + 1358)/2;
+ break;
+case "z1359":
+ notevil = (notevil + 1359)/2;
+ break;
+case "z1360":
+ notevil = (notevil + 1360)/2;
+ break;
+case "z1361":
+ notevil = (notevil + 1361)/2;
+ break;
+case "z1362":
+ notevil = (notevil + 1362)/2;
+ break;
+case "z1363":
+ notevil = (notevil + 1363)/2;
+ break;
+case "z1364":
+ notevil = (notevil + 1364)/2;
+ break;
+case "z1365":
+ notevil = (notevil + 1365)/2;
+ break;
+case "z1366":
+ notevil = (notevil + 1366)/2;
+ break;
+case "z1367":
+ notevil = (notevil + 1367)/2;
+ break;
+case "z1368":
+ notevil = (notevil + 1368)/2;
+ break;
+case "z1369":
+ notevil = (notevil + 1369)/2;
+ break;
+case "z1370":
+ notevil = (notevil + 1370)/2;
+ break;
+case "z1371":
+ notevil = (notevil + 1371)/2;
+ break;
+case "z1372":
+ notevil = (notevil + 1372)/2;
+ break;
+case "z1373":
+ notevil = (notevil + 1373)/2;
+ break;
+case "z1374":
+ notevil = (notevil + 1374)/2;
+ break;
+case "z1375":
+ notevil = (notevil + 1375)/2;
+ break;
+case "z1376":
+ notevil = (notevil + 1376)/2;
+ break;
+case "z1377":
+ notevil = (notevil + 1377)/2;
+ break;
+case "z1378":
+ notevil = (notevil + 1378)/2;
+ break;
+case "z1379":
+ notevil = (notevil + 1379)/2;
+ break;
+case "z1380":
+ notevil = (notevil + 1380)/2;
+ break;
+case "z1381":
+ notevil = (notevil + 1381)/2;
+ break;
+case "z1382":
+ notevil = (notevil + 1382)/2;
+ break;
+case "z1383":
+ notevil = (notevil + 1383)/2;
+ break;
+case "z1384":
+ notevil = (notevil + 1384)/2;
+ break;
+case "z1385":
+ notevil = (notevil + 1385)/2;
+ break;
+case "z1386":
+ notevil = (notevil + 1386)/2;
+ break;
+case "z1387":
+ notevil = (notevil + 1387)/2;
+ break;
+case "z1388":
+ notevil = (notevil + 1388)/2;
+ break;
+case "z1389":
+ notevil = (notevil + 1389)/2;
+ break;
+case "z1390":
+ notevil = (notevil + 1390)/2;
+ break;
+case "z1391":
+ notevil = (notevil + 1391)/2;
+ break;
+case "z1392":
+ notevil = (notevil + 1392)/2;
+ break;
+case "z1393":
+ notevil = (notevil + 1393)/2;
+ break;
+case "z1394":
+ notevil = (notevil + 1394)/2;
+ break;
+case "z1395":
+ notevil = (notevil + 1395)/2;
+ break;
+case "z1396":
+ notevil = (notevil + 1396)/2;
+ break;
+case "z1397":
+ notevil = (notevil + 1397)/2;
+ break;
+case "z1398":
+ notevil = (notevil + 1398)/2;
+ break;
+case "z1399":
+ notevil = (notevil + 1399)/2;
+ break;
+case "z1400":
+ notevil = (notevil + 1400)/2;
+ break;
+case "z1401":
+ notevil = (notevil + 1401)/2;
+ break;
+case "z1402":
+ notevil = (notevil + 1402)/2;
+ break;
+case "z1403":
+ notevil = (notevil + 1403)/2;
+ break;
+case "z1404":
+ notevil = (notevil + 1404)/2;
+ break;
+case "z1405":
+ notevil = (notevil + 1405)/2;
+ break;
+case "z1406":
+ notevil = (notevil + 1406)/2;
+ break;
+case "z1407":
+ notevil = (notevil + 1407)/2;
+ break;
+case "z1408":
+ notevil = (notevil + 1408)/2;
+ break;
+case "z1409":
+ notevil = (notevil + 1409)/2;
+ break;
+case "z1410":
+ notevil = (notevil + 1410)/2;
+ break;
+case "z1411":
+ notevil = (notevil + 1411)/2;
+ break;
+case "z1412":
+ notevil = (notevil + 1412)/2;
+ break;
+case "z1413":
+ notevil = (notevil + 1413)/2;
+ break;
+case "z1414":
+ notevil = (notevil + 1414)/2;
+ break;
+case "z1415":
+ notevil = (notevil + 1415)/2;
+ break;
+case "z1416":
+ notevil = (notevil + 1416)/2;
+ break;
+case "z1417":
+ notevil = (notevil + 1417)/2;
+ break;
+case "z1418":
+ notevil = (notevil + 1418)/2;
+ break;
+case "z1419":
+ notevil = (notevil + 1419)/2;
+ break;
+case "z1420":
+ notevil = (notevil + 1420)/2;
+ break;
+case "z1421":
+ notevil = (notevil + 1421)/2;
+ break;
+case "z1422":
+ notevil = (notevil + 1422)/2;
+ break;
+case "z1423":
+ notevil = (notevil + 1423)/2;
+ break;
+case "z1424":
+ notevil = (notevil + 1424)/2;
+ break;
+case "z1425":
+ notevil = (notevil + 1425)/2;
+ break;
+case "z1426":
+ notevil = (notevil + 1426)/2;
+ break;
+case "z1427":
+ notevil = (notevil + 1427)/2;
+ break;
+case "z1428":
+ notevil = (notevil + 1428)/2;
+ break;
+case "z1429":
+ notevil = (notevil + 1429)/2;
+ break;
+case "z1430":
+ notevil = (notevil + 1430)/2;
+ break;
+case "z1431":
+ notevil = (notevil + 1431)/2;
+ break;
+case "z1432":
+ notevil = (notevil + 1432)/2;
+ break;
+case "z1433":
+ notevil = (notevil + 1433)/2;
+ break;
+case "z1434":
+ notevil = (notevil + 1434)/2;
+ break;
+case "z1435":
+ notevil = (notevil + 1435)/2;
+ break;
+case "z1436":
+ notevil = (notevil + 1436)/2;
+ break;
+case "z1437":
+ notevil = (notevil + 1437)/2;
+ break;
+case "z1438":
+ notevil = (notevil + 1438)/2;
+ break;
+case "z1439":
+ notevil = (notevil + 1439)/2;
+ break;
+case "z1440":
+ notevil = (notevil + 1440)/2;
+ break;
+case "z1441":
+ notevil = (notevil + 1441)/2;
+ break;
+case "z1442":
+ notevil = (notevil + 1442)/2;
+ break;
+case "z1443":
+ notevil = (notevil + 1443)/2;
+ break;
+case "z1444":
+ notevil = (notevil + 1444)/2;
+ break;
+case "z1445":
+ notevil = (notevil + 1445)/2;
+ break;
+case "z1446":
+ notevil = (notevil + 1446)/2;
+ break;
+case "z1447":
+ notevil = (notevil + 1447)/2;
+ break;
+case "z1448":
+ notevil = (notevil + 1448)/2;
+ break;
+case "z1449":
+ notevil = (notevil + 1449)/2;
+ break;
+case "z1450":
+ notevil = (notevil + 1450)/2;
+ break;
+case "z1451":
+ notevil = (notevil + 1451)/2;
+ break;
+case "z1452":
+ notevil = (notevil + 1452)/2;
+ break;
+case "z1453":
+ notevil = (notevil + 1453)/2;
+ break;
+case "z1454":
+ notevil = (notevil + 1454)/2;
+ break;
+case "z1455":
+ notevil = (notevil + 1455)/2;
+ break;
+case "z1456":
+ notevil = (notevil + 1456)/2;
+ break;
+case "z1457":
+ notevil = (notevil + 1457)/2;
+ break;
+case "z1458":
+ notevil = (notevil + 1458)/2;
+ break;
+case "z1459":
+ notevil = (notevil + 1459)/2;
+ break;
+case "z1460":
+ notevil = (notevil + 1460)/2;
+ break;
+case "z1461":
+ notevil = (notevil + 1461)/2;
+ break;
+case "z1462":
+ notevil = (notevil + 1462)/2;
+ break;
+case "z1463":
+ notevil = (notevil + 1463)/2;
+ break;
+case "z1464":
+ notevil = (notevil + 1464)/2;
+ break;
+case "z1465":
+ notevil = (notevil + 1465)/2;
+ break;
+case "z1466":
+ notevil = (notevil + 1466)/2;
+ break;
+case "z1467":
+ notevil = (notevil + 1467)/2;
+ break;
+case "z1468":
+ notevil = (notevil + 1468)/2;
+ break;
+case "z1469":
+ notevil = (notevil + 1469)/2;
+ break;
+case "z1470":
+ notevil = (notevil + 1470)/2;
+ break;
+case "z1471":
+ notevil = (notevil + 1471)/2;
+ break;
+case "z1472":
+ notevil = (notevil + 1472)/2;
+ break;
+case "z1473":
+ notevil = (notevil + 1473)/2;
+ break;
+case "z1474":
+ notevil = (notevil + 1474)/2;
+ break;
+case "z1475":
+ notevil = (notevil + 1475)/2;
+ break;
+case "z1476":
+ notevil = (notevil + 1476)/2;
+ break;
+case "z1477":
+ notevil = (notevil + 1477)/2;
+ break;
+case "z1478":
+ notevil = (notevil + 1478)/2;
+ break;
+case "z1479":
+ notevil = (notevil + 1479)/2;
+ break;
+case "z1480":
+ notevil = (notevil + 1480)/2;
+ break;
+case "z1481":
+ notevil = (notevil + 1481)/2;
+ break;
+case "z1482":
+ notevil = (notevil + 1482)/2;
+ break;
+case "z1483":
+ notevil = (notevil + 1483)/2;
+ break;
+case "z1484":
+ notevil = (notevil + 1484)/2;
+ break;
+case "z1485":
+ notevil = (notevil + 1485)/2;
+ break;
+case "z1486":
+ notevil = (notevil + 1486)/2;
+ break;
+case "z1487":
+ notevil = (notevil + 1487)/2;
+ break;
+case "z1488":
+ notevil = (notevil + 1488)/2;
+ break;
+case "z1489":
+ notevil = (notevil + 1489)/2;
+ break;
+case "z1490":
+ notevil = (notevil + 1490)/2;
+ break;
+case "z1491":
+ notevil = (notevil + 1491)/2;
+ break;
+case "z1492":
+ notevil = (notevil + 1492)/2;
+ break;
+case "z1493":
+ notevil = (notevil + 1493)/2;
+ break;
+case "z1494":
+ notevil = (notevil + 1494)/2;
+ break;
+case "z1495":
+ notevil = (notevil + 1495)/2;
+ break;
+case "z1496":
+ notevil = (notevil + 1496)/2;
+ break;
+case "z1497":
+ notevil = (notevil + 1497)/2;
+ break;
+case "z1498":
+ notevil = (notevil + 1498)/2;
+ break;
+case "z1499":
+ notevil = (notevil + 1499)/2;
+ break;
+case "z1500":
+ notevil = (notevil + 1500)/2;
+ break;
+case "z1501":
+ notevil = (notevil + 1501)/2;
+ break;
+case "z1502":
+ notevil = (notevil + 1502)/2;
+ break;
+case "z1503":
+ notevil = (notevil + 1503)/2;
+ break;
+case "z1504":
+ notevil = (notevil + 1504)/2;
+ break;
+case "z1505":
+ notevil = (notevil + 1505)/2;
+ break;
+case "z1506":
+ notevil = (notevil + 1506)/2;
+ break;
+case "z1507":
+ notevil = (notevil + 1507)/2;
+ break;
+case "z1508":
+ notevil = (notevil + 1508)/2;
+ break;
+case "z1509":
+ notevil = (notevil + 1509)/2;
+ break;
+case "z1510":
+ notevil = (notevil + 1510)/2;
+ break;
+case "z1511":
+ notevil = (notevil + 1511)/2;
+ break;
+case "z1512":
+ notevil = (notevil + 1512)/2;
+ break;
+case "z1513":
+ notevil = (notevil + 1513)/2;
+ break;
+case "z1514":
+ notevil = (notevil + 1514)/2;
+ break;
+case "z1515":
+ notevil = (notevil + 1515)/2;
+ break;
+case "z1516":
+ notevil = (notevil + 1516)/2;
+ break;
+case "z1517":
+ notevil = (notevil + 1517)/2;
+ break;
+case "z1518":
+ notevil = (notevil + 1518)/2;
+ break;
+case "z1519":
+ notevil = (notevil + 1519)/2;
+ break;
+case "z1520":
+ notevil = (notevil + 1520)/2;
+ break;
+case "z1521":
+ notevil = (notevil + 1521)/2;
+ break;
+case "z1522":
+ notevil = (notevil + 1522)/2;
+ break;
+case "z1523":
+ notevil = (notevil + 1523)/2;
+ break;
+case "z1524":
+ notevil = (notevil + 1524)/2;
+ break;
+case "z1525":
+ notevil = (notevil + 1525)/2;
+ break;
+case "z1526":
+ notevil = (notevil + 1526)/2;
+ break;
+case "z1527":
+ notevil = (notevil + 1527)/2;
+ break;
+case "z1528":
+ notevil = (notevil + 1528)/2;
+ break;
+case "z1529":
+ notevil = (notevil + 1529)/2;
+ break;
+case "z1530":
+ notevil = (notevil + 1530)/2;
+ break;
+case "z1531":
+ notevil = (notevil + 1531)/2;
+ break;
+case "z1532":
+ notevil = (notevil + 1532)/2;
+ break;
+case "z1533":
+ notevil = (notevil + 1533)/2;
+ break;
+case "z1534":
+ notevil = (notevil + 1534)/2;
+ break;
+case "z1535":
+ notevil = (notevil + 1535)/2;
+ break;
+case "z1536":
+ notevil = (notevil + 1536)/2;
+ break;
+case "z1537":
+ notevil = (notevil + 1537)/2;
+ break;
+case "z1538":
+ notevil = (notevil + 1538)/2;
+ break;
+case "z1539":
+ notevil = (notevil + 1539)/2;
+ break;
+case "z1540":
+ notevil = (notevil + 1540)/2;
+ break;
+case "z1541":
+ notevil = (notevil + 1541)/2;
+ break;
+case "z1542":
+ notevil = (notevil + 1542)/2;
+ break;
+case "z1543":
+ notevil = (notevil + 1543)/2;
+ break;
+case "z1544":
+ notevil = (notevil + 1544)/2;
+ break;
+case "z1545":
+ notevil = (notevil + 1545)/2;
+ break;
+case "z1546":
+ notevil = (notevil + 1546)/2;
+ break;
+case "z1547":
+ notevil = (notevil + 1547)/2;
+ break;
+case "z1548":
+ notevil = (notevil + 1548)/2;
+ break;
+case "z1549":
+ notevil = (notevil + 1549)/2;
+ break;
+case "z1550":
+ notevil = (notevil + 1550)/2;
+ break;
+case "z1551":
+ notevil = (notevil + 1551)/2;
+ break;
+case "z1552":
+ notevil = (notevil + 1552)/2;
+ break;
+case "z1553":
+ notevil = (notevil + 1553)/2;
+ break;
+case "z1554":
+ notevil = (notevil + 1554)/2;
+ break;
+case "z1555":
+ notevil = (notevil + 1555)/2;
+ break;
+case "z1556":
+ notevil = (notevil + 1556)/2;
+ break;
+case "z1557":
+ notevil = (notevil + 1557)/2;
+ break;
+case "z1558":
+ notevil = (notevil + 1558)/2;
+ break;
+case "z1559":
+ notevil = (notevil + 1559)/2;
+ break;
+case "z1560":
+ notevil = (notevil + 1560)/2;
+ break;
+case "z1561":
+ notevil = (notevil + 1561)/2;
+ break;
+case "z1562":
+ notevil = (notevil + 1562)/2;
+ break;
+case "z1563":
+ notevil = (notevil + 1563)/2;
+ break;
+case "z1564":
+ notevil = (notevil + 1564)/2;
+ break;
+case "z1565":
+ notevil = (notevil + 1565)/2;
+ break;
+case "z1566":
+ notevil = (notevil + 1566)/2;
+ break;
+case "z1567":
+ notevil = (notevil + 1567)/2;
+ break;
+case "z1568":
+ notevil = (notevil + 1568)/2;
+ break;
+case "z1569":
+ notevil = (notevil + 1569)/2;
+ break;
+case "z1570":
+ notevil = (notevil + 1570)/2;
+ break;
+case "z1571":
+ notevil = (notevil + 1571)/2;
+ break;
+case "z1572":
+ notevil = (notevil + 1572)/2;
+ break;
+case "z1573":
+ notevil = (notevil + 1573)/2;
+ break;
+case "z1574":
+ notevil = (notevil + 1574)/2;
+ break;
+case "z1575":
+ notevil = (notevil + 1575)/2;
+ break;
+case "z1576":
+ notevil = (notevil + 1576)/2;
+ break;
+case "z1577":
+ notevil = (notevil + 1577)/2;
+ break;
+case "z1578":
+ notevil = (notevil + 1578)/2;
+ break;
+case "z1579":
+ notevil = (notevil + 1579)/2;
+ break;
+case "z1580":
+ notevil = (notevil + 1580)/2;
+ break;
+case "z1581":
+ notevil = (notevil + 1581)/2;
+ break;
+case "z1582":
+ notevil = (notevil + 1582)/2;
+ break;
+case "z1583":
+ notevil = (notevil + 1583)/2;
+ break;
+case "z1584":
+ notevil = (notevil + 1584)/2;
+ break;
+case "z1585":
+ notevil = (notevil + 1585)/2;
+ break;
+case "z1586":
+ notevil = (notevil + 1586)/2;
+ break;
+case "z1587":
+ notevil = (notevil + 1587)/2;
+ break;
+case "z1588":
+ notevil = (notevil + 1588)/2;
+ break;
+case "z1589":
+ notevil = (notevil + 1589)/2;
+ break;
+case "z1590":
+ notevil = (notevil + 1590)/2;
+ break;
+case "z1591":
+ notevil = (notevil + 1591)/2;
+ break;
+case "z1592":
+ notevil = (notevil + 1592)/2;
+ break;
+case "z1593":
+ notevil = (notevil + 1593)/2;
+ break;
+case "z1594":
+ notevil = (notevil + 1594)/2;
+ break;
+case "z1595":
+ notevil = (notevil + 1595)/2;
+ break;
+case "z1596":
+ notevil = (notevil + 1596)/2;
+ break;
+case "z1597":
+ notevil = (notevil + 1597)/2;
+ break;
+case "z1598":
+ notevil = (notevil + 1598)/2;
+ break;
+case "z1599":
+ notevil = (notevil + 1599)/2;
+ break;
+case "z1600":
+ notevil = (notevil + 1600)/2;
+ break;
+case "z1601":
+ notevil = (notevil + 1601)/2;
+ break;
+case "z1602":
+ notevil = (notevil + 1602)/2;
+ break;
+case "z1603":
+ notevil = (notevil + 1603)/2;
+ break;
+case "z1604":
+ notevil = (notevil + 1604)/2;
+ break;
+case "z1605":
+ notevil = (notevil + 1605)/2;
+ break;
+case "z1606":
+ notevil = (notevil + 1606)/2;
+ break;
+case "z1607":
+ notevil = (notevil + 1607)/2;
+ break;
+case "z1608":
+ notevil = (notevil + 1608)/2;
+ break;
+case "z1609":
+ notevil = (notevil + 1609)/2;
+ break;
+case "z1610":
+ notevil = (notevil + 1610)/2;
+ break;
+case "z1611":
+ notevil = (notevil + 1611)/2;
+ break;
+case "z1612":
+ notevil = (notevil + 1612)/2;
+ break;
+case "z1613":
+ notevil = (notevil + 1613)/2;
+ break;
+case "z1614":
+ notevil = (notevil + 1614)/2;
+ break;
+case "z1615":
+ notevil = (notevil + 1615)/2;
+ break;
+case "z1616":
+ notevil = (notevil + 1616)/2;
+ break;
+case "z1617":
+ notevil = (notevil + 1617)/2;
+ break;
+case "z1618":
+ notevil = (notevil + 1618)/2;
+ break;
+case "z1619":
+ notevil = (notevil + 1619)/2;
+ break;
+case "z1620":
+ notevil = (notevil + 1620)/2;
+ break;
+case "z1621":
+ notevil = (notevil + 1621)/2;
+ break;
+case "z1622":
+ notevil = (notevil + 1622)/2;
+ break;
+case "z1623":
+ notevil = (notevil + 1623)/2;
+ break;
+case "z1624":
+ notevil = (notevil + 1624)/2;
+ break;
+case "z1625":
+ notevil = (notevil + 1625)/2;
+ break;
+case "z1626":
+ notevil = (notevil + 1626)/2;
+ break;
+case "z1627":
+ notevil = (notevil + 1627)/2;
+ break;
+case "z1628":
+ notevil = (notevil + 1628)/2;
+ break;
+case "z1629":
+ notevil = (notevil + 1629)/2;
+ break;
+case "z1630":
+ notevil = (notevil + 1630)/2;
+ break;
+case "z1631":
+ notevil = (notevil + 1631)/2;
+ break;
+case "z1632":
+ notevil = (notevil + 1632)/2;
+ break;
+case "z1633":
+ notevil = (notevil + 1633)/2;
+ break;
+case "z1634":
+ notevil = (notevil + 1634)/2;
+ break;
+case "z1635":
+ notevil = (notevil + 1635)/2;
+ break;
+case "z1636":
+ notevil = (notevil + 1636)/2;
+ break;
+case "z1637":
+ notevil = (notevil + 1637)/2;
+ break;
+case "z1638":
+ notevil = (notevil + 1638)/2;
+ break;
+case "z1639":
+ notevil = (notevil + 1639)/2;
+ break;
+case "z1640":
+ notevil = (notevil + 1640)/2;
+ break;
+case "z1641":
+ notevil = (notevil + 1641)/2;
+ break;
+case "z1642":
+ notevil = (notevil + 1642)/2;
+ break;
+case "z1643":
+ notevil = (notevil + 1643)/2;
+ break;
+case "z1644":
+ notevil = (notevil + 1644)/2;
+ break;
+case "z1645":
+ notevil = (notevil + 1645)/2;
+ break;
+case "z1646":
+ notevil = (notevil + 1646)/2;
+ break;
+case "z1647":
+ notevil = (notevil + 1647)/2;
+ break;
+case "z1648":
+ notevil = (notevil + 1648)/2;
+ break;
+case "z1649":
+ notevil = (notevil + 1649)/2;
+ break;
+case "z1650":
+ notevil = (notevil + 1650)/2;
+ break;
+case "z1651":
+ notevil = (notevil + 1651)/2;
+ break;
+case "z1652":
+ notevil = (notevil + 1652)/2;
+ break;
+case "z1653":
+ notevil = (notevil + 1653)/2;
+ break;
+case "z1654":
+ notevil = (notevil + 1654)/2;
+ break;
+case "z1655":
+ notevil = (notevil + 1655)/2;
+ break;
+case "z1656":
+ notevil = (notevil + 1656)/2;
+ break;
+case "z1657":
+ notevil = (notevil + 1657)/2;
+ break;
+case "z1658":
+ notevil = (notevil + 1658)/2;
+ break;
+case "z1659":
+ notevil = (notevil + 1659)/2;
+ break;
+case "z1660":
+ notevil = (notevil + 1660)/2;
+ break;
+case "z1661":
+ notevil = (notevil + 1661)/2;
+ break;
+case "z1662":
+ notevil = (notevil + 1662)/2;
+ break;
+case "z1663":
+ notevil = (notevil + 1663)/2;
+ break;
+case "z1664":
+ notevil = (notevil + 1664)/2;
+ break;
+case "z1665":
+ notevil = (notevil + 1665)/2;
+ break;
+case "z1666":
+ notevil = (notevil + 1666)/2;
+ break;
+case "z1667":
+ notevil = (notevil + 1667)/2;
+ break;
+case "z1668":
+ notevil = (notevil + 1668)/2;
+ break;
+case "z1669":
+ notevil = (notevil + 1669)/2;
+ break;
+case "z1670":
+ notevil = (notevil + 1670)/2;
+ break;
+case "z1671":
+ notevil = (notevil + 1671)/2;
+ break;
+case "z1672":
+ notevil = (notevil + 1672)/2;
+ break;
+case "z1673":
+ notevil = (notevil + 1673)/2;
+ break;
+case "z1674":
+ notevil = (notevil + 1674)/2;
+ break;
+case "z1675":
+ notevil = (notevil + 1675)/2;
+ break;
+case "z1676":
+ notevil = (notevil + 1676)/2;
+ break;
+case "z1677":
+ notevil = (notevil + 1677)/2;
+ break;
+case "z1678":
+ notevil = (notevil + 1678)/2;
+ break;
+case "z1679":
+ notevil = (notevil + 1679)/2;
+ break;
+case "z1680":
+ notevil = (notevil + 1680)/2;
+ break;
+case "z1681":
+ notevil = (notevil + 1681)/2;
+ break;
+case "z1682":
+ notevil = (notevil + 1682)/2;
+ break;
+case "z1683":
+ notevil = (notevil + 1683)/2;
+ break;
+case "z1684":
+ notevil = (notevil + 1684)/2;
+ break;
+case "z1685":
+ notevil = (notevil + 1685)/2;
+ break;
+case "z1686":
+ notevil = (notevil + 1686)/2;
+ break;
+case "z1687":
+ notevil = (notevil + 1687)/2;
+ break;
+case "z1688":
+ notevil = (notevil + 1688)/2;
+ break;
+case "z1689":
+ notevil = (notevil + 1689)/2;
+ break;
+case "z1690":
+ notevil = (notevil + 1690)/2;
+ break;
+case "z1691":
+ notevil = (notevil + 1691)/2;
+ break;
+case "z1692":
+ notevil = (notevil + 1692)/2;
+ break;
+case "z1693":
+ notevil = (notevil + 1693)/2;
+ break;
+case "z1694":
+ notevil = (notevil + 1694)/2;
+ break;
+case "z1695":
+ notevil = (notevil + 1695)/2;
+ break;
+case "z1696":
+ notevil = (notevil + 1696)/2;
+ break;
+case "z1697":
+ notevil = (notevil + 1697)/2;
+ break;
+case "z1698":
+ notevil = (notevil + 1698)/2;
+ break;
+case "z1699":
+ notevil = (notevil + 1699)/2;
+ break;
+case "z1700":
+ notevil = (notevil + 1700)/2;
+ break;
+case "z1701":
+ notevil = (notevil + 1701)/2;
+ break;
+case "z1702":
+ notevil = (notevil + 1702)/2;
+ break;
+case "z1703":
+ notevil = (notevil + 1703)/2;
+ break;
+case "z1704":
+ notevil = (notevil + 1704)/2;
+ break;
+case "z1705":
+ notevil = (notevil + 1705)/2;
+ break;
+case "z1706":
+ notevil = (notevil + 1706)/2;
+ break;
+case "z1707":
+ notevil = (notevil + 1707)/2;
+ break;
+case "z1708":
+ notevil = (notevil + 1708)/2;
+ break;
+case "z1709":
+ notevil = (notevil + 1709)/2;
+ break;
+case "z1710":
+ notevil = (notevil + 1710)/2;
+ break;
+case "z1711":
+ notevil = (notevil + 1711)/2;
+ break;
+case "z1712":
+ notevil = (notevil + 1712)/2;
+ break;
+case "z1713":
+ notevil = (notevil + 1713)/2;
+ break;
+case "z1714":
+ notevil = (notevil + 1714)/2;
+ break;
+case "z1715":
+ notevil = (notevil + 1715)/2;
+ break;
+case "z1716":
+ notevil = (notevil + 1716)/2;
+ break;
+case "z1717":
+ notevil = (notevil + 1717)/2;
+ break;
+case "z1718":
+ notevil = (notevil + 1718)/2;
+ break;
+case "z1719":
+ notevil = (notevil + 1719)/2;
+ break;
+case "z1720":
+ notevil = (notevil + 1720)/2;
+ break;
+case "z1721":
+ notevil = (notevil + 1721)/2;
+ break;
+case "z1722":
+ notevil = (notevil + 1722)/2;
+ break;
+case "z1723":
+ notevil = (notevil + 1723)/2;
+ break;
+case "z1724":
+ notevil = (notevil + 1724)/2;
+ break;
+case "z1725":
+ notevil = (notevil + 1725)/2;
+ break;
+case "z1726":
+ notevil = (notevil + 1726)/2;
+ break;
+case "z1727":
+ notevil = (notevil + 1727)/2;
+ break;
+case "z1728":
+ notevil = (notevil + 1728)/2;
+ break;
+case "z1729":
+ notevil = (notevil + 1729)/2;
+ break;
+case "z1730":
+ notevil = (notevil + 1730)/2;
+ break;
+case "z1731":
+ notevil = (notevil + 1731)/2;
+ break;
+case "z1732":
+ notevil = (notevil + 1732)/2;
+ break;
+case "z1733":
+ notevil = (notevil + 1733)/2;
+ break;
+case "z1734":
+ notevil = (notevil + 1734)/2;
+ break;
+case "z1735":
+ notevil = (notevil + 1735)/2;
+ break;
+case "z1736":
+ notevil = (notevil + 1736)/2;
+ break;
+case "z1737":
+ notevil = (notevil + 1737)/2;
+ break;
+case "z1738":
+ notevil = (notevil + 1738)/2;
+ break;
+case "z1739":
+ notevil = (notevil + 1739)/2;
+ break;
+case "z1740":
+ notevil = (notevil + 1740)/2;
+ break;
+case "z1741":
+ notevil = (notevil + 1741)/2;
+ break;
+case "z1742":
+ notevil = (notevil + 1742)/2;
+ break;
+case "z1743":
+ notevil = (notevil + 1743)/2;
+ break;
+case "z1744":
+ notevil = (notevil + 1744)/2;
+ break;
+case "z1745":
+ notevil = (notevil + 1745)/2;
+ break;
+case "z1746":
+ notevil = (notevil + 1746)/2;
+ break;
+case "z1747":
+ notevil = (notevil + 1747)/2;
+ break;
+case "z1748":
+ notevil = (notevil + 1748)/2;
+ break;
+case "z1749":
+ notevil = (notevil + 1749)/2;
+ break;
+case "z1750":
+ notevil = (notevil + 1750)/2;
+ break;
+case "z1751":
+ notevil = (notevil + 1751)/2;
+ break;
+case "z1752":
+ notevil = (notevil + 1752)/2;
+ break;
+case "z1753":
+ notevil = (notevil + 1753)/2;
+ break;
+case "z1754":
+ notevil = (notevil + 1754)/2;
+ break;
+case "z1755":
+ notevil = (notevil + 1755)/2;
+ break;
+case "z1756":
+ notevil = (notevil + 1756)/2;
+ break;
+case "z1757":
+ notevil = (notevil + 1757)/2;
+ break;
+case "z1758":
+ notevil = (notevil + 1758)/2;
+ break;
+case "z1759":
+ notevil = (notevil + 1759)/2;
+ break;
+case "z1760":
+ notevil = (notevil + 1760)/2;
+ break;
+case "z1761":
+ notevil = (notevil + 1761)/2;
+ break;
+case "z1762":
+ notevil = (notevil + 1762)/2;
+ break;
+case "z1763":
+ notevil = (notevil + 1763)/2;
+ break;
+case "z1764":
+ notevil = (notevil + 1764)/2;
+ break;
+case "z1765":
+ notevil = (notevil + 1765)/2;
+ break;
+case "z1766":
+ notevil = (notevil + 1766)/2;
+ break;
+case "z1767":
+ notevil = (notevil + 1767)/2;
+ break;
+case "z1768":
+ notevil = (notevil + 1768)/2;
+ break;
+case "z1769":
+ notevil = (notevil + 1769)/2;
+ break;
+case "z1770":
+ notevil = (notevil + 1770)/2;
+ break;
+case "z1771":
+ notevil = (notevil + 1771)/2;
+ break;
+case "z1772":
+ notevil = (notevil + 1772)/2;
+ break;
+case "z1773":
+ notevil = (notevil + 1773)/2;
+ break;
+case "z1774":
+ notevil = (notevil + 1774)/2;
+ break;
+case "z1775":
+ notevil = (notevil + 1775)/2;
+ break;
+case "z1776":
+ notevil = (notevil + 1776)/2;
+ break;
+case "z1777":
+ notevil = (notevil + 1777)/2;
+ break;
+case "z1778":
+ notevil = (notevil + 1778)/2;
+ break;
+case "z1779":
+ notevil = (notevil + 1779)/2;
+ break;
+case "z1780":
+ notevil = (notevil + 1780)/2;
+ break;
+case "z1781":
+ notevil = (notevil + 1781)/2;
+ break;
+case "z1782":
+ notevil = (notevil + 1782)/2;
+ break;
+case "z1783":
+ notevil = (notevil + 1783)/2;
+ break;
+case "z1784":
+ notevil = (notevil + 1784)/2;
+ break;
+case "z1785":
+ notevil = (notevil + 1785)/2;
+ break;
+case "z1786":
+ notevil = (notevil + 1786)/2;
+ break;
+case "z1787":
+ notevil = (notevil + 1787)/2;
+ break;
+case "z1788":
+ notevil = (notevil + 1788)/2;
+ break;
+case "z1789":
+ notevil = (notevil + 1789)/2;
+ break;
+case "z1790":
+ notevil = (notevil + 1790)/2;
+ break;
+case "z1791":
+ notevil = (notevil + 1791)/2;
+ break;
+case "z1792":
+ notevil = (notevil + 1792)/2;
+ break;
+case "z1793":
+ notevil = (notevil + 1793)/2;
+ break;
+case "z1794":
+ notevil = (notevil + 1794)/2;
+ break;
+case "z1795":
+ notevil = (notevil + 1795)/2;
+ break;
+case "z1796":
+ notevil = (notevil + 1796)/2;
+ break;
+case "z1797":
+ notevil = (notevil + 1797)/2;
+ break;
+case "z1798":
+ notevil = (notevil + 1798)/2;
+ break;
+case "z1799":
+ notevil = (notevil + 1799)/2;
+ break;
+
+default:
+ dut = 3;
+ break;
+}
+
+reportCompare(expect, actual, summary);
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-74474-001.js b/tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-74474-001.js
new file mode 100644
index 0000000000..93dc425f72
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-74474-001.js
@@ -0,0 +1,139 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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 74474
+ *"switch() misbehaves with duplicated labels"
+ *
+ * See ECMA3 Section 12.11, "The switch Statement"
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=74474
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-74474-001.js';
+var UBound = 0;
+var BUGNUMBER = 74474;
+var summary = 'Testing switch statements with duplicate labels';
+var status = '';
+var statusitems = [ ];
+var actual = '';
+var actualvalues = [ ];
+var expect= '';
+var expectedvalues = [ ];
+
+
+status = 'Section A of test: the string literal "1" as a duplicate label';
+actual = '';
+switch ('1')
+{
+case '1':
+ actual += 'a';
+case '1':
+ actual += 'b';
+}
+expect = 'ab';
+addThis();
+
+
+status = 'Section B of test: the numeric literal 1 as a duplicate label';
+actual = '';
+switch (1)
+{
+case 1:
+ actual += 'a';
+case 1:
+ actual += 'b';
+}
+expect = 'ab';
+addThis();
+
+
+status = 'Section C of test: the numeric literal 1 as a duplicate label, via a function parameter';
+tryThis(1);
+function tryThis(x)
+{
+ actual = '';
+
+ switch (x)
+ {
+ case x:
+ actual += 'a';
+ case x:
+ actual += 'b';
+ }
+}
+expect = 'ab';
+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 < UBound; i++)
+ {
+ reportCompare(expectedvalues[i], actualvalues[i], getStatus(i));
+ }
+
+ exitFunc ('test');
+}
+
+
+function getStatus(i)
+{
+ return statusitems[i];
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-74474-002.js b/tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-74474-002.js
new file mode 100644
index 0000000000..1c54849c48
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-74474-002.js
@@ -0,0 +1,9097 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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):
+ * brendan@mozilla.org, 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 May 2001
+ *
+ * SUMMARY: Regression test for Bugzilla bug 74474
+ * "switch() misbehaves with duplicated labels"
+ *
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=74474
+ * See ECMA3 Section 12.11, "The switch Statement"
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-74474-002.js';
+var UBound = 0;
+var BUGNUMBER = 74474;
+var summary = 'Test of switch statement that overflows the stack-allocated bitmap';
+var status = '(No duplicated labels)';
+var statusitems = [ ];
+var actual = '';
+var actualvalues = [ ];
+var expect= '';
+var expectedvalues = [ ];
+var x = 3;
+
+
+switch (x)
+{
+case 0:
+case 1:
+case 2:
+case 3:
+case 4:
+case 5:
+case 6:
+case 7:
+case 8:
+case 9:
+case 10:
+case 11:
+case 12:
+case 13:
+case 14:
+case 15:
+case 16:
+case 17:
+case 18:
+case 19:
+case 20:
+case 21:
+case 22:
+case 23:
+case 24:
+case 25:
+case 26:
+case 27:
+case 28:
+case 29:
+case 30:
+case 31:
+case 32:
+case 33:
+case 34:
+case 35:
+case 36:
+case 37:
+case 38:
+case 39:
+case 40:
+case 41:
+case 42:
+case 43:
+case 44:
+case 45:
+case 46:
+case 47:
+case 48:
+case 49:
+case 50:
+case 51:
+case 52:
+case 53:
+case 54:
+case 55:
+case 56:
+case 57:
+case 58:
+case 59:
+case 60:
+case 61:
+case 62:
+case 63:
+case 64:
+case 65:
+case 66:
+case 67:
+case 68:
+case 69:
+case 70:
+case 71:
+case 72:
+case 73:
+case 74:
+case 75:
+case 76:
+case 77:
+case 78:
+case 79:
+case 80:
+case 81:
+case 82:
+case 83:
+case 84:
+case 85:
+case 86:
+case 87:
+case 88:
+case 89:
+case 90:
+case 91:
+case 92:
+case 93:
+case 94:
+case 95:
+case 96:
+case 97:
+case 98:
+case 99:
+case 100:
+case 101:
+case 102:
+case 103:
+case 104:
+case 105:
+case 106:
+case 107:
+case 108:
+case 109:
+case 110:
+case 111:
+case 112:
+case 113:
+case 114:
+case 115:
+case 116:
+case 117:
+case 118:
+case 119:
+case 120:
+case 121:
+case 122:
+case 123:
+case 124:
+case 125:
+case 126:
+case 127:
+case 128:
+case 129:
+case 130:
+case 131:
+case 132:
+case 133:
+case 134:
+case 135:
+case 136:
+case 137:
+case 138:
+case 139:
+case 140:
+case 141:
+case 142:
+case 143:
+case 144:
+case 145:
+case 146:
+case 147:
+case 148:
+case 149:
+case 150:
+case 151:
+case 152:
+case 153:
+case 154:
+case 155:
+case 156:
+case 157:
+case 158:
+case 159:
+case 160:
+case 161:
+case 162:
+case 163:
+case 164:
+case 165:
+case 166:
+case 167:
+case 168:
+case 169:
+case 170:
+case 171:
+case 172:
+case 173:
+case 174:
+case 175:
+case 176:
+case 177:
+case 178:
+case 179:
+case 180:
+case 181:
+case 182:
+case 183:
+case 184:
+case 185:
+case 186:
+case 187:
+case 188:
+case 189:
+case 190:
+case 191:
+case 192:
+case 193:
+case 194:
+case 195:
+case 196:
+case 197:
+case 198:
+case 199:
+case 200:
+case 201:
+case 202:
+case 203:
+case 204:
+case 205:
+case 206:
+case 207:
+case 208:
+case 209:
+case 210:
+case 211:
+case 212:
+case 213:
+case 214:
+case 215:
+case 216:
+case 217:
+case 218:
+case 219:
+case 220:
+case 221:
+case 222:
+case 223:
+case 224:
+case 225:
+case 226:
+case 227:
+case 228:
+case 229:
+case 230:
+case 231:
+case 232:
+case 233:
+case 234:
+case 235:
+case 236:
+case 237:
+case 238:
+case 239:
+case 240:
+case 241:
+case 242:
+case 243:
+case 244:
+case 245:
+case 246:
+case 247:
+case 248:
+case 249:
+case 250:
+case 251:
+case 252:
+case 253:
+case 254:
+case 255:
+case 256:
+case 257:
+case 258:
+case 259:
+case 260:
+case 261:
+case 262:
+case 263:
+case 264:
+case 265:
+case 266:
+case 267:
+case 268:
+case 269:
+case 270:
+case 271:
+case 272:
+case 273:
+case 274:
+case 275:
+case 276:
+case 277:
+case 278:
+case 279:
+case 280:
+case 281:
+case 282:
+case 283:
+case 284:
+case 285:
+case 286:
+case 287:
+case 288:
+case 289:
+case 290:
+case 291:
+case 292:
+case 293:
+case 294:
+case 295:
+case 296:
+case 297:
+case 298:
+case 299:
+case 300:
+case 301:
+case 302:
+case 303:
+case 304:
+case 305:
+case 306:
+case 307:
+case 308:
+case 309:
+case 310:
+case 311:
+case 312:
+case 313:
+case 314:
+case 315:
+case 316:
+case 317:
+case 318:
+case 319:
+case 320:
+case 321:
+case 322:
+case 323:
+case 324:
+case 325:
+case 326:
+case 327:
+case 328:
+case 329:
+case 330:
+case 331:
+case 332:
+case 333:
+case 334:
+case 335:
+case 336:
+case 337:
+case 338:
+case 339:
+case 340:
+case 341:
+case 342:
+case 343:
+case 344:
+case 345:
+case 346:
+case 347:
+case 348:
+case 349:
+case 350:
+case 351:
+case 352:
+case 353:
+case 354:
+case 355:
+case 356:
+case 357:
+case 358:
+case 359:
+case 360:
+case 361:
+case 362:
+case 363:
+case 364:
+case 365:
+case 366:
+case 367:
+case 368:
+case 369:
+case 370:
+case 371:
+case 372:
+case 373:
+case 374:
+case 375:
+case 376:
+case 377:
+case 378:
+case 379:
+case 380:
+case 381:
+case 382:
+case 383:
+case 384:
+case 385:
+case 386:
+case 387:
+case 388:
+case 389:
+case 390:
+case 391:
+case 392:
+case 393:
+case 394:
+case 395:
+case 396:
+case 397:
+case 398:
+case 399:
+case 400:
+case 401:
+case 402:
+case 403:
+case 404:
+case 405:
+case 406:
+case 407:
+case 408:
+case 409:
+case 410:
+case 411:
+case 412:
+case 413:
+case 414:
+case 415:
+case 416:
+case 417:
+case 418:
+case 419:
+case 420:
+case 421:
+case 422:
+case 423:
+case 424:
+case 425:
+case 426:
+case 427:
+case 428:
+case 429:
+case 430:
+case 431:
+case 432:
+case 433:
+case 434:
+case 435:
+case 436:
+case 437:
+case 438:
+case 439:
+case 440:
+case 441:
+case 442:
+case 443:
+case 444:
+case 445:
+case 446:
+case 447:
+case 448:
+case 449:
+case 450:
+case 451:
+case 452:
+case 453:
+case 454:
+case 455:
+case 456:
+case 457:
+case 458:
+case 459:
+case 460:
+case 461:
+case 462:
+case 463:
+case 464:
+case 465:
+case 466:
+case 467:
+case 468:
+case 469:
+case 470:
+case 471:
+case 472:
+case 473:
+case 474:
+case 475:
+case 476:
+case 477:
+case 478:
+case 479:
+case 480:
+case 481:
+case 482:
+case 483:
+case 484:
+case 485:
+case 486:
+case 487:
+case 488:
+case 489:
+case 490:
+case 491:
+case 492:
+case 493:
+case 494:
+case 495:
+case 496:
+case 497:
+case 498:
+case 499:
+case 500:
+case 501:
+case 502:
+case 503:
+case 504:
+case 505:
+case 506:
+case 507:
+case 508:
+case 509:
+case 510:
+case 511:
+case 512:
+case 513:
+case 514:
+case 515:
+case 516:
+case 517:
+case 518:
+case 519:
+case 520:
+case 521:
+case 522:
+case 523:
+case 524:
+case 525:
+case 526:
+case 527:
+case 528:
+case 529:
+case 530:
+case 531:
+case 532:
+case 533:
+case 534:
+case 535:
+case 536:
+case 537:
+case 538:
+case 539:
+case 540:
+case 541:
+case 542:
+case 543:
+case 544:
+case 545:
+case 546:
+case 547:
+case 548:
+case 549:
+case 550:
+case 551:
+case 552:
+case 553:
+case 554:
+case 555:
+case 556:
+case 557:
+case 558:
+case 559:
+case 560:
+case 561:
+case 562:
+case 563:
+case 564:
+case 565:
+case 566:
+case 567:
+case 568:
+case 569:
+case 570:
+case 571:
+case 572:
+case 573:
+case 574:
+case 575:
+case 576:
+case 577:
+case 578:
+case 579:
+case 580:
+case 581:
+case 582:
+case 583:
+case 584:
+case 585:
+case 586:
+case 587:
+case 588:
+case 589:
+case 590:
+case 591:
+case 592:
+case 593:
+case 594:
+case 595:
+case 596:
+case 597:
+case 598:
+case 599:
+case 600:
+case 601:
+case 602:
+case 603:
+case 604:
+case 605:
+case 606:
+case 607:
+case 608:
+case 609:
+case 610:
+case 611:
+case 612:
+case 613:
+case 614:
+case 615:
+case 616:
+case 617:
+case 618:
+case 619:
+case 620:
+case 621:
+case 622:
+case 623:
+case 624:
+case 625:
+case 626:
+case 627:
+case 628:
+case 629:
+case 630:
+case 631:
+case 632:
+case 633:
+case 634:
+case 635:
+case 636:
+case 637:
+case 638:
+case 639:
+case 640:
+case 641:
+case 642:
+case 643:
+case 644:
+case 645:
+case 646:
+case 647:
+case 648:
+case 649:
+case 650:
+case 651:
+case 652:
+case 653:
+case 654:
+case 655:
+case 656:
+case 657:
+case 658:
+case 659:
+case 660:
+case 661:
+case 662:
+case 663:
+case 664:
+case 665:
+case 666:
+case 667:
+case 668:
+case 669:
+case 670:
+case 671:
+case 672:
+case 673:
+case 674:
+case 675:
+case 676:
+case 677:
+case 678:
+case 679:
+case 680:
+case 681:
+case 682:
+case 683:
+case 684:
+case 685:
+case 686:
+case 687:
+case 688:
+case 689:
+case 690:
+case 691:
+case 692:
+case 693:
+case 694:
+case 695:
+case 696:
+case 697:
+case 698:
+case 699:
+case 700:
+case 701:
+case 702:
+case 703:
+case 704:
+case 705:
+case 706:
+case 707:
+case 708:
+case 709:
+case 710:
+case 711:
+case 712:
+case 713:
+case 714:
+case 715:
+case 716:
+case 717:
+case 718:
+case 719:
+case 720:
+case 721:
+case 722:
+case 723:
+case 724:
+case 725:
+case 726:
+case 727:
+case 728:
+case 729:
+case 730:
+case 731:
+case 732:
+case 733:
+case 734:
+case 735:
+case 736:
+case 737:
+case 738:
+case 739:
+case 740:
+case 741:
+case 742:
+case 743:
+case 744:
+case 745:
+case 746:
+case 747:
+case 748:
+case 749:
+case 750:
+case 751:
+case 752:
+case 753:
+case 754:
+case 755:
+case 756:
+case 757:
+case 758:
+case 759:
+case 760:
+case 761:
+case 762:
+case 763:
+case 764:
+case 765:
+case 766:
+case 767:
+case 768:
+case 769:
+case 770:
+case 771:
+case 772:
+case 773:
+case 774:
+case 775:
+case 776:
+case 777:
+case 778:
+case 779:
+case 780:
+case 781:
+case 782:
+case 783:
+case 784:
+case 785:
+case 786:
+case 787:
+case 788:
+case 789:
+case 790:
+case 791:
+case 792:
+case 793:
+case 794:
+case 795:
+case 796:
+case 797:
+case 798:
+case 799:
+case 800:
+case 801:
+case 802:
+case 803:
+case 804:
+case 805:
+case 806:
+case 807:
+case 808:
+case 809:
+case 810:
+case 811:
+case 812:
+case 813:
+case 814:
+case 815:
+case 816:
+case 817:
+case 818:
+case 819:
+case 820:
+case 821:
+case 822:
+case 823:
+case 824:
+case 825:
+case 826:
+case 827:
+case 828:
+case 829:
+case 830:
+case 831:
+case 832:
+case 833:
+case 834:
+case 835:
+case 836:
+case 837:
+case 838:
+case 839:
+case 840:
+case 841:
+case 842:
+case 843:
+case 844:
+case 845:
+case 846:
+case 847:
+case 848:
+case 849:
+case 850:
+case 851:
+case 852:
+case 853:
+case 854:
+case 855:
+case 856:
+case 857:
+case 858:
+case 859:
+case 860:
+case 861:
+case 862:
+case 863:
+case 864:
+case 865:
+case 866:
+case 867:
+case 868:
+case 869:
+case 870:
+case 871:
+case 872:
+case 873:
+case 874:
+case 875:
+case 876:
+case 877:
+case 878:
+case 879:
+case 880:
+case 881:
+case 882:
+case 883:
+case 884:
+case 885:
+case 886:
+case 887:
+case 888:
+case 889:
+case 890:
+case 891:
+case 892:
+case 893:
+case 894:
+case 895:
+case 896:
+case 897:
+case 898:
+case 899:
+case 900:
+case 901:
+case 902:
+case 903:
+case 904:
+case 905:
+case 906:
+case 907:
+case 908:
+case 909:
+case 910:
+case 911:
+case 912:
+case 913:
+case 914:
+case 915:
+case 916:
+case 917:
+case 918:
+case 919:
+case 920:
+case 921:
+case 922:
+case 923:
+case 924:
+case 925:
+case 926:
+case 927:
+case 928:
+case 929:
+case 930:
+case 931:
+case 932:
+case 933:
+case 934:
+case 935:
+case 936:
+case 937:
+case 938:
+case 939:
+case 940:
+case 941:
+case 942:
+case 943:
+case 944:
+case 945:
+case 946:
+case 947:
+case 948:
+case 949:
+case 950:
+case 951:
+case 952:
+case 953:
+case 954:
+case 955:
+case 956:
+case 957:
+case 958:
+case 959:
+case 960:
+case 961:
+case 962:
+case 963:
+case 964:
+case 965:
+case 966:
+case 967:
+case 968:
+case 969:
+case 970:
+case 971:
+case 972:
+case 973:
+case 974:
+case 975:
+case 976:
+case 977:
+case 978:
+case 979:
+case 980:
+case 981:
+case 982:
+case 983:
+case 984:
+case 985:
+case 986:
+case 987:
+case 988:
+case 989:
+case 990:
+case 991:
+case 992:
+case 993:
+case 994:
+case 995:
+case 996:
+case 997:
+case 998:
+case 999:
+case 1000:
+case 1001:
+case 1002:
+case 1003:
+case 1004:
+case 1005:
+case 1006:
+case 1007:
+case 1008:
+case 1009:
+case 1010:
+case 1011:
+case 1012:
+case 1013:
+case 1014:
+case 1015:
+case 1016:
+case 1017:
+case 1018:
+case 1019:
+case 1020:
+case 1021:
+case 1022:
+case 1023:
+case 1024:
+case 1025:
+case 1026:
+case 1027:
+case 1028:
+case 1029:
+case 1030:
+case 1031:
+case 1032:
+case 1033:
+case 1034:
+case 1035:
+case 1036:
+case 1037:
+case 1038:
+case 1039:
+case 1040:
+case 1041:
+case 1042:
+case 1043:
+case 1044:
+case 1045:
+case 1046:
+case 1047:
+case 1048:
+case 1049:
+case 1050:
+case 1051:
+case 1052:
+case 1053:
+case 1054:
+case 1055:
+case 1056:
+case 1057:
+case 1058:
+case 1059:
+case 1060:
+case 1061:
+case 1062:
+case 1063:
+case 1064:
+case 1065:
+case 1066:
+case 1067:
+case 1068:
+case 1069:
+case 1070:
+case 1071:
+case 1072:
+case 1073:
+case 1074:
+case 1075:
+case 1076:
+case 1077:
+case 1078:
+case 1079:
+case 1080:
+case 1081:
+case 1082:
+case 1083:
+case 1084:
+case 1085:
+case 1086:
+case 1087:
+case 1088:
+case 1089:
+case 1090:
+case 1091:
+case 1092:
+case 1093:
+case 1094:
+case 1095:
+case 1096:
+case 1097:
+case 1098:
+case 1099:
+case 1100:
+case 1101:
+case 1102:
+case 1103:
+case 1104:
+case 1105:
+case 1106:
+case 1107:
+case 1108:
+case 1109:
+case 1110:
+case 1111:
+case 1112:
+case 1113:
+case 1114:
+case 1115:
+case 1116:
+case 1117:
+case 1118:
+case 1119:
+case 1120:
+case 1121:
+case 1122:
+case 1123:
+case 1124:
+case 1125:
+case 1126:
+case 1127:
+case 1128:
+case 1129:
+case 1130:
+case 1131:
+case 1132:
+case 1133:
+case 1134:
+case 1135:
+case 1136:
+case 1137:
+case 1138:
+case 1139:
+case 1140:
+case 1141:
+case 1142:
+case 1143:
+case 1144:
+case 1145:
+case 1146:
+case 1147:
+case 1148:
+case 1149:
+case 1150:
+case 1151:
+case 1152:
+case 1153:
+case 1154:
+case 1155:
+case 1156:
+case 1157:
+case 1158:
+case 1159:
+case 1160:
+case 1161:
+case 1162:
+case 1163:
+case 1164:
+case 1165:
+case 1166:
+case 1167:
+case 1168:
+case 1169:
+case 1170:
+case 1171:
+case 1172:
+case 1173:
+case 1174:
+case 1175:
+case 1176:
+case 1177:
+case 1178:
+case 1179:
+case 1180:
+case 1181:
+case 1182:
+case 1183:
+case 1184:
+case 1185:
+case 1186:
+case 1187:
+case 1188:
+case 1189:
+case 1190:
+case 1191:
+case 1192:
+case 1193:
+case 1194:
+case 1195:
+case 1196:
+case 1197:
+case 1198:
+case 1199:
+case 1200:
+case 1201:
+case 1202:
+case 1203:
+case 1204:
+case 1205:
+case 1206:
+case 1207:
+case 1208:
+case 1209:
+case 1210:
+case 1211:
+case 1212:
+case 1213:
+case 1214:
+case 1215:
+case 1216:
+case 1217:
+case 1218:
+case 1219:
+case 1220:
+case 1221:
+case 1222:
+case 1223:
+case 1224:
+case 1225:
+case 1226:
+case 1227:
+case 1228:
+case 1229:
+case 1230:
+case 1231:
+case 1232:
+case 1233:
+case 1234:
+case 1235:
+case 1236:
+case 1237:
+case 1238:
+case 1239:
+case 1240:
+case 1241:
+case 1242:
+case 1243:
+case 1244:
+case 1245:
+case 1246:
+case 1247:
+case 1248:
+case 1249:
+case 1250:
+case 1251:
+case 1252:
+case 1253:
+case 1254:
+case 1255:
+case 1256:
+case 1257:
+case 1258:
+case 1259:
+case 1260:
+case 1261:
+case 1262:
+case 1263:
+case 1264:
+case 1265:
+case 1266:
+case 1267:
+case 1268:
+case 1269:
+case 1270:
+case 1271:
+case 1272:
+case 1273:
+case 1274:
+case 1275:
+case 1276:
+case 1277:
+case 1278:
+case 1279:
+case 1280:
+case 1281:
+case 1282:
+case 1283:
+case 1284:
+case 1285:
+case 1286:
+case 1287:
+case 1288:
+case 1289:
+case 1290:
+case 1291:
+case 1292:
+case 1293:
+case 1294:
+case 1295:
+case 1296:
+case 1297:
+case 1298:
+case 1299:
+case 1300:
+case 1301:
+case 1302:
+case 1303:
+case 1304:
+case 1305:
+case 1306:
+case 1307:
+case 1308:
+case 1309:
+case 1310:
+case 1311:
+case 1312:
+case 1313:
+case 1314:
+case 1315:
+case 1316:
+case 1317:
+case 1318:
+case 1319:
+case 1320:
+case 1321:
+case 1322:
+case 1323:
+case 1324:
+case 1325:
+case 1326:
+case 1327:
+case 1328:
+case 1329:
+case 1330:
+case 1331:
+case 1332:
+case 1333:
+case 1334:
+case 1335:
+case 1336:
+case 1337:
+case 1338:
+case 1339:
+case 1340:
+case 1341:
+case 1342:
+case 1343:
+case 1344:
+case 1345:
+case 1346:
+case 1347:
+case 1348:
+case 1349:
+case 1350:
+case 1351:
+case 1352:
+case 1353:
+case 1354:
+case 1355:
+case 1356:
+case 1357:
+case 1358:
+case 1359:
+case 1360:
+case 1361:
+case 1362:
+case 1363:
+case 1364:
+case 1365:
+case 1366:
+case 1367:
+case 1368:
+case 1369:
+case 1370:
+case 1371:
+case 1372:
+case 1373:
+case 1374:
+case 1375:
+case 1376:
+case 1377:
+case 1378:
+case 1379:
+case 1380:
+case 1381:
+case 1382:
+case 1383:
+case 1384:
+case 1385:
+case 1386:
+case 1387:
+case 1388:
+case 1389:
+case 1390:
+case 1391:
+case 1392:
+case 1393:
+case 1394:
+case 1395:
+case 1396:
+case 1397:
+case 1398:
+case 1399:
+case 1400:
+case 1401:
+case 1402:
+case 1403:
+case 1404:
+case 1405:
+case 1406:
+case 1407:
+case 1408:
+case 1409:
+case 1410:
+case 1411:
+case 1412:
+case 1413:
+case 1414:
+case 1415:
+case 1416:
+case 1417:
+case 1418:
+case 1419:
+case 1420:
+case 1421:
+case 1422:
+case 1423:
+case 1424:
+case 1425:
+case 1426:
+case 1427:
+case 1428:
+case 1429:
+case 1430:
+case 1431:
+case 1432:
+case 1433:
+case 1434:
+case 1435:
+case 1436:
+case 1437:
+case 1438:
+case 1439:
+case 1440:
+case 1441:
+case 1442:
+case 1443:
+case 1444:
+case 1445:
+case 1446:
+case 1447:
+case 1448:
+case 1449:
+case 1450:
+case 1451:
+case 1452:
+case 1453:
+case 1454:
+case 1455:
+case 1456:
+case 1457:
+case 1458:
+case 1459:
+case 1460:
+case 1461:
+case 1462:
+case 1463:
+case 1464:
+case 1465:
+case 1466:
+case 1467:
+case 1468:
+case 1469:
+case 1470:
+case 1471:
+case 1472:
+case 1473:
+case 1474:
+case 1475:
+case 1476:
+case 1477:
+case 1478:
+case 1479:
+case 1480:
+case 1481:
+case 1482:
+case 1483:
+case 1484:
+case 1485:
+case 1486:
+case 1487:
+case 1488:
+case 1489:
+case 1490:
+case 1491:
+case 1492:
+case 1493:
+case 1494:
+case 1495:
+case 1496:
+case 1497:
+case 1498:
+case 1499:
+case 1500:
+case 1501:
+case 1502:
+case 1503:
+case 1504:
+case 1505:
+case 1506:
+case 1507:
+case 1508:
+case 1509:
+case 1510:
+case 1511:
+case 1512:
+case 1513:
+case 1514:
+case 1515:
+case 1516:
+case 1517:
+case 1518:
+case 1519:
+case 1520:
+case 1521:
+case 1522:
+case 1523:
+case 1524:
+case 1525:
+case 1526:
+case 1527:
+case 1528:
+case 1529:
+case 1530:
+case 1531:
+case 1532:
+case 1533:
+case 1534:
+case 1535:
+case 1536:
+case 1537:
+case 1538:
+case 1539:
+case 1540:
+case 1541:
+case 1542:
+case 1543:
+case 1544:
+case 1545:
+case 1546:
+case 1547:
+case 1548:
+case 1549:
+case 1550:
+case 1551:
+case 1552:
+case 1553:
+case 1554:
+case 1555:
+case 1556:
+case 1557:
+case 1558:
+case 1559:
+case 1560:
+case 1561:
+case 1562:
+case 1563:
+case 1564:
+case 1565:
+case 1566:
+case 1567:
+case 1568:
+case 1569:
+case 1570:
+case 1571:
+case 1572:
+case 1573:
+case 1574:
+case 1575:
+case 1576:
+case 1577:
+case 1578:
+case 1579:
+case 1580:
+case 1581:
+case 1582:
+case 1583:
+case 1584:
+case 1585:
+case 1586:
+case 1587:
+case 1588:
+case 1589:
+case 1590:
+case 1591:
+case 1592:
+case 1593:
+case 1594:
+case 1595:
+case 1596:
+case 1597:
+case 1598:
+case 1599:
+case 1600:
+case 1601:
+case 1602:
+case 1603:
+case 1604:
+case 1605:
+case 1606:
+case 1607:
+case 1608:
+case 1609:
+case 1610:
+case 1611:
+case 1612:
+case 1613:
+case 1614:
+case 1615:
+case 1616:
+case 1617:
+case 1618:
+case 1619:
+case 1620:
+case 1621:
+case 1622:
+case 1623:
+case 1624:
+case 1625:
+case 1626:
+case 1627:
+case 1628:
+case 1629:
+case 1630:
+case 1631:
+case 1632:
+case 1633:
+case 1634:
+case 1635:
+case 1636:
+case 1637:
+case 1638:
+case 1639:
+case 1640:
+case 1641:
+case 1642:
+case 1643:
+case 1644:
+case 1645:
+case 1646:
+case 1647:
+case 1648:
+case 1649:
+case 1650:
+case 1651:
+case 1652:
+case 1653:
+case 1654:
+case 1655:
+case 1656:
+case 1657:
+case 1658:
+case 1659:
+case 1660:
+case 1661:
+case 1662:
+case 1663:
+case 1664:
+case 1665:
+case 1666:
+case 1667:
+case 1668:
+case 1669:
+case 1670:
+case 1671:
+case 1672:
+case 1673:
+case 1674:
+case 1675:
+case 1676:
+case 1677:
+case 1678:
+case 1679:
+case 1680:
+case 1681:
+case 1682:
+case 1683:
+case 1684:
+case 1685:
+case 1686:
+case 1687:
+case 1688:
+case 1689:
+case 1690:
+case 1691:
+case 1692:
+case 1693:
+case 1694:
+case 1695:
+case 1696:
+case 1697:
+case 1698:
+case 1699:
+case 1700:
+case 1701:
+case 1702:
+case 1703:
+case 1704:
+case 1705:
+case 1706:
+case 1707:
+case 1708:
+case 1709:
+case 1710:
+case 1711:
+case 1712:
+case 1713:
+case 1714:
+case 1715:
+case 1716:
+case 1717:
+case 1718:
+case 1719:
+case 1720:
+case 1721:
+case 1722:
+case 1723:
+case 1724:
+case 1725:
+case 1726:
+case 1727:
+case 1728:
+case 1729:
+case 1730:
+case 1731:
+case 1732:
+case 1733:
+case 1734:
+case 1735:
+case 1736:
+case 1737:
+case 1738:
+case 1739:
+case 1740:
+case 1741:
+case 1742:
+case 1743:
+case 1744:
+case 1745:
+case 1746:
+case 1747:
+case 1748:
+case 1749:
+case 1750:
+case 1751:
+case 1752:
+case 1753:
+case 1754:
+case 1755:
+case 1756:
+case 1757:
+case 1758:
+case 1759:
+case 1760:
+case 1761:
+case 1762:
+case 1763:
+case 1764:
+case 1765:
+case 1766:
+case 1767:
+case 1768:
+case 1769:
+case 1770:
+case 1771:
+case 1772:
+case 1773:
+case 1774:
+case 1775:
+case 1776:
+case 1777:
+case 1778:
+case 1779:
+case 1780:
+case 1781:
+case 1782:
+case 1783:
+case 1784:
+case 1785:
+case 1786:
+case 1787:
+case 1788:
+case 1789:
+case 1790:
+case 1791:
+case 1792:
+case 1793:
+case 1794:
+case 1795:
+case 1796:
+case 1797:
+case 1798:
+case 1799:
+case 1800:
+case 1801:
+case 1802:
+case 1803:
+case 1804:
+case 1805:
+case 1806:
+case 1807:
+case 1808:
+case 1809:
+case 1810:
+case 1811:
+case 1812:
+case 1813:
+case 1814:
+case 1815:
+case 1816:
+case 1817:
+case 1818:
+case 1819:
+case 1820:
+case 1821:
+case 1822:
+case 1823:
+case 1824:
+case 1825:
+case 1826:
+case 1827:
+case 1828:
+case 1829:
+case 1830:
+case 1831:
+case 1832:
+case 1833:
+case 1834:
+case 1835:
+case 1836:
+case 1837:
+case 1838:
+case 1839:
+case 1840:
+case 1841:
+case 1842:
+case 1843:
+case 1844:
+case 1845:
+case 1846:
+case 1847:
+case 1848:
+case 1849:
+case 1850:
+case 1851:
+case 1852:
+case 1853:
+case 1854:
+case 1855:
+case 1856:
+case 1857:
+case 1858:
+case 1859:
+case 1860:
+case 1861:
+case 1862:
+case 1863:
+case 1864:
+case 1865:
+case 1866:
+case 1867:
+case 1868:
+case 1869:
+case 1870:
+case 1871:
+case 1872:
+case 1873:
+case 1874:
+case 1875:
+case 1876:
+case 1877:
+case 1878:
+case 1879:
+case 1880:
+case 1881:
+case 1882:
+case 1883:
+case 1884:
+case 1885:
+case 1886:
+case 1887:
+case 1888:
+case 1889:
+case 1890:
+case 1891:
+case 1892:
+case 1893:
+case 1894:
+case 1895:
+case 1896:
+case 1897:
+case 1898:
+case 1899:
+case 1900:
+case 1901:
+case 1902:
+case 1903:
+case 1904:
+case 1905:
+case 1906:
+case 1907:
+case 1908:
+case 1909:
+case 1910:
+case 1911:
+case 1912:
+case 1913:
+case 1914:
+case 1915:
+case 1916:
+case 1917:
+case 1918:
+case 1919:
+case 1920:
+case 1921:
+case 1922:
+case 1923:
+case 1924:
+case 1925:
+case 1926:
+case 1927:
+case 1928:
+case 1929:
+case 1930:
+case 1931:
+case 1932:
+case 1933:
+case 1934:
+case 1935:
+case 1936:
+case 1937:
+case 1938:
+case 1939:
+case 1940:
+case 1941:
+case 1942:
+case 1943:
+case 1944:
+case 1945:
+case 1946:
+case 1947:
+case 1948:
+case 1949:
+case 1950:
+case 1951:
+case 1952:
+case 1953:
+case 1954:
+case 1955:
+case 1956:
+case 1957:
+case 1958:
+case 1959:
+case 1960:
+case 1961:
+case 1962:
+case 1963:
+case 1964:
+case 1965:
+case 1966:
+case 1967:
+case 1968:
+case 1969:
+case 1970:
+case 1971:
+case 1972:
+case 1973:
+case 1974:
+case 1975:
+case 1976:
+case 1977:
+case 1978:
+case 1979:
+case 1980:
+case 1981:
+case 1982:
+case 1983:
+case 1984:
+case 1985:
+case 1986:
+case 1987:
+case 1988:
+case 1989:
+case 1990:
+case 1991:
+case 1992:
+case 1993:
+case 1994:
+case 1995:
+case 1996:
+case 1997:
+case 1998:
+case 1999:
+case 2000:
+case 2001:
+case 2002:
+case 2003:
+case 2004:
+case 2005:
+case 2006:
+case 2007:
+case 2008:
+case 2009:
+case 2010:
+case 2011:
+case 2012:
+case 2013:
+case 2014:
+case 2015:
+case 2016:
+case 2017:
+case 2018:
+case 2019:
+case 2020:
+case 2021:
+case 2022:
+case 2023:
+case 2024:
+case 2025:
+case 2026:
+case 2027:
+case 2028:
+case 2029:
+case 2030:
+case 2031:
+case 2032:
+case 2033:
+case 2034:
+case 2035:
+case 2036:
+case 2037:
+case 2038:
+case 2039:
+case 2040:
+case 2041:
+case 2042:
+case 2043:
+case 2044:
+case 2045:
+case 2046:
+case 2047:
+case 2048:
+case 2049:
+case 2050:
+case 2051:
+case 2052:
+case 2053:
+case 2054:
+case 2055:
+case 2056:
+case 2057:
+case 2058:
+case 2059:
+case 2060:
+case 2061:
+case 2062:
+case 2063:
+case 2064:
+case 2065:
+case 2066:
+case 2067:
+case 2068:
+case 2069:
+case 2070:
+case 2071:
+case 2072:
+case 2073:
+case 2074:
+case 2075:
+case 2076:
+case 2077:
+case 2078:
+case 2079:
+case 2080:
+case 2081:
+case 2082:
+case 2083:
+case 2084:
+case 2085:
+case 2086:
+case 2087:
+case 2088:
+case 2089:
+case 2090:
+case 2091:
+case 2092:
+case 2093:
+case 2094:
+case 2095:
+case 2096:
+case 2097:
+case 2098:
+case 2099:
+case 2100:
+case 2101:
+case 2102:
+case 2103:
+case 2104:
+case 2105:
+case 2106:
+case 2107:
+case 2108:
+case 2109:
+case 2110:
+case 2111:
+case 2112:
+case 2113:
+case 2114:
+case 2115:
+case 2116:
+case 2117:
+case 2118:
+case 2119:
+case 2120:
+case 2121:
+case 2122:
+case 2123:
+case 2124:
+case 2125:
+case 2126:
+case 2127:
+case 2128:
+case 2129:
+case 2130:
+case 2131:
+case 2132:
+case 2133:
+case 2134:
+case 2135:
+case 2136:
+case 2137:
+case 2138:
+case 2139:
+case 2140:
+case 2141:
+case 2142:
+case 2143:
+case 2144:
+case 2145:
+case 2146:
+case 2147:
+case 2148:
+case 2149:
+case 2150:
+case 2151:
+case 2152:
+case 2153:
+case 2154:
+case 2155:
+case 2156:
+case 2157:
+case 2158:
+case 2159:
+case 2160:
+case 2161:
+case 2162:
+case 2163:
+case 2164:
+case 2165:
+case 2166:
+case 2167:
+case 2168:
+case 2169:
+case 2170:
+case 2171:
+case 2172:
+case 2173:
+case 2174:
+case 2175:
+case 2176:
+case 2177:
+case 2178:
+case 2179:
+case 2180:
+case 2181:
+case 2182:
+case 2183:
+case 2184:
+case 2185:
+case 2186:
+case 2187:
+case 2188:
+case 2189:
+case 2190:
+case 2191:
+case 2192:
+case 2193:
+case 2194:
+case 2195:
+case 2196:
+case 2197:
+case 2198:
+case 2199:
+case 2200:
+case 2201:
+case 2202:
+case 2203:
+case 2204:
+case 2205:
+case 2206:
+case 2207:
+case 2208:
+case 2209:
+case 2210:
+case 2211:
+case 2212:
+case 2213:
+case 2214:
+case 2215:
+case 2216:
+case 2217:
+case 2218:
+case 2219:
+case 2220:
+case 2221:
+case 2222:
+case 2223:
+case 2224:
+case 2225:
+case 2226:
+case 2227:
+case 2228:
+case 2229:
+case 2230:
+case 2231:
+case 2232:
+case 2233:
+case 2234:
+case 2235:
+case 2236:
+case 2237:
+case 2238:
+case 2239:
+case 2240:
+case 2241:
+case 2242:
+case 2243:
+case 2244:
+case 2245:
+case 2246:
+case 2247:
+case 2248:
+case 2249:
+case 2250:
+case 2251:
+case 2252:
+case 2253:
+case 2254:
+case 2255:
+case 2256:
+case 2257:
+case 2258:
+case 2259:
+case 2260:
+case 2261:
+case 2262:
+case 2263:
+case 2264:
+case 2265:
+case 2266:
+case 2267:
+case 2268:
+case 2269:
+case 2270:
+case 2271:
+case 2272:
+case 2273:
+case 2274:
+case 2275:
+case 2276:
+case 2277:
+case 2278:
+case 2279:
+case 2280:
+case 2281:
+case 2282:
+case 2283:
+case 2284:
+case 2285:
+case 2286:
+case 2287:
+case 2288:
+case 2289:
+case 2290:
+case 2291:
+case 2292:
+case 2293:
+case 2294:
+case 2295:
+case 2296:
+case 2297:
+case 2298:
+case 2299:
+case 2300:
+case 2301:
+case 2302:
+case 2303:
+case 2304:
+case 2305:
+case 2306:
+case 2307:
+case 2308:
+case 2309:
+case 2310:
+case 2311:
+case 2312:
+case 2313:
+case 2314:
+case 2315:
+case 2316:
+case 2317:
+case 2318:
+case 2319:
+case 2320:
+case 2321:
+case 2322:
+case 2323:
+case 2324:
+case 2325:
+case 2326:
+case 2327:
+case 2328:
+case 2329:
+case 2330:
+case 2331:
+case 2332:
+case 2333:
+case 2334:
+case 2335:
+case 2336:
+case 2337:
+case 2338:
+case 2339:
+case 2340:
+case 2341:
+case 2342:
+case 2343:
+case 2344:
+case 2345:
+case 2346:
+case 2347:
+case 2348:
+case 2349:
+case 2350:
+case 2351:
+case 2352:
+case 2353:
+case 2354:
+case 2355:
+case 2356:
+case 2357:
+case 2358:
+case 2359:
+case 2360:
+case 2361:
+case 2362:
+case 2363:
+case 2364:
+case 2365:
+case 2366:
+case 2367:
+case 2368:
+case 2369:
+case 2370:
+case 2371:
+case 2372:
+case 2373:
+case 2374:
+case 2375:
+case 2376:
+case 2377:
+case 2378:
+case 2379:
+case 2380:
+case 2381:
+case 2382:
+case 2383:
+case 2384:
+case 2385:
+case 2386:
+case 2387:
+case 2388:
+case 2389:
+case 2390:
+case 2391:
+case 2392:
+case 2393:
+case 2394:
+case 2395:
+case 2396:
+case 2397:
+case 2398:
+case 2399:
+case 2400:
+case 2401:
+case 2402:
+case 2403:
+case 2404:
+case 2405:
+case 2406:
+case 2407:
+case 2408:
+case 2409:
+case 2410:
+case 2411:
+case 2412:
+case 2413:
+case 2414:
+case 2415:
+case 2416:
+case 2417:
+case 2418:
+case 2419:
+case 2420:
+case 2421:
+case 2422:
+case 2423:
+case 2424:
+case 2425:
+case 2426:
+case 2427:
+case 2428:
+case 2429:
+case 2430:
+case 2431:
+case 2432:
+case 2433:
+case 2434:
+case 2435:
+case 2436:
+case 2437:
+case 2438:
+case 2439:
+case 2440:
+case 2441:
+case 2442:
+case 2443:
+case 2444:
+case 2445:
+case 2446:
+case 2447:
+case 2448:
+case 2449:
+case 2450:
+case 2451:
+case 2452:
+case 2453:
+case 2454:
+case 2455:
+case 2456:
+case 2457:
+case 2458:
+case 2459:
+case 2460:
+case 2461:
+case 2462:
+case 2463:
+case 2464:
+case 2465:
+case 2466:
+case 2467:
+case 2468:
+case 2469:
+case 2470:
+case 2471:
+case 2472:
+case 2473:
+case 2474:
+case 2475:
+case 2476:
+case 2477:
+case 2478:
+case 2479:
+case 2480:
+case 2481:
+case 2482:
+case 2483:
+case 2484:
+case 2485:
+case 2486:
+case 2487:
+case 2488:
+case 2489:
+case 2490:
+case 2491:
+case 2492:
+case 2493:
+case 2494:
+case 2495:
+case 2496:
+case 2497:
+case 2498:
+case 2499:
+case 2500:
+case 2501:
+case 2502:
+case 2503:
+case 2504:
+case 2505:
+case 2506:
+case 2507:
+case 2508:
+case 2509:
+case 2510:
+case 2511:
+case 2512:
+case 2513:
+case 2514:
+case 2515:
+case 2516:
+case 2517:
+case 2518:
+case 2519:
+case 2520:
+case 2521:
+case 2522:
+case 2523:
+case 2524:
+case 2525:
+case 2526:
+case 2527:
+case 2528:
+case 2529:
+case 2530:
+case 2531:
+case 2532:
+case 2533:
+case 2534:
+case 2535:
+case 2536:
+case 2537:
+case 2538:
+case 2539:
+case 2540:
+case 2541:
+case 2542:
+case 2543:
+case 2544:
+case 2545:
+case 2546:
+case 2547:
+case 2548:
+case 2549:
+case 2550:
+case 2551:
+case 2552:
+case 2553:
+case 2554:
+case 2555:
+case 2556:
+case 2557:
+case 2558:
+case 2559:
+case 2560:
+case 2561:
+case 2562:
+case 2563:
+case 2564:
+case 2565:
+case 2566:
+case 2567:
+case 2568:
+case 2569:
+case 2570:
+case 2571:
+case 2572:
+case 2573:
+case 2574:
+case 2575:
+case 2576:
+case 2577:
+case 2578:
+case 2579:
+case 2580:
+case 2581:
+case 2582:
+case 2583:
+case 2584:
+case 2585:
+case 2586:
+case 2587:
+case 2588:
+case 2589:
+case 2590:
+case 2591:
+case 2592:
+case 2593:
+case 2594:
+case 2595:
+case 2596:
+case 2597:
+case 2598:
+case 2599:
+case 2600:
+case 2601:
+case 2602:
+case 2603:
+case 2604:
+case 2605:
+case 2606:
+case 2607:
+case 2608:
+case 2609:
+case 2610:
+case 2611:
+case 2612:
+case 2613:
+case 2614:
+case 2615:
+case 2616:
+case 2617:
+case 2618:
+case 2619:
+case 2620:
+case 2621:
+case 2622:
+case 2623:
+case 2624:
+case 2625:
+case 2626:
+case 2627:
+case 2628:
+case 2629:
+case 2630:
+case 2631:
+case 2632:
+case 2633:
+case 2634:
+case 2635:
+case 2636:
+case 2637:
+case 2638:
+case 2639:
+case 2640:
+case 2641:
+case 2642:
+case 2643:
+case 2644:
+case 2645:
+case 2646:
+case 2647:
+case 2648:
+case 2649:
+case 2650:
+case 2651:
+case 2652:
+case 2653:
+case 2654:
+case 2655:
+case 2656:
+case 2657:
+case 2658:
+case 2659:
+case 2660:
+case 2661:
+case 2662:
+case 2663:
+case 2664:
+case 2665:
+case 2666:
+case 2667:
+case 2668:
+case 2669:
+case 2670:
+case 2671:
+case 2672:
+case 2673:
+case 2674:
+case 2675:
+case 2676:
+case 2677:
+case 2678:
+case 2679:
+case 2680:
+case 2681:
+case 2682:
+case 2683:
+case 2684:
+case 2685:
+case 2686:
+case 2687:
+case 2688:
+case 2689:
+case 2690:
+case 2691:
+case 2692:
+case 2693:
+case 2694:
+case 2695:
+case 2696:
+case 2697:
+case 2698:
+case 2699:
+case 2700:
+case 2701:
+case 2702:
+case 2703:
+case 2704:
+case 2705:
+case 2706:
+case 2707:
+case 2708:
+case 2709:
+case 2710:
+case 2711:
+case 2712:
+case 2713:
+case 2714:
+case 2715:
+case 2716:
+case 2717:
+case 2718:
+case 2719:
+case 2720:
+case 2721:
+case 2722:
+case 2723:
+case 2724:
+case 2725:
+case 2726:
+case 2727:
+case 2728:
+case 2729:
+case 2730:
+case 2731:
+case 2732:
+case 2733:
+case 2734:
+case 2735:
+case 2736:
+case 2737:
+case 2738:
+case 2739:
+case 2740:
+case 2741:
+case 2742:
+case 2743:
+case 2744:
+case 2745:
+case 2746:
+case 2747:
+case 2748:
+case 2749:
+case 2750:
+case 2751:
+case 2752:
+case 2753:
+case 2754:
+case 2755:
+case 2756:
+case 2757:
+case 2758:
+case 2759:
+case 2760:
+case 2761:
+case 2762:
+case 2763:
+case 2764:
+case 2765:
+case 2766:
+case 2767:
+case 2768:
+case 2769:
+case 2770:
+case 2771:
+case 2772:
+case 2773:
+case 2774:
+case 2775:
+case 2776:
+case 2777:
+case 2778:
+case 2779:
+case 2780:
+case 2781:
+case 2782:
+case 2783:
+case 2784:
+case 2785:
+case 2786:
+case 2787:
+case 2788:
+case 2789:
+case 2790:
+case 2791:
+case 2792:
+case 2793:
+case 2794:
+case 2795:
+case 2796:
+case 2797:
+case 2798:
+case 2799:
+case 2800:
+case 2801:
+case 2802:
+case 2803:
+case 2804:
+case 2805:
+case 2806:
+case 2807:
+case 2808:
+case 2809:
+case 2810:
+case 2811:
+case 2812:
+case 2813:
+case 2814:
+case 2815:
+case 2816:
+case 2817:
+case 2818:
+case 2819:
+case 2820:
+case 2821:
+case 2822:
+case 2823:
+case 2824:
+case 2825:
+case 2826:
+case 2827:
+case 2828:
+case 2829:
+case 2830:
+case 2831:
+case 2832:
+case 2833:
+case 2834:
+case 2835:
+case 2836:
+case 2837:
+case 2838:
+case 2839:
+case 2840:
+case 2841:
+case 2842:
+case 2843:
+case 2844:
+case 2845:
+case 2846:
+case 2847:
+case 2848:
+case 2849:
+case 2850:
+case 2851:
+case 2852:
+case 2853:
+case 2854:
+case 2855:
+case 2856:
+case 2857:
+case 2858:
+case 2859:
+case 2860:
+case 2861:
+case 2862:
+case 2863:
+case 2864:
+case 2865:
+case 2866:
+case 2867:
+case 2868:
+case 2869:
+case 2870:
+case 2871:
+case 2872:
+case 2873:
+case 2874:
+case 2875:
+case 2876:
+case 2877:
+case 2878:
+case 2879:
+case 2880:
+case 2881:
+case 2882:
+case 2883:
+case 2884:
+case 2885:
+case 2886:
+case 2887:
+case 2888:
+case 2889:
+case 2890:
+case 2891:
+case 2892:
+case 2893:
+case 2894:
+case 2895:
+case 2896:
+case 2897:
+case 2898:
+case 2899:
+case 2900:
+case 2901:
+case 2902:
+case 2903:
+case 2904:
+case 2905:
+case 2906:
+case 2907:
+case 2908:
+case 2909:
+case 2910:
+case 2911:
+case 2912:
+case 2913:
+case 2914:
+case 2915:
+case 2916:
+case 2917:
+case 2918:
+case 2919:
+case 2920:
+case 2921:
+case 2922:
+case 2923:
+case 2924:
+case 2925:
+case 2926:
+case 2927:
+case 2928:
+case 2929:
+case 2930:
+case 2931:
+case 2932:
+case 2933:
+case 2934:
+case 2935:
+case 2936:
+case 2937:
+case 2938:
+case 2939:
+case 2940:
+case 2941:
+case 2942:
+case 2943:
+case 2944:
+case 2945:
+case 2946:
+case 2947:
+case 2948:
+case 2949:
+case 2950:
+case 2951:
+case 2952:
+case 2953:
+case 2954:
+case 2955:
+case 2956:
+case 2957:
+case 2958:
+case 2959:
+case 2960:
+case 2961:
+case 2962:
+case 2963:
+case 2964:
+case 2965:
+case 2966:
+case 2967:
+case 2968:
+case 2969:
+case 2970:
+case 2971:
+case 2972:
+case 2973:
+case 2974:
+case 2975:
+case 2976:
+case 2977:
+case 2978:
+case 2979:
+case 2980:
+case 2981:
+case 2982:
+case 2983:
+case 2984:
+case 2985:
+case 2986:
+case 2987:
+case 2988:
+case 2989:
+case 2990:
+case 2991:
+case 2992:
+case 2993:
+case 2994:
+case 2995:
+case 2996:
+case 2997:
+case 2998:
+case 2999:
+case 3000:
+case 3001:
+case 3002:
+case 3003:
+case 3004:
+case 3005:
+case 3006:
+case 3007:
+case 3008:
+case 3009:
+case 3010:
+case 3011:
+case 3012:
+case 3013:
+case 3014:
+case 3015:
+case 3016:
+case 3017:
+case 3018:
+case 3019:
+case 3020:
+case 3021:
+case 3022:
+case 3023:
+case 3024:
+case 3025:
+case 3026:
+case 3027:
+case 3028:
+case 3029:
+case 3030:
+case 3031:
+case 3032:
+case 3033:
+case 3034:
+case 3035:
+case 3036:
+case 3037:
+case 3038:
+case 3039:
+case 3040:
+case 3041:
+case 3042:
+case 3043:
+case 3044:
+case 3045:
+case 3046:
+case 3047:
+case 3048:
+case 3049:
+case 3050:
+case 3051:
+case 3052:
+case 3053:
+case 3054:
+case 3055:
+case 3056:
+case 3057:
+case 3058:
+case 3059:
+case 3060:
+case 3061:
+case 3062:
+case 3063:
+case 3064:
+case 3065:
+case 3066:
+case 3067:
+case 3068:
+case 3069:
+case 3070:
+case 3071:
+case 3072:
+case 3073:
+case 3074:
+case 3075:
+case 3076:
+case 3077:
+case 3078:
+case 3079:
+case 3080:
+case 3081:
+case 3082:
+case 3083:
+case 3084:
+case 3085:
+case 3086:
+case 3087:
+case 3088:
+case 3089:
+case 3090:
+case 3091:
+case 3092:
+case 3093:
+case 3094:
+case 3095:
+case 3096:
+case 3097:
+case 3098:
+case 3099:
+case 3100:
+case 3101:
+case 3102:
+case 3103:
+case 3104:
+case 3105:
+case 3106:
+case 3107:
+case 3108:
+case 3109:
+case 3110:
+case 3111:
+case 3112:
+case 3113:
+case 3114:
+case 3115:
+case 3116:
+case 3117:
+case 3118:
+case 3119:
+case 3120:
+case 3121:
+case 3122:
+case 3123:
+case 3124:
+case 3125:
+case 3126:
+case 3127:
+case 3128:
+case 3129:
+case 3130:
+case 3131:
+case 3132:
+case 3133:
+case 3134:
+case 3135:
+case 3136:
+case 3137:
+case 3138:
+case 3139:
+case 3140:
+case 3141:
+case 3142:
+case 3143:
+case 3144:
+case 3145:
+case 3146:
+case 3147:
+case 3148:
+case 3149:
+case 3150:
+case 3151:
+case 3152:
+case 3153:
+case 3154:
+case 3155:
+case 3156:
+case 3157:
+case 3158:
+case 3159:
+case 3160:
+case 3161:
+case 3162:
+case 3163:
+case 3164:
+case 3165:
+case 3166:
+case 3167:
+case 3168:
+case 3169:
+case 3170:
+case 3171:
+case 3172:
+case 3173:
+case 3174:
+case 3175:
+case 3176:
+case 3177:
+case 3178:
+case 3179:
+case 3180:
+case 3181:
+case 3182:
+case 3183:
+case 3184:
+case 3185:
+case 3186:
+case 3187:
+case 3188:
+case 3189:
+case 3190:
+case 3191:
+case 3192:
+case 3193:
+case 3194:
+case 3195:
+case 3196:
+case 3197:
+case 3198:
+case 3199:
+case 3200:
+case 3201:
+case 3202:
+case 3203:
+case 3204:
+case 3205:
+case 3206:
+case 3207:
+case 3208:
+case 3209:
+case 3210:
+case 3211:
+case 3212:
+case 3213:
+case 3214:
+case 3215:
+case 3216:
+case 3217:
+case 3218:
+case 3219:
+case 3220:
+case 3221:
+case 3222:
+case 3223:
+case 3224:
+case 3225:
+case 3226:
+case 3227:
+case 3228:
+case 3229:
+case 3230:
+case 3231:
+case 3232:
+case 3233:
+case 3234:
+case 3235:
+case 3236:
+case 3237:
+case 3238:
+case 3239:
+case 3240:
+case 3241:
+case 3242:
+case 3243:
+case 3244:
+case 3245:
+case 3246:
+case 3247:
+case 3248:
+case 3249:
+case 3250:
+case 3251:
+case 3252:
+case 3253:
+case 3254:
+case 3255:
+case 3256:
+case 3257:
+case 3258:
+case 3259:
+case 3260:
+case 3261:
+case 3262:
+case 3263:
+case 3264:
+case 3265:
+case 3266:
+case 3267:
+case 3268:
+case 3269:
+case 3270:
+case 3271:
+case 3272:
+case 3273:
+case 3274:
+case 3275:
+case 3276:
+case 3277:
+case 3278:
+case 3279:
+case 3280:
+case 3281:
+case 3282:
+case 3283:
+case 3284:
+case 3285:
+case 3286:
+case 3287:
+case 3288:
+case 3289:
+case 3290:
+case 3291:
+case 3292:
+case 3293:
+case 3294:
+case 3295:
+case 3296:
+case 3297:
+case 3298:
+case 3299:
+case 3300:
+case 3301:
+case 3302:
+case 3303:
+case 3304:
+case 3305:
+case 3306:
+case 3307:
+case 3308:
+case 3309:
+case 3310:
+case 3311:
+case 3312:
+case 3313:
+case 3314:
+case 3315:
+case 3316:
+case 3317:
+case 3318:
+case 3319:
+case 3320:
+case 3321:
+case 3322:
+case 3323:
+case 3324:
+case 3325:
+case 3326:
+case 3327:
+case 3328:
+case 3329:
+case 3330:
+case 3331:
+case 3332:
+case 3333:
+case 3334:
+case 3335:
+case 3336:
+case 3337:
+case 3338:
+case 3339:
+case 3340:
+case 3341:
+case 3342:
+case 3343:
+case 3344:
+case 3345:
+case 3346:
+case 3347:
+case 3348:
+case 3349:
+case 3350:
+case 3351:
+case 3352:
+case 3353:
+case 3354:
+case 3355:
+case 3356:
+case 3357:
+case 3358:
+case 3359:
+case 3360:
+case 3361:
+case 3362:
+case 3363:
+case 3364:
+case 3365:
+case 3366:
+case 3367:
+case 3368:
+case 3369:
+case 3370:
+case 3371:
+case 3372:
+case 3373:
+case 3374:
+case 3375:
+case 3376:
+case 3377:
+case 3378:
+case 3379:
+case 3380:
+case 3381:
+case 3382:
+case 3383:
+case 3384:
+case 3385:
+case 3386:
+case 3387:
+case 3388:
+case 3389:
+case 3390:
+case 3391:
+case 3392:
+case 3393:
+case 3394:
+case 3395:
+case 3396:
+case 3397:
+case 3398:
+case 3399:
+case 3400:
+case 3401:
+case 3402:
+case 3403:
+case 3404:
+case 3405:
+case 3406:
+case 3407:
+case 3408:
+case 3409:
+case 3410:
+case 3411:
+case 3412:
+case 3413:
+case 3414:
+case 3415:
+case 3416:
+case 3417:
+case 3418:
+case 3419:
+case 3420:
+case 3421:
+case 3422:
+case 3423:
+case 3424:
+case 3425:
+case 3426:
+case 3427:
+case 3428:
+case 3429:
+case 3430:
+case 3431:
+case 3432:
+case 3433:
+case 3434:
+case 3435:
+case 3436:
+case 3437:
+case 3438:
+case 3439:
+case 3440:
+case 3441:
+case 3442:
+case 3443:
+case 3444:
+case 3445:
+case 3446:
+case 3447:
+case 3448:
+case 3449:
+case 3450:
+case 3451:
+case 3452:
+case 3453:
+case 3454:
+case 3455:
+case 3456:
+case 3457:
+case 3458:
+case 3459:
+case 3460:
+case 3461:
+case 3462:
+case 3463:
+case 3464:
+case 3465:
+case 3466:
+case 3467:
+case 3468:
+case 3469:
+case 3470:
+case 3471:
+case 3472:
+case 3473:
+case 3474:
+case 3475:
+case 3476:
+case 3477:
+case 3478:
+case 3479:
+case 3480:
+case 3481:
+case 3482:
+case 3483:
+case 3484:
+case 3485:
+case 3486:
+case 3487:
+case 3488:
+case 3489:
+case 3490:
+case 3491:
+case 3492:
+case 3493:
+case 3494:
+case 3495:
+case 3496:
+case 3497:
+case 3498:
+case 3499:
+case 3500:
+case 3501:
+case 3502:
+case 3503:
+case 3504:
+case 3505:
+case 3506:
+case 3507:
+case 3508:
+case 3509:
+case 3510:
+case 3511:
+case 3512:
+case 3513:
+case 3514:
+case 3515:
+case 3516:
+case 3517:
+case 3518:
+case 3519:
+case 3520:
+case 3521:
+case 3522:
+case 3523:
+case 3524:
+case 3525:
+case 3526:
+case 3527:
+case 3528:
+case 3529:
+case 3530:
+case 3531:
+case 3532:
+case 3533:
+case 3534:
+case 3535:
+case 3536:
+case 3537:
+case 3538:
+case 3539:
+case 3540:
+case 3541:
+case 3542:
+case 3543:
+case 3544:
+case 3545:
+case 3546:
+case 3547:
+case 3548:
+case 3549:
+case 3550:
+case 3551:
+case 3552:
+case 3553:
+case 3554:
+case 3555:
+case 3556:
+case 3557:
+case 3558:
+case 3559:
+case 3560:
+case 3561:
+case 3562:
+case 3563:
+case 3564:
+case 3565:
+case 3566:
+case 3567:
+case 3568:
+case 3569:
+case 3570:
+case 3571:
+case 3572:
+case 3573:
+case 3574:
+case 3575:
+case 3576:
+case 3577:
+case 3578:
+case 3579:
+case 3580:
+case 3581:
+case 3582:
+case 3583:
+case 3584:
+case 3585:
+case 3586:
+case 3587:
+case 3588:
+case 3589:
+case 3590:
+case 3591:
+case 3592:
+case 3593:
+case 3594:
+case 3595:
+case 3596:
+case 3597:
+case 3598:
+case 3599:
+case 3600:
+case 3601:
+case 3602:
+case 3603:
+case 3604:
+case 3605:
+case 3606:
+case 3607:
+case 3608:
+case 3609:
+case 3610:
+case 3611:
+case 3612:
+case 3613:
+case 3614:
+case 3615:
+case 3616:
+case 3617:
+case 3618:
+case 3619:
+case 3620:
+case 3621:
+case 3622:
+case 3623:
+case 3624:
+case 3625:
+case 3626:
+case 3627:
+case 3628:
+case 3629:
+case 3630:
+case 3631:
+case 3632:
+case 3633:
+case 3634:
+case 3635:
+case 3636:
+case 3637:
+case 3638:
+case 3639:
+case 3640:
+case 3641:
+case 3642:
+case 3643:
+case 3644:
+case 3645:
+case 3646:
+case 3647:
+case 3648:
+case 3649:
+case 3650:
+case 3651:
+case 3652:
+case 3653:
+case 3654:
+case 3655:
+case 3656:
+case 3657:
+case 3658:
+case 3659:
+case 3660:
+case 3661:
+case 3662:
+case 3663:
+case 3664:
+case 3665:
+case 3666:
+case 3667:
+case 3668:
+case 3669:
+case 3670:
+case 3671:
+case 3672:
+case 3673:
+case 3674:
+case 3675:
+case 3676:
+case 3677:
+case 3678:
+case 3679:
+case 3680:
+case 3681:
+case 3682:
+case 3683:
+case 3684:
+case 3685:
+case 3686:
+case 3687:
+case 3688:
+case 3689:
+case 3690:
+case 3691:
+case 3692:
+case 3693:
+case 3694:
+case 3695:
+case 3696:
+case 3697:
+case 3698:
+case 3699:
+case 3700:
+case 3701:
+case 3702:
+case 3703:
+case 3704:
+case 3705:
+case 3706:
+case 3707:
+case 3708:
+case 3709:
+case 3710:
+case 3711:
+case 3712:
+case 3713:
+case 3714:
+case 3715:
+case 3716:
+case 3717:
+case 3718:
+case 3719:
+case 3720:
+case 3721:
+case 3722:
+case 3723:
+case 3724:
+case 3725:
+case 3726:
+case 3727:
+case 3728:
+case 3729:
+case 3730:
+case 3731:
+case 3732:
+case 3733:
+case 3734:
+case 3735:
+case 3736:
+case 3737:
+case 3738:
+case 3739:
+case 3740:
+case 3741:
+case 3742:
+case 3743:
+case 3744:
+case 3745:
+case 3746:
+case 3747:
+case 3748:
+case 3749:
+case 3750:
+case 3751:
+case 3752:
+case 3753:
+case 3754:
+case 3755:
+case 3756:
+case 3757:
+case 3758:
+case 3759:
+case 3760:
+case 3761:
+case 3762:
+case 3763:
+case 3764:
+case 3765:
+case 3766:
+case 3767:
+case 3768:
+case 3769:
+case 3770:
+case 3771:
+case 3772:
+case 3773:
+case 3774:
+case 3775:
+case 3776:
+case 3777:
+case 3778:
+case 3779:
+case 3780:
+case 3781:
+case 3782:
+case 3783:
+case 3784:
+case 3785:
+case 3786:
+case 3787:
+case 3788:
+case 3789:
+case 3790:
+case 3791:
+case 3792:
+case 3793:
+case 3794:
+case 3795:
+case 3796:
+case 3797:
+case 3798:
+case 3799:
+case 3800:
+case 3801:
+case 3802:
+case 3803:
+case 3804:
+case 3805:
+case 3806:
+case 3807:
+case 3808:
+case 3809:
+case 3810:
+case 3811:
+case 3812:
+case 3813:
+case 3814:
+case 3815:
+case 3816:
+case 3817:
+case 3818:
+case 3819:
+case 3820:
+case 3821:
+case 3822:
+case 3823:
+case 3824:
+case 3825:
+case 3826:
+case 3827:
+case 3828:
+case 3829:
+case 3830:
+case 3831:
+case 3832:
+case 3833:
+case 3834:
+case 3835:
+case 3836:
+case 3837:
+case 3838:
+case 3839:
+case 3840:
+case 3841:
+case 3842:
+case 3843:
+case 3844:
+case 3845:
+case 3846:
+case 3847:
+case 3848:
+case 3849:
+case 3850:
+case 3851:
+case 3852:
+case 3853:
+case 3854:
+case 3855:
+case 3856:
+case 3857:
+case 3858:
+case 3859:
+case 3860:
+case 3861:
+case 3862:
+case 3863:
+case 3864:
+case 3865:
+case 3866:
+case 3867:
+case 3868:
+case 3869:
+case 3870:
+case 3871:
+case 3872:
+case 3873:
+case 3874:
+case 3875:
+case 3876:
+case 3877:
+case 3878:
+case 3879:
+case 3880:
+case 3881:
+case 3882:
+case 3883:
+case 3884:
+case 3885:
+case 3886:
+case 3887:
+case 3888:
+case 3889:
+case 3890:
+case 3891:
+case 3892:
+case 3893:
+case 3894:
+case 3895:
+case 3896:
+case 3897:
+case 3898:
+case 3899:
+case 3900:
+case 3901:
+case 3902:
+case 3903:
+case 3904:
+case 3905:
+case 3906:
+case 3907:
+case 3908:
+case 3909:
+case 3910:
+case 3911:
+case 3912:
+case 3913:
+case 3914:
+case 3915:
+case 3916:
+case 3917:
+case 3918:
+case 3919:
+case 3920:
+case 3921:
+case 3922:
+case 3923:
+case 3924:
+case 3925:
+case 3926:
+case 3927:
+case 3928:
+case 3929:
+case 3930:
+case 3931:
+case 3932:
+case 3933:
+case 3934:
+case 3935:
+case 3936:
+case 3937:
+case 3938:
+case 3939:
+case 3940:
+case 3941:
+case 3942:
+case 3943:
+case 3944:
+case 3945:
+case 3946:
+case 3947:
+case 3948:
+case 3949:
+case 3950:
+case 3951:
+case 3952:
+case 3953:
+case 3954:
+case 3955:
+case 3956:
+case 3957:
+case 3958:
+case 3959:
+case 3960:
+case 3961:
+case 3962:
+case 3963:
+case 3964:
+case 3965:
+case 3966:
+case 3967:
+case 3968:
+case 3969:
+case 3970:
+case 3971:
+case 3972:
+case 3973:
+case 3974:
+case 3975:
+case 3976:
+case 3977:
+case 3978:
+case 3979:
+case 3980:
+case 3981:
+case 3982:
+case 3983:
+case 3984:
+case 3985:
+case 3986:
+case 3987:
+case 3988:
+case 3989:
+case 3990:
+case 3991:
+case 3992:
+case 3993:
+case 3994:
+case 3995:
+case 3996:
+case 3997:
+case 3998:
+case 3999:
+case 4000:
+case 4001:
+case 4002:
+case 4003:
+case 4004:
+case 4005:
+case 4006:
+case 4007:
+case 4008:
+case 4009:
+case 4010:
+case 4011:
+case 4012:
+case 4013:
+case 4014:
+case 4015:
+case 4016:
+case 4017:
+case 4018:
+case 4019:
+case 4020:
+case 4021:
+case 4022:
+case 4023:
+case 4024:
+case 4025:
+case 4026:
+case 4027:
+case 4028:
+case 4029:
+case 4030:
+case 4031:
+case 4032:
+case 4033:
+case 4034:
+case 4035:
+case 4036:
+case 4037:
+case 4038:
+case 4039:
+case 4040:
+case 4041:
+case 4042:
+case 4043:
+case 4044:
+case 4045:
+case 4046:
+case 4047:
+case 4048:
+case 4049:
+case 4050:
+case 4051:
+case 4052:
+case 4053:
+case 4054:
+case 4055:
+case 4056:
+case 4057:
+case 4058:
+case 4059:
+case 4060:
+case 4061:
+case 4062:
+case 4063:
+case 4064:
+case 4065:
+case 4066:
+case 4067:
+case 4068:
+case 4069:
+case 4070:
+case 4071:
+case 4072:
+case 4073:
+case 4074:
+case 4075:
+case 4076:
+case 4077:
+case 4078:
+case 4079:
+case 4080:
+case 4081:
+case 4082:
+case 4083:
+case 4084:
+case 4085:
+case 4086:
+case 4087:
+case 4088:
+case 4089:
+case 4090:
+case 4091:
+case 4092:
+case 4093:
+case 4094:
+case 4095:
+case 4096:
+case 4097:
+case 4098:
+case 4099:
+case 4100:
+case 4101:
+case 4102:
+case 4103:
+case 4104:
+case 4105:
+case 4106:
+case 4107:
+case 4108:
+case 4109:
+case 4110:
+case 4111:
+case 4112:
+case 4113:
+case 4114:
+case 4115:
+case 4116:
+case 4117:
+case 4118:
+case 4119:
+case 4120:
+case 4121:
+case 4122:
+case 4123:
+case 4124:
+case 4125:
+case 4126:
+case 4127:
+case 4128:
+case 4129:
+case 4130:
+case 4131:
+case 4132:
+case 4133:
+case 4134:
+case 4135:
+case 4136:
+case 4137:
+case 4138:
+case 4139:
+case 4140:
+case 4141:
+case 4142:
+case 4143:
+case 4144:
+case 4145:
+case 4146:
+case 4147:
+case 4148:
+case 4149:
+case 4150:
+case 4151:
+case 4152:
+case 4153:
+case 4154:
+case 4155:
+case 4156:
+case 4157:
+case 4158:
+case 4159:
+case 4160:
+case 4161:
+case 4162:
+case 4163:
+case 4164:
+case 4165:
+case 4166:
+case 4167:
+case 4168:
+case 4169:
+case 4170:
+case 4171:
+case 4172:
+case 4173:
+case 4174:
+case 4175:
+case 4176:
+case 4177:
+case 4178:
+case 4179:
+case 4180:
+case 4181:
+case 4182:
+case 4183:
+case 4184:
+case 4185:
+case 4186:
+case 4187:
+case 4188:
+case 4189:
+case 4190:
+case 4191:
+case 4192:
+case 4193:
+case 4194:
+case 4195:
+case 4196:
+case 4197:
+case 4198:
+case 4199:
+case 4200:
+case 4201:
+case 4202:
+case 4203:
+case 4204:
+case 4205:
+case 4206:
+case 4207:
+case 4208:
+case 4209:
+case 4210:
+case 4211:
+case 4212:
+case 4213:
+case 4214:
+case 4215:
+case 4216:
+case 4217:
+case 4218:
+case 4219:
+case 4220:
+case 4221:
+case 4222:
+case 4223:
+case 4224:
+case 4225:
+case 4226:
+case 4227:
+case 4228:
+case 4229:
+case 4230:
+case 4231:
+case 4232:
+case 4233:
+case 4234:
+case 4235:
+case 4236:
+case 4237:
+case 4238:
+case 4239:
+case 4240:
+case 4241:
+case 4242:
+case 4243:
+case 4244:
+case 4245:
+case 4246:
+case 4247:
+case 4248:
+case 4249:
+case 4250:
+case 4251:
+case 4252:
+case 4253:
+case 4254:
+case 4255:
+case 4256:
+case 4257:
+case 4258:
+case 4259:
+case 4260:
+case 4261:
+case 4262:
+case 4263:
+case 4264:
+case 4265:
+case 4266:
+case 4267:
+case 4268:
+case 4269:
+case 4270:
+case 4271:
+case 4272:
+case 4273:
+case 4274:
+case 4275:
+case 4276:
+case 4277:
+case 4278:
+case 4279:
+case 4280:
+case 4281:
+case 4282:
+case 4283:
+case 4284:
+case 4285:
+case 4286:
+case 4287:
+case 4288:
+case 4289:
+case 4290:
+case 4291:
+case 4292:
+case 4293:
+case 4294:
+case 4295:
+case 4296:
+case 4297:
+case 4298:
+case 4299:
+case 4300:
+case 4301:
+case 4302:
+case 4303:
+case 4304:
+case 4305:
+case 4306:
+case 4307:
+case 4308:
+case 4309:
+case 4310:
+case 4311:
+case 4312:
+case 4313:
+case 4314:
+case 4315:
+case 4316:
+case 4317:
+case 4318:
+case 4319:
+case 4320:
+case 4321:
+case 4322:
+case 4323:
+case 4324:
+case 4325:
+case 4326:
+case 4327:
+case 4328:
+case 4329:
+case 4330:
+case 4331:
+case 4332:
+case 4333:
+case 4334:
+case 4335:
+case 4336:
+case 4337:
+case 4338:
+case 4339:
+case 4340:
+case 4341:
+case 4342:
+case 4343:
+case 4344:
+case 4345:
+case 4346:
+case 4347:
+case 4348:
+case 4349:
+case 4350:
+case 4351:
+case 4352:
+case 4353:
+case 4354:
+case 4355:
+case 4356:
+case 4357:
+case 4358:
+case 4359:
+case 4360:
+case 4361:
+case 4362:
+case 4363:
+case 4364:
+case 4365:
+case 4366:
+case 4367:
+case 4368:
+case 4369:
+case 4370:
+case 4371:
+case 4372:
+case 4373:
+case 4374:
+case 4375:
+case 4376:
+case 4377:
+case 4378:
+case 4379:
+case 4380:
+case 4381:
+case 4382:
+case 4383:
+case 4384:
+case 4385:
+case 4386:
+case 4387:
+case 4388:
+case 4389:
+case 4390:
+case 4391:
+case 4392:
+case 4393:
+case 4394:
+case 4395:
+case 4396:
+case 4397:
+case 4398:
+case 4399:
+case 4400:
+case 4401:
+case 4402:
+case 4403:
+case 4404:
+case 4405:
+case 4406:
+case 4407:
+case 4408:
+case 4409:
+case 4410:
+case 4411:
+case 4412:
+case 4413:
+case 4414:
+case 4415:
+case 4416:
+case 4417:
+case 4418:
+case 4419:
+case 4420:
+case 4421:
+case 4422:
+case 4423:
+case 4424:
+case 4425:
+case 4426:
+case 4427:
+case 4428:
+case 4429:
+case 4430:
+case 4431:
+case 4432:
+case 4433:
+case 4434:
+case 4435:
+case 4436:
+case 4437:
+case 4438:
+case 4439:
+case 4440:
+case 4441:
+case 4442:
+case 4443:
+case 4444:
+case 4445:
+case 4446:
+case 4447:
+case 4448:
+case 4449:
+case 4450:
+case 4451:
+case 4452:
+case 4453:
+case 4454:
+case 4455:
+case 4456:
+case 4457:
+case 4458:
+case 4459:
+case 4460:
+case 4461:
+case 4462:
+case 4463:
+case 4464:
+case 4465:
+case 4466:
+case 4467:
+case 4468:
+case 4469:
+case 4470:
+case 4471:
+case 4472:
+case 4473:
+case 4474:
+case 4475:
+case 4476:
+case 4477:
+case 4478:
+case 4479:
+case 4480:
+case 4481:
+case 4482:
+case 4483:
+case 4484:
+case 4485:
+case 4486:
+case 4487:
+case 4488:
+case 4489:
+case 4490:
+case 4491:
+case 4492:
+case 4493:
+case 4494:
+case 4495:
+case 4496:
+case 4497:
+case 4498:
+case 4499:
+case 4500:
+case 4501:
+case 4502:
+case 4503:
+case 4504:
+case 4505:
+case 4506:
+case 4507:
+case 4508:
+case 4509:
+case 4510:
+case 4511:
+case 4512:
+case 4513:
+case 4514:
+case 4515:
+case 4516:
+case 4517:
+case 4518:
+case 4519:
+case 4520:
+case 4521:
+case 4522:
+case 4523:
+case 4524:
+case 4525:
+case 4526:
+case 4527:
+case 4528:
+case 4529:
+case 4530:
+case 4531:
+case 4532:
+case 4533:
+case 4534:
+case 4535:
+case 4536:
+case 4537:
+case 4538:
+case 4539:
+case 4540:
+case 4541:
+case 4542:
+case 4543:
+case 4544:
+case 4545:
+case 4546:
+case 4547:
+case 4548:
+case 4549:
+case 4550:
+case 4551:
+case 4552:
+case 4553:
+case 4554:
+case 4555:
+case 4556:
+case 4557:
+case 4558:
+case 4559:
+case 4560:
+case 4561:
+case 4562:
+case 4563:
+case 4564:
+case 4565:
+case 4566:
+case 4567:
+case 4568:
+case 4569:
+case 4570:
+case 4571:
+case 4572:
+case 4573:
+case 4574:
+case 4575:
+case 4576:
+case 4577:
+case 4578:
+case 4579:
+case 4580:
+case 4581:
+case 4582:
+case 4583:
+case 4584:
+case 4585:
+case 4586:
+case 4587:
+case 4588:
+case 4589:
+case 4590:
+case 4591:
+case 4592:
+case 4593:
+case 4594:
+case 4595:
+case 4596:
+case 4597:
+case 4598:
+case 4599:
+case 4600:
+case 4601:
+case 4602:
+case 4603:
+case 4604:
+case 4605:
+case 4606:
+case 4607:
+case 4608:
+case 4609:
+case 4610:
+case 4611:
+case 4612:
+case 4613:
+case 4614:
+case 4615:
+case 4616:
+case 4617:
+case 4618:
+case 4619:
+case 4620:
+case 4621:
+case 4622:
+case 4623:
+case 4624:
+case 4625:
+case 4626:
+case 4627:
+case 4628:
+case 4629:
+case 4630:
+case 4631:
+case 4632:
+case 4633:
+case 4634:
+case 4635:
+case 4636:
+case 4637:
+case 4638:
+case 4639:
+case 4640:
+case 4641:
+case 4642:
+case 4643:
+case 4644:
+case 4645:
+case 4646:
+case 4647:
+case 4648:
+case 4649:
+case 4650:
+case 4651:
+case 4652:
+case 4653:
+case 4654:
+case 4655:
+case 4656:
+case 4657:
+case 4658:
+case 4659:
+case 4660:
+case 4661:
+case 4662:
+case 4663:
+case 4664:
+case 4665:
+case 4666:
+case 4667:
+case 4668:
+case 4669:
+case 4670:
+case 4671:
+case 4672:
+case 4673:
+case 4674:
+case 4675:
+case 4676:
+case 4677:
+case 4678:
+case 4679:
+case 4680:
+case 4681:
+case 4682:
+case 4683:
+case 4684:
+case 4685:
+case 4686:
+case 4687:
+case 4688:
+case 4689:
+case 4690:
+case 4691:
+case 4692:
+case 4693:
+case 4694:
+case 4695:
+case 4696:
+case 4697:
+case 4698:
+case 4699:
+case 4700:
+case 4701:
+case 4702:
+case 4703:
+case 4704:
+case 4705:
+case 4706:
+case 4707:
+case 4708:
+case 4709:
+case 4710:
+case 4711:
+case 4712:
+case 4713:
+case 4714:
+case 4715:
+case 4716:
+case 4717:
+case 4718:
+case 4719:
+case 4720:
+case 4721:
+case 4722:
+case 4723:
+case 4724:
+case 4725:
+case 4726:
+case 4727:
+case 4728:
+case 4729:
+case 4730:
+case 4731:
+case 4732:
+case 4733:
+case 4734:
+case 4735:
+case 4736:
+case 4737:
+case 4738:
+case 4739:
+case 4740:
+case 4741:
+case 4742:
+case 4743:
+case 4744:
+case 4745:
+case 4746:
+case 4747:
+case 4748:
+case 4749:
+case 4750:
+case 4751:
+case 4752:
+case 4753:
+case 4754:
+case 4755:
+case 4756:
+case 4757:
+case 4758:
+case 4759:
+case 4760:
+case 4761:
+case 4762:
+case 4763:
+case 4764:
+case 4765:
+case 4766:
+case 4767:
+case 4768:
+case 4769:
+case 4770:
+case 4771:
+case 4772:
+case 4773:
+case 4774:
+case 4775:
+case 4776:
+case 4777:
+case 4778:
+case 4779:
+case 4780:
+case 4781:
+case 4782:
+case 4783:
+case 4784:
+case 4785:
+case 4786:
+case 4787:
+case 4788:
+case 4789:
+case 4790:
+case 4791:
+case 4792:
+case 4793:
+case 4794:
+case 4795:
+case 4796:
+case 4797:
+case 4798:
+case 4799:
+case 4800:
+case 4801:
+case 4802:
+case 4803:
+case 4804:
+case 4805:
+case 4806:
+case 4807:
+case 4808:
+case 4809:
+case 4810:
+case 4811:
+case 4812:
+case 4813:
+case 4814:
+case 4815:
+case 4816:
+case 4817:
+case 4818:
+case 4819:
+case 4820:
+case 4821:
+case 4822:
+case 4823:
+case 4824:
+case 4825:
+case 4826:
+case 4827:
+case 4828:
+case 4829:
+case 4830:
+case 4831:
+case 4832:
+case 4833:
+case 4834:
+case 4835:
+case 4836:
+case 4837:
+case 4838:
+case 4839:
+case 4840:
+case 4841:
+case 4842:
+case 4843:
+case 4844:
+case 4845:
+case 4846:
+case 4847:
+case 4848:
+case 4849:
+case 4850:
+case 4851:
+case 4852:
+case 4853:
+case 4854:
+case 4855:
+case 4856:
+case 4857:
+case 4858:
+case 4859:
+case 4860:
+case 4861:
+case 4862:
+case 4863:
+case 4864:
+case 4865:
+case 4866:
+case 4867:
+case 4868:
+case 4869:
+case 4870:
+case 4871:
+case 4872:
+case 4873:
+case 4874:
+case 4875:
+case 4876:
+case 4877:
+case 4878:
+case 4879:
+case 4880:
+case 4881:
+case 4882:
+case 4883:
+case 4884:
+case 4885:
+case 4886:
+case 4887:
+case 4888:
+case 4889:
+case 4890:
+case 4891:
+case 4892:
+case 4893:
+case 4894:
+case 4895:
+case 4896:
+case 4897:
+case 4898:
+case 4899:
+case 4900:
+case 4901:
+case 4902:
+case 4903:
+case 4904:
+case 4905:
+case 4906:
+case 4907:
+case 4908:
+case 4909:
+case 4910:
+case 4911:
+case 4912:
+case 4913:
+case 4914:
+case 4915:
+case 4916:
+case 4917:
+case 4918:
+case 4919:
+case 4920:
+case 4921:
+case 4922:
+case 4923:
+case 4924:
+case 4925:
+case 4926:
+case 4927:
+case 4928:
+case 4929:
+case 4930:
+case 4931:
+case 4932:
+case 4933:
+case 4934:
+case 4935:
+case 4936:
+case 4937:
+case 4938:
+case 4939:
+case 4940:
+case 4941:
+case 4942:
+case 4943:
+case 4944:
+case 4945:
+case 4946:
+case 4947:
+case 4948:
+case 4949:
+case 4950:
+case 4951:
+case 4952:
+case 4953:
+case 4954:
+case 4955:
+case 4956:
+case 4957:
+case 4958:
+case 4959:
+case 4960:
+case 4961:
+case 4962:
+case 4963:
+case 4964:
+case 4965:
+case 4966:
+case 4967:
+case 4968:
+case 4969:
+case 4970:
+case 4971:
+case 4972:
+case 4973:
+case 4974:
+case 4975:
+case 4976:
+case 4977:
+case 4978:
+case 4979:
+case 4980:
+case 4981:
+case 4982:
+case 4983:
+case 4984:
+case 4985:
+case 4986:
+case 4987:
+case 4988:
+case 4989:
+case 4990:
+case 4991:
+case 4992:
+case 4993:
+case 4994:
+case 4995:
+case 4996:
+case 4997:
+case 4998:
+case 4999:
+case 5000:
+case 5001:
+case 5002:
+case 5003:
+case 5004:
+case 5005:
+case 5006:
+case 5007:
+case 5008:
+case 5009:
+case 5010:
+case 5011:
+case 5012:
+case 5013:
+case 5014:
+case 5015:
+case 5016:
+case 5017:
+case 5018:
+case 5019:
+case 5020:
+case 5021:
+case 5022:
+case 5023:
+case 5024:
+case 5025:
+case 5026:
+case 5027:
+case 5028:
+case 5029:
+case 5030:
+case 5031:
+case 5032:
+case 5033:
+case 5034:
+case 5035:
+case 5036:
+case 5037:
+case 5038:
+case 5039:
+case 5040:
+case 5041:
+case 5042:
+case 5043:
+case 5044:
+case 5045:
+case 5046:
+case 5047:
+case 5048:
+case 5049:
+case 5050:
+case 5051:
+case 5052:
+case 5053:
+case 5054:
+case 5055:
+case 5056:
+case 5057:
+case 5058:
+case 5059:
+case 5060:
+case 5061:
+case 5062:
+case 5063:
+case 5064:
+case 5065:
+case 5066:
+case 5067:
+case 5068:
+case 5069:
+case 5070:
+case 5071:
+case 5072:
+case 5073:
+case 5074:
+case 5075:
+case 5076:
+case 5077:
+case 5078:
+case 5079:
+case 5080:
+case 5081:
+case 5082:
+case 5083:
+case 5084:
+case 5085:
+case 5086:
+case 5087:
+case 5088:
+case 5089:
+case 5090:
+case 5091:
+case 5092:
+case 5093:
+case 5094:
+case 5095:
+case 5096:
+case 5097:
+case 5098:
+case 5099:
+case 5100:
+case 5101:
+case 5102:
+case 5103:
+case 5104:
+case 5105:
+case 5106:
+case 5107:
+case 5108:
+case 5109:
+case 5110:
+case 5111:
+case 5112:
+case 5113:
+case 5114:
+case 5115:
+case 5116:
+case 5117:
+case 5118:
+case 5119:
+case 5120:
+case 5121:
+case 5122:
+case 5123:
+case 5124:
+case 5125:
+case 5126:
+case 5127:
+case 5128:
+case 5129:
+case 5130:
+case 5131:
+case 5132:
+case 5133:
+case 5134:
+case 5135:
+case 5136:
+case 5137:
+case 5138:
+case 5139:
+case 5140:
+case 5141:
+case 5142:
+case 5143:
+case 5144:
+case 5145:
+case 5146:
+case 5147:
+case 5148:
+case 5149:
+case 5150:
+case 5151:
+case 5152:
+case 5153:
+case 5154:
+case 5155:
+case 5156:
+case 5157:
+case 5158:
+case 5159:
+case 5160:
+case 5161:
+case 5162:
+case 5163:
+case 5164:
+case 5165:
+case 5166:
+case 5167:
+case 5168:
+case 5169:
+case 5170:
+case 5171:
+case 5172:
+case 5173:
+case 5174:
+case 5175:
+case 5176:
+case 5177:
+case 5178:
+case 5179:
+case 5180:
+case 5181:
+case 5182:
+case 5183:
+case 5184:
+case 5185:
+case 5186:
+case 5187:
+case 5188:
+case 5189:
+case 5190:
+case 5191:
+case 5192:
+case 5193:
+case 5194:
+case 5195:
+case 5196:
+case 5197:
+case 5198:
+case 5199:
+case 5200:
+case 5201:
+case 5202:
+case 5203:
+case 5204:
+case 5205:
+case 5206:
+case 5207:
+case 5208:
+case 5209:
+case 5210:
+case 5211:
+case 5212:
+case 5213:
+case 5214:
+case 5215:
+case 5216:
+case 5217:
+case 5218:
+case 5219:
+case 5220:
+case 5221:
+case 5222:
+case 5223:
+case 5224:
+case 5225:
+case 5226:
+case 5227:
+case 5228:
+case 5229:
+case 5230:
+case 5231:
+case 5232:
+case 5233:
+case 5234:
+case 5235:
+case 5236:
+case 5237:
+case 5238:
+case 5239:
+case 5240:
+case 5241:
+case 5242:
+case 5243:
+case 5244:
+case 5245:
+case 5246:
+case 5247:
+case 5248:
+case 5249:
+case 5250:
+case 5251:
+case 5252:
+case 5253:
+case 5254:
+case 5255:
+case 5256:
+case 5257:
+case 5258:
+case 5259:
+case 5260:
+case 5261:
+case 5262:
+case 5263:
+case 5264:
+case 5265:
+case 5266:
+case 5267:
+case 5268:
+case 5269:
+case 5270:
+case 5271:
+case 5272:
+case 5273:
+case 5274:
+case 5275:
+case 5276:
+case 5277:
+case 5278:
+case 5279:
+case 5280:
+case 5281:
+case 5282:
+case 5283:
+case 5284:
+case 5285:
+case 5286:
+case 5287:
+case 5288:
+case 5289:
+case 5290:
+case 5291:
+case 5292:
+case 5293:
+case 5294:
+case 5295:
+case 5296:
+case 5297:
+case 5298:
+case 5299:
+case 5300:
+case 5301:
+case 5302:
+case 5303:
+case 5304:
+case 5305:
+case 5306:
+case 5307:
+case 5308:
+case 5309:
+case 5310:
+case 5311:
+case 5312:
+case 5313:
+case 5314:
+case 5315:
+case 5316:
+case 5317:
+case 5318:
+case 5319:
+case 5320:
+case 5321:
+case 5322:
+case 5323:
+case 5324:
+case 5325:
+case 5326:
+case 5327:
+case 5328:
+case 5329:
+case 5330:
+case 5331:
+case 5332:
+case 5333:
+case 5334:
+case 5335:
+case 5336:
+case 5337:
+case 5338:
+case 5339:
+case 5340:
+case 5341:
+case 5342:
+case 5343:
+case 5344:
+case 5345:
+case 5346:
+case 5347:
+case 5348:
+case 5349:
+case 5350:
+case 5351:
+case 5352:
+case 5353:
+case 5354:
+case 5355:
+case 5356:
+case 5357:
+case 5358:
+case 5359:
+case 5360:
+case 5361:
+case 5362:
+case 5363:
+case 5364:
+case 5365:
+case 5366:
+case 5367:
+case 5368:
+case 5369:
+case 5370:
+case 5371:
+case 5372:
+case 5373:
+case 5374:
+case 5375:
+case 5376:
+case 5377:
+case 5378:
+case 5379:
+case 5380:
+case 5381:
+case 5382:
+case 5383:
+case 5384:
+case 5385:
+case 5386:
+case 5387:
+case 5388:
+case 5389:
+case 5390:
+case 5391:
+case 5392:
+case 5393:
+case 5394:
+case 5395:
+case 5396:
+case 5397:
+case 5398:
+case 5399:
+case 5400:
+case 5401:
+case 5402:
+case 5403:
+case 5404:
+case 5405:
+case 5406:
+case 5407:
+case 5408:
+case 5409:
+case 5410:
+case 5411:
+case 5412:
+case 5413:
+case 5414:
+case 5415:
+case 5416:
+case 5417:
+case 5418:
+case 5419:
+case 5420:
+case 5421:
+case 5422:
+case 5423:
+case 5424:
+case 5425:
+case 5426:
+case 5427:
+case 5428:
+case 5429:
+case 5430:
+case 5431:
+case 5432:
+case 5433:
+case 5434:
+case 5435:
+case 5436:
+case 5437:
+case 5438:
+case 5439:
+case 5440:
+case 5441:
+case 5442:
+case 5443:
+case 5444:
+case 5445:
+case 5446:
+case 5447:
+case 5448:
+case 5449:
+case 5450:
+case 5451:
+case 5452:
+case 5453:
+case 5454:
+case 5455:
+case 5456:
+case 5457:
+case 5458:
+case 5459:
+case 5460:
+case 5461:
+case 5462:
+case 5463:
+case 5464:
+case 5465:
+case 5466:
+case 5467:
+case 5468:
+case 5469:
+case 5470:
+case 5471:
+case 5472:
+case 5473:
+case 5474:
+case 5475:
+case 5476:
+case 5477:
+case 5478:
+case 5479:
+case 5480:
+case 5481:
+case 5482:
+case 5483:
+case 5484:
+case 5485:
+case 5486:
+case 5487:
+case 5488:
+case 5489:
+case 5490:
+case 5491:
+case 5492:
+case 5493:
+case 5494:
+case 5495:
+case 5496:
+case 5497:
+case 5498:
+case 5499:
+case 5500:
+case 5501:
+case 5502:
+case 5503:
+case 5504:
+case 5505:
+case 5506:
+case 5507:
+case 5508:
+case 5509:
+case 5510:
+case 5511:
+case 5512:
+case 5513:
+case 5514:
+case 5515:
+case 5516:
+case 5517:
+case 5518:
+case 5519:
+case 5520:
+case 5521:
+case 5522:
+case 5523:
+case 5524:
+case 5525:
+case 5526:
+case 5527:
+case 5528:
+case 5529:
+case 5530:
+case 5531:
+case 5532:
+case 5533:
+case 5534:
+case 5535:
+case 5536:
+case 5537:
+case 5538:
+case 5539:
+case 5540:
+case 5541:
+case 5542:
+case 5543:
+case 5544:
+case 5545:
+case 5546:
+case 5547:
+case 5548:
+case 5549:
+case 5550:
+case 5551:
+case 5552:
+case 5553:
+case 5554:
+case 5555:
+case 5556:
+case 5557:
+case 5558:
+case 5559:
+case 5560:
+case 5561:
+case 5562:
+case 5563:
+case 5564:
+case 5565:
+case 5566:
+case 5567:
+case 5568:
+case 5569:
+case 5570:
+case 5571:
+case 5572:
+case 5573:
+case 5574:
+case 5575:
+case 5576:
+case 5577:
+case 5578:
+case 5579:
+case 5580:
+case 5581:
+case 5582:
+case 5583:
+case 5584:
+case 5585:
+case 5586:
+case 5587:
+case 5588:
+case 5589:
+case 5590:
+case 5591:
+case 5592:
+case 5593:
+case 5594:
+case 5595:
+case 5596:
+case 5597:
+case 5598:
+case 5599:
+case 5600:
+case 5601:
+case 5602:
+case 5603:
+case 5604:
+case 5605:
+case 5606:
+case 5607:
+case 5608:
+case 5609:
+case 5610:
+case 5611:
+case 5612:
+case 5613:
+case 5614:
+case 5615:
+case 5616:
+case 5617:
+case 5618:
+case 5619:
+case 5620:
+case 5621:
+case 5622:
+case 5623:
+case 5624:
+case 5625:
+case 5626:
+case 5627:
+case 5628:
+case 5629:
+case 5630:
+case 5631:
+case 5632:
+case 5633:
+case 5634:
+case 5635:
+case 5636:
+case 5637:
+case 5638:
+case 5639:
+case 5640:
+case 5641:
+case 5642:
+case 5643:
+case 5644:
+case 5645:
+case 5646:
+case 5647:
+case 5648:
+case 5649:
+case 5650:
+case 5651:
+case 5652:
+case 5653:
+case 5654:
+case 5655:
+case 5656:
+case 5657:
+case 5658:
+case 5659:
+case 5660:
+case 5661:
+case 5662:
+case 5663:
+case 5664:
+case 5665:
+case 5666:
+case 5667:
+case 5668:
+case 5669:
+case 5670:
+case 5671:
+case 5672:
+case 5673:
+case 5674:
+case 5675:
+case 5676:
+case 5677:
+case 5678:
+case 5679:
+case 5680:
+case 5681:
+case 5682:
+case 5683:
+case 5684:
+case 5685:
+case 5686:
+case 5687:
+case 5688:
+case 5689:
+case 5690:
+case 5691:
+case 5692:
+case 5693:
+case 5694:
+case 5695:
+case 5696:
+case 5697:
+case 5698:
+case 5699:
+case 5700:
+case 5701:
+case 5702:
+case 5703:
+case 5704:
+case 5705:
+case 5706:
+case 5707:
+case 5708:
+case 5709:
+case 5710:
+case 5711:
+case 5712:
+case 5713:
+case 5714:
+case 5715:
+case 5716:
+case 5717:
+case 5718:
+case 5719:
+case 5720:
+case 5721:
+case 5722:
+case 5723:
+case 5724:
+case 5725:
+case 5726:
+case 5727:
+case 5728:
+case 5729:
+case 5730:
+case 5731:
+case 5732:
+case 5733:
+case 5734:
+case 5735:
+case 5736:
+case 5737:
+case 5738:
+case 5739:
+case 5740:
+case 5741:
+case 5742:
+case 5743:
+case 5744:
+case 5745:
+case 5746:
+case 5747:
+case 5748:
+case 5749:
+case 5750:
+case 5751:
+case 5752:
+case 5753:
+case 5754:
+case 5755:
+case 5756:
+case 5757:
+case 5758:
+case 5759:
+case 5760:
+case 5761:
+case 5762:
+case 5763:
+case 5764:
+case 5765:
+case 5766:
+case 5767:
+case 5768:
+case 5769:
+case 5770:
+case 5771:
+case 5772:
+case 5773:
+case 5774:
+case 5775:
+case 5776:
+case 5777:
+case 5778:
+case 5779:
+case 5780:
+case 5781:
+case 5782:
+case 5783:
+case 5784:
+case 5785:
+case 5786:
+case 5787:
+case 5788:
+case 5789:
+case 5790:
+case 5791:
+case 5792:
+case 5793:
+case 5794:
+case 5795:
+case 5796:
+case 5797:
+case 5798:
+case 5799:
+case 5800:
+case 5801:
+case 5802:
+case 5803:
+case 5804:
+case 5805:
+case 5806:
+case 5807:
+case 5808:
+case 5809:
+case 5810:
+case 5811:
+case 5812:
+case 5813:
+case 5814:
+case 5815:
+case 5816:
+case 5817:
+case 5818:
+case 5819:
+case 5820:
+case 5821:
+case 5822:
+case 5823:
+case 5824:
+case 5825:
+case 5826:
+case 5827:
+case 5828:
+case 5829:
+case 5830:
+case 5831:
+case 5832:
+case 5833:
+case 5834:
+case 5835:
+case 5836:
+case 5837:
+case 5838:
+case 5839:
+case 5840:
+case 5841:
+case 5842:
+case 5843:
+case 5844:
+case 5845:
+case 5846:
+case 5847:
+case 5848:
+case 5849:
+case 5850:
+case 5851:
+case 5852:
+case 5853:
+case 5854:
+case 5855:
+case 5856:
+case 5857:
+case 5858:
+case 5859:
+case 5860:
+case 5861:
+case 5862:
+case 5863:
+case 5864:
+case 5865:
+case 5866:
+case 5867:
+case 5868:
+case 5869:
+case 5870:
+case 5871:
+case 5872:
+case 5873:
+case 5874:
+case 5875:
+case 5876:
+case 5877:
+case 5878:
+case 5879:
+case 5880:
+case 5881:
+case 5882:
+case 5883:
+case 5884:
+case 5885:
+case 5886:
+case 5887:
+case 5888:
+case 5889:
+case 5890:
+case 5891:
+case 5892:
+case 5893:
+case 5894:
+case 5895:
+case 5896:
+case 5897:
+case 5898:
+case 5899:
+case 5900:
+case 5901:
+case 5902:
+case 5903:
+case 5904:
+case 5905:
+case 5906:
+case 5907:
+case 5908:
+case 5909:
+case 5910:
+case 5911:
+case 5912:
+case 5913:
+case 5914:
+case 5915:
+case 5916:
+case 5917:
+case 5918:
+case 5919:
+case 5920:
+case 5921:
+case 5922:
+case 5923:
+case 5924:
+case 5925:
+case 5926:
+case 5927:
+case 5928:
+case 5929:
+case 5930:
+case 5931:
+case 5932:
+case 5933:
+case 5934:
+case 5935:
+case 5936:
+case 5937:
+case 5938:
+case 5939:
+case 5940:
+case 5941:
+case 5942:
+case 5943:
+case 5944:
+case 5945:
+case 5946:
+case 5947:
+case 5948:
+case 5949:
+case 5950:
+case 5951:
+case 5952:
+case 5953:
+case 5954:
+case 5955:
+case 5956:
+case 5957:
+case 5958:
+case 5959:
+case 5960:
+case 5961:
+case 5962:
+case 5963:
+case 5964:
+case 5965:
+case 5966:
+case 5967:
+case 5968:
+case 5969:
+case 5970:
+case 5971:
+case 5972:
+case 5973:
+case 5974:
+case 5975:
+case 5976:
+case 5977:
+case 5978:
+case 5979:
+case 5980:
+case 5981:
+case 5982:
+case 5983:
+case 5984:
+case 5985:
+case 5986:
+case 5987:
+case 5988:
+case 5989:
+case 5990:
+case 5991:
+case 5992:
+case 5993:
+case 5994:
+case 5995:
+case 5996:
+case 5997:
+case 5998:
+case 5999:
+case 6000:
+case 6001:
+case 6002:
+case 6003:
+case 6004:
+case 6005:
+case 6006:
+case 6007:
+case 6008:
+case 6009:
+case 6010:
+case 6011:
+case 6012:
+case 6013:
+case 6014:
+case 6015:
+case 6016:
+case 6017:
+case 6018:
+case 6019:
+case 6020:
+case 6021:
+case 6022:
+case 6023:
+case 6024:
+case 6025:
+case 6026:
+case 6027:
+case 6028:
+case 6029:
+case 6030:
+case 6031:
+case 6032:
+case 6033:
+case 6034:
+case 6035:
+case 6036:
+case 6037:
+case 6038:
+case 6039:
+case 6040:
+case 6041:
+case 6042:
+case 6043:
+case 6044:
+case 6045:
+case 6046:
+case 6047:
+case 6048:
+case 6049:
+case 6050:
+case 6051:
+case 6052:
+case 6053:
+case 6054:
+case 6055:
+case 6056:
+case 6057:
+case 6058:
+case 6059:
+case 6060:
+case 6061:
+case 6062:
+case 6063:
+case 6064:
+case 6065:
+case 6066:
+case 6067:
+case 6068:
+case 6069:
+case 6070:
+case 6071:
+case 6072:
+case 6073:
+case 6074:
+case 6075:
+case 6076:
+case 6077:
+case 6078:
+case 6079:
+case 6080:
+case 6081:
+case 6082:
+case 6083:
+case 6084:
+case 6085:
+case 6086:
+case 6087:
+case 6088:
+case 6089:
+case 6090:
+case 6091:
+case 6092:
+case 6093:
+case 6094:
+case 6095:
+case 6096:
+case 6097:
+case 6098:
+case 6099:
+case 6100:
+case 6101:
+case 6102:
+case 6103:
+case 6104:
+case 6105:
+case 6106:
+case 6107:
+case 6108:
+case 6109:
+case 6110:
+case 6111:
+case 6112:
+case 6113:
+case 6114:
+case 6115:
+case 6116:
+case 6117:
+case 6118:
+case 6119:
+case 6120:
+case 6121:
+case 6122:
+case 6123:
+case 6124:
+case 6125:
+case 6126:
+case 6127:
+case 6128:
+case 6129:
+case 6130:
+case 6131:
+case 6132:
+case 6133:
+case 6134:
+case 6135:
+case 6136:
+case 6137:
+case 6138:
+case 6139:
+case 6140:
+case 6141:
+case 6142:
+case 6143:
+case 6144:
+case 6145:
+case 6146:
+case 6147:
+case 6148:
+case 6149:
+case 6150:
+case 6151:
+case 6152:
+case 6153:
+case 6154:
+case 6155:
+case 6156:
+case 6157:
+case 6158:
+case 6159:
+case 6160:
+case 6161:
+case 6162:
+case 6163:
+case 6164:
+case 6165:
+case 6166:
+case 6167:
+case 6168:
+case 6169:
+case 6170:
+case 6171:
+case 6172:
+case 6173:
+case 6174:
+case 6175:
+case 6176:
+case 6177:
+case 6178:
+case 6179:
+case 6180:
+case 6181:
+case 6182:
+case 6183:
+case 6184:
+case 6185:
+case 6186:
+case 6187:
+case 6188:
+case 6189:
+case 6190:
+case 6191:
+case 6192:
+case 6193:
+case 6194:
+case 6195:
+case 6196:
+case 6197:
+case 6198:
+case 6199:
+case 6200:
+case 6201:
+case 6202:
+case 6203:
+case 6204:
+case 6205:
+case 6206:
+case 6207:
+case 6208:
+case 6209:
+case 6210:
+case 6211:
+case 6212:
+case 6213:
+case 6214:
+case 6215:
+case 6216:
+case 6217:
+case 6218:
+case 6219:
+case 6220:
+case 6221:
+case 6222:
+case 6223:
+case 6224:
+case 6225:
+case 6226:
+case 6227:
+case 6228:
+case 6229:
+case 6230:
+case 6231:
+case 6232:
+case 6233:
+case 6234:
+case 6235:
+case 6236:
+case 6237:
+case 6238:
+case 6239:
+case 6240:
+case 6241:
+case 6242:
+case 6243:
+case 6244:
+case 6245:
+case 6246:
+case 6247:
+case 6248:
+case 6249:
+case 6250:
+case 6251:
+case 6252:
+case 6253:
+case 6254:
+case 6255:
+case 6256:
+case 6257:
+case 6258:
+case 6259:
+case 6260:
+case 6261:
+case 6262:
+case 6263:
+case 6264:
+case 6265:
+case 6266:
+case 6267:
+case 6268:
+case 6269:
+case 6270:
+case 6271:
+case 6272:
+case 6273:
+case 6274:
+case 6275:
+case 6276:
+case 6277:
+case 6278:
+case 6279:
+case 6280:
+case 6281:
+case 6282:
+case 6283:
+case 6284:
+case 6285:
+case 6286:
+case 6287:
+case 6288:
+case 6289:
+case 6290:
+case 6291:
+case 6292:
+case 6293:
+case 6294:
+case 6295:
+case 6296:
+case 6297:
+case 6298:
+case 6299:
+case 6300:
+case 6301:
+case 6302:
+case 6303:
+case 6304:
+case 6305:
+case 6306:
+case 6307:
+case 6308:
+case 6309:
+case 6310:
+case 6311:
+case 6312:
+case 6313:
+case 6314:
+case 6315:
+case 6316:
+case 6317:
+case 6318:
+case 6319:
+case 6320:
+case 6321:
+case 6322:
+case 6323:
+case 6324:
+case 6325:
+case 6326:
+case 6327:
+case 6328:
+case 6329:
+case 6330:
+case 6331:
+case 6332:
+case 6333:
+case 6334:
+case 6335:
+case 6336:
+case 6337:
+case 6338:
+case 6339:
+case 6340:
+case 6341:
+case 6342:
+case 6343:
+case 6344:
+case 6345:
+case 6346:
+case 6347:
+case 6348:
+case 6349:
+case 6350:
+case 6351:
+case 6352:
+case 6353:
+case 6354:
+case 6355:
+case 6356:
+case 6357:
+case 6358:
+case 6359:
+case 6360:
+case 6361:
+case 6362:
+case 6363:
+case 6364:
+case 6365:
+case 6366:
+case 6367:
+case 6368:
+case 6369:
+case 6370:
+case 6371:
+case 6372:
+case 6373:
+case 6374:
+case 6375:
+case 6376:
+case 6377:
+case 6378:
+case 6379:
+case 6380:
+case 6381:
+case 6382:
+case 6383:
+case 6384:
+case 6385:
+case 6386:
+case 6387:
+case 6388:
+case 6389:
+case 6390:
+case 6391:
+case 6392:
+case 6393:
+case 6394:
+case 6395:
+case 6396:
+case 6397:
+case 6398:
+case 6399:
+case 6400:
+case 6401:
+case 6402:
+case 6403:
+case 6404:
+case 6405:
+case 6406:
+case 6407:
+case 6408:
+case 6409:
+case 6410:
+case 6411:
+case 6412:
+case 6413:
+case 6414:
+case 6415:
+case 6416:
+case 6417:
+case 6418:
+case 6419:
+case 6420:
+case 6421:
+case 6422:
+case 6423:
+case 6424:
+case 6425:
+case 6426:
+case 6427:
+case 6428:
+case 6429:
+case 6430:
+case 6431:
+case 6432:
+case 6433:
+case 6434:
+case 6435:
+case 6436:
+case 6437:
+case 6438:
+case 6439:
+case 6440:
+case 6441:
+case 6442:
+case 6443:
+case 6444:
+case 6445:
+case 6446:
+case 6447:
+case 6448:
+case 6449:
+case 6450:
+case 6451:
+case 6452:
+case 6453:
+case 6454:
+case 6455:
+case 6456:
+case 6457:
+case 6458:
+case 6459:
+case 6460:
+case 6461:
+case 6462:
+case 6463:
+case 6464:
+case 6465:
+case 6466:
+case 6467:
+case 6468:
+case 6469:
+case 6470:
+case 6471:
+case 6472:
+case 6473:
+case 6474:
+case 6475:
+case 6476:
+case 6477:
+case 6478:
+case 6479:
+case 6480:
+case 6481:
+case 6482:
+case 6483:
+case 6484:
+case 6485:
+case 6486:
+case 6487:
+case 6488:
+case 6489:
+case 6490:
+case 6491:
+case 6492:
+case 6493:
+case 6494:
+case 6495:
+case 6496:
+case 6497:
+case 6498:
+case 6499:
+case 6500:
+case 6501:
+case 6502:
+case 6503:
+case 6504:
+case 6505:
+case 6506:
+case 6507:
+case 6508:
+case 6509:
+case 6510:
+case 6511:
+case 6512:
+case 6513:
+case 6514:
+case 6515:
+case 6516:
+case 6517:
+case 6518:
+case 6519:
+case 6520:
+case 6521:
+case 6522:
+case 6523:
+case 6524:
+case 6525:
+case 6526:
+case 6527:
+case 6528:
+case 6529:
+case 6530:
+case 6531:
+case 6532:
+case 6533:
+case 6534:
+case 6535:
+case 6536:
+case 6537:
+case 6538:
+case 6539:
+case 6540:
+case 6541:
+case 6542:
+case 6543:
+case 6544:
+case 6545:
+case 6546:
+case 6547:
+case 6548:
+case 6549:
+case 6550:
+case 6551:
+case 6552:
+case 6553:
+case 6554:
+case 6555:
+case 6556:
+case 6557:
+case 6558:
+case 6559:
+case 6560:
+case 6561:
+case 6562:
+case 6563:
+case 6564:
+case 6565:
+case 6566:
+case 6567:
+case 6568:
+case 6569:
+case 6570:
+case 6571:
+case 6572:
+case 6573:
+case 6574:
+case 6575:
+case 6576:
+case 6577:
+case 6578:
+case 6579:
+case 6580:
+case 6581:
+case 6582:
+case 6583:
+case 6584:
+case 6585:
+case 6586:
+case 6587:
+case 6588:
+case 6589:
+case 6590:
+case 6591:
+case 6592:
+case 6593:
+case 6594:
+case 6595:
+case 6596:
+case 6597:
+case 6598:
+case 6599:
+case 6600:
+case 6601:
+case 6602:
+case 6603:
+case 6604:
+case 6605:
+case 6606:
+case 6607:
+case 6608:
+case 6609:
+case 6610:
+case 6611:
+case 6612:
+case 6613:
+case 6614:
+case 6615:
+case 6616:
+case 6617:
+case 6618:
+case 6619:
+case 6620:
+case 6621:
+case 6622:
+case 6623:
+case 6624:
+case 6625:
+case 6626:
+case 6627:
+case 6628:
+case 6629:
+case 6630:
+case 6631:
+case 6632:
+case 6633:
+case 6634:
+case 6635:
+case 6636:
+case 6637:
+case 6638:
+case 6639:
+case 6640:
+case 6641:
+case 6642:
+case 6643:
+case 6644:
+case 6645:
+case 6646:
+case 6647:
+case 6648:
+case 6649:
+case 6650:
+case 6651:
+case 6652:
+case 6653:
+case 6654:
+case 6655:
+case 6656:
+case 6657:
+case 6658:
+case 6659:
+case 6660:
+case 6661:
+case 6662:
+case 6663:
+case 6664:
+case 6665:
+case 6666:
+case 6667:
+case 6668:
+case 6669:
+case 6670:
+case 6671:
+case 6672:
+case 6673:
+case 6674:
+case 6675:
+case 6676:
+case 6677:
+case 6678:
+case 6679:
+case 6680:
+case 6681:
+case 6682:
+case 6683:
+case 6684:
+case 6685:
+case 6686:
+case 6687:
+case 6688:
+case 6689:
+case 6690:
+case 6691:
+case 6692:
+case 6693:
+case 6694:
+case 6695:
+case 6696:
+case 6697:
+case 6698:
+case 6699:
+case 6700:
+case 6701:
+case 6702:
+case 6703:
+case 6704:
+case 6705:
+case 6706:
+case 6707:
+case 6708:
+case 6709:
+case 6710:
+case 6711:
+case 6712:
+case 6713:
+case 6714:
+case 6715:
+case 6716:
+case 6717:
+case 6718:
+case 6719:
+case 6720:
+case 6721:
+case 6722:
+case 6723:
+case 6724:
+case 6725:
+case 6726:
+case 6727:
+case 6728:
+case 6729:
+case 6730:
+case 6731:
+case 6732:
+case 6733:
+case 6734:
+case 6735:
+case 6736:
+case 6737:
+case 6738:
+case 6739:
+case 6740:
+case 6741:
+case 6742:
+case 6743:
+case 6744:
+case 6745:
+case 6746:
+case 6747:
+case 6748:
+case 6749:
+case 6750:
+case 6751:
+case 6752:
+case 6753:
+case 6754:
+case 6755:
+case 6756:
+case 6757:
+case 6758:
+case 6759:
+case 6760:
+case 6761:
+case 6762:
+case 6763:
+case 6764:
+case 6765:
+case 6766:
+case 6767:
+case 6768:
+case 6769:
+case 6770:
+case 6771:
+case 6772:
+case 6773:
+case 6774:
+case 6775:
+case 6776:
+case 6777:
+case 6778:
+case 6779:
+case 6780:
+case 6781:
+case 6782:
+case 6783:
+case 6784:
+case 6785:
+case 6786:
+case 6787:
+case 6788:
+case 6789:
+case 6790:
+case 6791:
+case 6792:
+case 6793:
+case 6794:
+case 6795:
+case 6796:
+case 6797:
+case 6798:
+case 6799:
+case 6800:
+case 6801:
+case 6802:
+case 6803:
+case 6804:
+case 6805:
+case 6806:
+case 6807:
+case 6808:
+case 6809:
+case 6810:
+case 6811:
+case 6812:
+case 6813:
+case 6814:
+case 6815:
+case 6816:
+case 6817:
+case 6818:
+case 6819:
+case 6820:
+case 6821:
+case 6822:
+case 6823:
+case 6824:
+case 6825:
+case 6826:
+case 6827:
+case 6828:
+case 6829:
+case 6830:
+case 6831:
+case 6832:
+case 6833:
+case 6834:
+case 6835:
+case 6836:
+case 6837:
+case 6838:
+case 6839:
+case 6840:
+case 6841:
+case 6842:
+case 6843:
+case 6844:
+case 6845:
+case 6846:
+case 6847:
+case 6848:
+case 6849:
+case 6850:
+case 6851:
+case 6852:
+case 6853:
+case 6854:
+case 6855:
+case 6856:
+case 6857:
+case 6858:
+case 6859:
+case 6860:
+case 6861:
+case 6862:
+case 6863:
+case 6864:
+case 6865:
+case 6866:
+case 6867:
+case 6868:
+case 6869:
+case 6870:
+case 6871:
+case 6872:
+case 6873:
+case 6874:
+case 6875:
+case 6876:
+case 6877:
+case 6878:
+case 6879:
+case 6880:
+case 6881:
+case 6882:
+case 6883:
+case 6884:
+case 6885:
+case 6886:
+case 6887:
+case 6888:
+case 6889:
+case 6890:
+case 6891:
+case 6892:
+case 6893:
+case 6894:
+case 6895:
+case 6896:
+case 6897:
+case 6898:
+case 6899:
+case 6900:
+case 6901:
+case 6902:
+case 6903:
+case 6904:
+case 6905:
+case 6906:
+case 6907:
+case 6908:
+case 6909:
+case 6910:
+case 6911:
+case 6912:
+case 6913:
+case 6914:
+case 6915:
+case 6916:
+case 6917:
+case 6918:
+case 6919:
+case 6920:
+case 6921:
+case 6922:
+case 6923:
+case 6924:
+case 6925:
+case 6926:
+case 6927:
+case 6928:
+case 6929:
+case 6930:
+case 6931:
+case 6932:
+case 6933:
+case 6934:
+case 6935:
+case 6936:
+case 6937:
+case 6938:
+case 6939:
+case 6940:
+case 6941:
+case 6942:
+case 6943:
+case 6944:
+case 6945:
+case 6946:
+case 6947:
+case 6948:
+case 6949:
+case 6950:
+case 6951:
+case 6952:
+case 6953:
+case 6954:
+case 6955:
+case 6956:
+case 6957:
+case 6958:
+case 6959:
+case 6960:
+case 6961:
+case 6962:
+case 6963:
+case 6964:
+case 6965:
+case 6966:
+case 6967:
+case 6968:
+case 6969:
+case 6970:
+case 6971:
+case 6972:
+case 6973:
+case 6974:
+case 6975:
+case 6976:
+case 6977:
+case 6978:
+case 6979:
+case 6980:
+case 6981:
+case 6982:
+case 6983:
+case 6984:
+case 6985:
+case 6986:
+case 6987:
+case 6988:
+case 6989:
+case 6990:
+case 6991:
+case 6992:
+case 6993:
+case 6994:
+case 6995:
+case 6996:
+case 6997:
+case 6998:
+case 6999:
+case 7000:
+case 7001:
+case 7002:
+case 7003:
+case 7004:
+case 7005:
+case 7006:
+case 7007:
+case 7008:
+case 7009:
+case 7010:
+case 7011:
+case 7012:
+case 7013:
+case 7014:
+case 7015:
+case 7016:
+case 7017:
+case 7018:
+case 7019:
+case 7020:
+case 7021:
+case 7022:
+case 7023:
+case 7024:
+case 7025:
+case 7026:
+case 7027:
+case 7028:
+case 7029:
+case 7030:
+case 7031:
+case 7032:
+case 7033:
+case 7034:
+case 7035:
+case 7036:
+case 7037:
+case 7038:
+case 7039:
+case 7040:
+case 7041:
+case 7042:
+case 7043:
+case 7044:
+case 7045:
+case 7046:
+case 7047:
+case 7048:
+case 7049:
+case 7050:
+case 7051:
+case 7052:
+case 7053:
+case 7054:
+case 7055:
+case 7056:
+case 7057:
+case 7058:
+case 7059:
+case 7060:
+case 7061:
+case 7062:
+case 7063:
+case 7064:
+case 7065:
+case 7066:
+case 7067:
+case 7068:
+case 7069:
+case 7070:
+case 7071:
+case 7072:
+case 7073:
+case 7074:
+case 7075:
+case 7076:
+case 7077:
+case 7078:
+case 7079:
+case 7080:
+case 7081:
+case 7082:
+case 7083:
+case 7084:
+case 7085:
+case 7086:
+case 7087:
+case 7088:
+case 7089:
+case 7090:
+case 7091:
+case 7092:
+case 7093:
+case 7094:
+case 7095:
+case 7096:
+case 7097:
+case 7098:
+case 7099:
+case 7100:
+case 7101:
+case 7102:
+case 7103:
+case 7104:
+case 7105:
+case 7106:
+case 7107:
+case 7108:
+case 7109:
+case 7110:
+case 7111:
+case 7112:
+case 7113:
+case 7114:
+case 7115:
+case 7116:
+case 7117:
+case 7118:
+case 7119:
+case 7120:
+case 7121:
+case 7122:
+case 7123:
+case 7124:
+case 7125:
+case 7126:
+case 7127:
+case 7128:
+case 7129:
+case 7130:
+case 7131:
+case 7132:
+case 7133:
+case 7134:
+case 7135:
+case 7136:
+case 7137:
+case 7138:
+case 7139:
+case 7140:
+case 7141:
+case 7142:
+case 7143:
+case 7144:
+case 7145:
+case 7146:
+case 7147:
+case 7148:
+case 7149:
+case 7150:
+case 7151:
+case 7152:
+case 7153:
+case 7154:
+case 7155:
+case 7156:
+case 7157:
+case 7158:
+case 7159:
+case 7160:
+case 7161:
+case 7162:
+case 7163:
+case 7164:
+case 7165:
+case 7166:
+case 7167:
+case 7168:
+case 7169:
+case 7170:
+case 7171:
+case 7172:
+case 7173:
+case 7174:
+case 7175:
+case 7176:
+case 7177:
+case 7178:
+case 7179:
+case 7180:
+case 7181:
+case 7182:
+case 7183:
+case 7184:
+case 7185:
+case 7186:
+case 7187:
+case 7188:
+case 7189:
+case 7190:
+case 7191:
+case 7192:
+case 7193:
+case 7194:
+case 7195:
+case 7196:
+case 7197:
+case 7198:
+case 7199:
+case 7200:
+case 7201:
+case 7202:
+case 7203:
+case 7204:
+case 7205:
+case 7206:
+case 7207:
+case 7208:
+case 7209:
+case 7210:
+case 7211:
+case 7212:
+case 7213:
+case 7214:
+case 7215:
+case 7216:
+case 7217:
+case 7218:
+case 7219:
+case 7220:
+case 7221:
+case 7222:
+case 7223:
+case 7224:
+case 7225:
+case 7226:
+case 7227:
+case 7228:
+case 7229:
+case 7230:
+case 7231:
+case 7232:
+case 7233:
+case 7234:
+case 7235:
+case 7236:
+case 7237:
+case 7238:
+case 7239:
+case 7240:
+case 7241:
+case 7242:
+case 7243:
+case 7244:
+case 7245:
+case 7246:
+case 7247:
+case 7248:
+case 7249:
+case 7250:
+case 7251:
+case 7252:
+case 7253:
+case 7254:
+case 7255:
+case 7256:
+case 7257:
+case 7258:
+case 7259:
+case 7260:
+case 7261:
+case 7262:
+case 7263:
+case 7264:
+case 7265:
+case 7266:
+case 7267:
+case 7268:
+case 7269:
+case 7270:
+case 7271:
+case 7272:
+case 7273:
+case 7274:
+case 7275:
+case 7276:
+case 7277:
+case 7278:
+case 7279:
+case 7280:
+case 7281:
+case 7282:
+case 7283:
+case 7284:
+case 7285:
+case 7286:
+case 7287:
+case 7288:
+case 7289:
+case 7290:
+case 7291:
+case 7292:
+case 7293:
+case 7294:
+case 7295:
+case 7296:
+case 7297:
+case 7298:
+case 7299:
+case 7300:
+case 7301:
+case 7302:
+case 7303:
+case 7304:
+case 7305:
+case 7306:
+case 7307:
+case 7308:
+case 7309:
+case 7310:
+case 7311:
+case 7312:
+case 7313:
+case 7314:
+case 7315:
+case 7316:
+case 7317:
+case 7318:
+case 7319:
+case 7320:
+case 7321:
+case 7322:
+case 7323:
+case 7324:
+case 7325:
+case 7326:
+case 7327:
+case 7328:
+case 7329:
+case 7330:
+case 7331:
+case 7332:
+case 7333:
+case 7334:
+case 7335:
+case 7336:
+case 7337:
+case 7338:
+case 7339:
+case 7340:
+case 7341:
+case 7342:
+case 7343:
+case 7344:
+case 7345:
+case 7346:
+case 7347:
+case 7348:
+case 7349:
+case 7350:
+case 7351:
+case 7352:
+case 7353:
+case 7354:
+case 7355:
+case 7356:
+case 7357:
+case 7358:
+case 7359:
+case 7360:
+case 7361:
+case 7362:
+case 7363:
+case 7364:
+case 7365:
+case 7366:
+case 7367:
+case 7368:
+case 7369:
+case 7370:
+case 7371:
+case 7372:
+case 7373:
+case 7374:
+case 7375:
+case 7376:
+case 7377:
+case 7378:
+case 7379:
+case 7380:
+case 7381:
+case 7382:
+case 7383:
+case 7384:
+case 7385:
+case 7386:
+case 7387:
+case 7388:
+case 7389:
+case 7390:
+case 7391:
+case 7392:
+case 7393:
+case 7394:
+case 7395:
+case 7396:
+case 7397:
+case 7398:
+case 7399:
+case 7400:
+case 7401:
+case 7402:
+case 7403:
+case 7404:
+case 7405:
+case 7406:
+case 7407:
+case 7408:
+case 7409:
+case 7410:
+case 7411:
+case 7412:
+case 7413:
+case 7414:
+case 7415:
+case 7416:
+case 7417:
+case 7418:
+case 7419:
+case 7420:
+case 7421:
+case 7422:
+case 7423:
+case 7424:
+case 7425:
+case 7426:
+case 7427:
+case 7428:
+case 7429:
+case 7430:
+case 7431:
+case 7432:
+case 7433:
+case 7434:
+case 7435:
+case 7436:
+case 7437:
+case 7438:
+case 7439:
+case 7440:
+case 7441:
+case 7442:
+case 7443:
+case 7444:
+case 7445:
+case 7446:
+case 7447:
+case 7448:
+case 7449:
+case 7450:
+case 7451:
+case 7452:
+case 7453:
+case 7454:
+case 7455:
+case 7456:
+case 7457:
+case 7458:
+case 7459:
+case 7460:
+case 7461:
+case 7462:
+case 7463:
+case 7464:
+case 7465:
+case 7466:
+case 7467:
+case 7468:
+case 7469:
+case 7470:
+case 7471:
+case 7472:
+case 7473:
+case 7474:
+case 7475:
+case 7476:
+case 7477:
+case 7478:
+case 7479:
+case 7480:
+case 7481:
+case 7482:
+case 7483:
+case 7484:
+case 7485:
+case 7486:
+case 7487:
+case 7488:
+case 7489:
+case 7490:
+case 7491:
+case 7492:
+case 7493:
+case 7494:
+case 7495:
+case 7496:
+case 7497:
+case 7498:
+case 7499:
+case 7500:
+case 7501:
+case 7502:
+case 7503:
+case 7504:
+case 7505:
+case 7506:
+case 7507:
+case 7508:
+case 7509:
+case 7510:
+case 7511:
+case 7512:
+case 7513:
+case 7514:
+case 7515:
+case 7516:
+case 7517:
+case 7518:
+case 7519:
+case 7520:
+case 7521:
+case 7522:
+case 7523:
+case 7524:
+case 7525:
+case 7526:
+case 7527:
+case 7528:
+case 7529:
+case 7530:
+case 7531:
+case 7532:
+case 7533:
+case 7534:
+case 7535:
+case 7536:
+case 7537:
+case 7538:
+case 7539:
+case 7540:
+case 7541:
+case 7542:
+case 7543:
+case 7544:
+case 7545:
+case 7546:
+case 7547:
+case 7548:
+case 7549:
+case 7550:
+case 7551:
+case 7552:
+case 7553:
+case 7554:
+case 7555:
+case 7556:
+case 7557:
+case 7558:
+case 7559:
+case 7560:
+case 7561:
+case 7562:
+case 7563:
+case 7564:
+case 7565:
+case 7566:
+case 7567:
+case 7568:
+case 7569:
+case 7570:
+case 7571:
+case 7572:
+case 7573:
+case 7574:
+case 7575:
+case 7576:
+case 7577:
+case 7578:
+case 7579:
+case 7580:
+case 7581:
+case 7582:
+case 7583:
+case 7584:
+case 7585:
+case 7586:
+case 7587:
+case 7588:
+case 7589:
+case 7590:
+case 7591:
+case 7592:
+case 7593:
+case 7594:
+case 7595:
+case 7596:
+case 7597:
+case 7598:
+case 7599:
+case 7600:
+case 7601:
+case 7602:
+case 7603:
+case 7604:
+case 7605:
+case 7606:
+case 7607:
+case 7608:
+case 7609:
+case 7610:
+case 7611:
+case 7612:
+case 7613:
+case 7614:
+case 7615:
+case 7616:
+case 7617:
+case 7618:
+case 7619:
+case 7620:
+case 7621:
+case 7622:
+case 7623:
+case 7624:
+case 7625:
+case 7626:
+case 7627:
+case 7628:
+case 7629:
+case 7630:
+case 7631:
+case 7632:
+case 7633:
+case 7634:
+case 7635:
+case 7636:
+case 7637:
+case 7638:
+case 7639:
+case 7640:
+case 7641:
+case 7642:
+case 7643:
+case 7644:
+case 7645:
+case 7646:
+case 7647:
+case 7648:
+case 7649:
+case 7650:
+case 7651:
+case 7652:
+case 7653:
+case 7654:
+case 7655:
+case 7656:
+case 7657:
+case 7658:
+case 7659:
+case 7660:
+case 7661:
+case 7662:
+case 7663:
+case 7664:
+case 7665:
+case 7666:
+case 7667:
+case 7668:
+case 7669:
+case 7670:
+case 7671:
+case 7672:
+case 7673:
+case 7674:
+case 7675:
+case 7676:
+case 7677:
+case 7678:
+case 7679:
+case 7680:
+case 7681:
+case 7682:
+case 7683:
+case 7684:
+case 7685:
+case 7686:
+case 7687:
+case 7688:
+case 7689:
+case 7690:
+case 7691:
+case 7692:
+case 7693:
+case 7694:
+case 7695:
+case 7696:
+case 7697:
+case 7698:
+case 7699:
+case 7700:
+case 7701:
+case 7702:
+case 7703:
+case 7704:
+case 7705:
+case 7706:
+case 7707:
+case 7708:
+case 7709:
+case 7710:
+case 7711:
+case 7712:
+case 7713:
+case 7714:
+case 7715:
+case 7716:
+case 7717:
+case 7718:
+case 7719:
+case 7720:
+case 7721:
+case 7722:
+case 7723:
+case 7724:
+case 7725:
+case 7726:
+case 7727:
+case 7728:
+case 7729:
+case 7730:
+case 7731:
+case 7732:
+case 7733:
+case 7734:
+case 7735:
+case 7736:
+case 7737:
+case 7738:
+case 7739:
+case 7740:
+case 7741:
+case 7742:
+case 7743:
+case 7744:
+case 7745:
+case 7746:
+case 7747:
+case 7748:
+case 7749:
+case 7750:
+case 7751:
+case 7752:
+case 7753:
+case 7754:
+case 7755:
+case 7756:
+case 7757:
+case 7758:
+case 7759:
+case 7760:
+case 7761:
+case 7762:
+case 7763:
+case 7764:
+case 7765:
+case 7766:
+case 7767:
+case 7768:
+case 7769:
+case 7770:
+case 7771:
+case 7772:
+case 7773:
+case 7774:
+case 7775:
+case 7776:
+case 7777:
+case 7778:
+case 7779:
+case 7780:
+case 7781:
+case 7782:
+case 7783:
+case 7784:
+case 7785:
+case 7786:
+case 7787:
+case 7788:
+case 7789:
+case 7790:
+case 7791:
+case 7792:
+case 7793:
+case 7794:
+case 7795:
+case 7796:
+case 7797:
+case 7798:
+case 7799:
+case 7800:
+case 7801:
+case 7802:
+case 7803:
+case 7804:
+case 7805:
+case 7806:
+case 7807:
+case 7808:
+case 7809:
+case 7810:
+case 7811:
+case 7812:
+case 7813:
+case 7814:
+case 7815:
+case 7816:
+case 7817:
+case 7818:
+case 7819:
+case 7820:
+case 7821:
+case 7822:
+case 7823:
+case 7824:
+case 7825:
+case 7826:
+case 7827:
+case 7828:
+case 7829:
+case 7830:
+case 7831:
+case 7832:
+case 7833:
+case 7834:
+case 7835:
+case 7836:
+case 7837:
+case 7838:
+case 7839:
+case 7840:
+case 7841:
+case 7842:
+case 7843:
+case 7844:
+case 7845:
+case 7846:
+case 7847:
+case 7848:
+case 7849:
+case 7850:
+case 7851:
+case 7852:
+case 7853:
+case 7854:
+case 7855:
+case 7856:
+case 7857:
+case 7858:
+case 7859:
+case 7860:
+case 7861:
+case 7862:
+case 7863:
+case 7864:
+case 7865:
+case 7866:
+case 7867:
+case 7868:
+case 7869:
+case 7870:
+case 7871:
+case 7872:
+case 7873:
+case 7874:
+case 7875:
+case 7876:
+case 7877:
+case 7878:
+case 7879:
+case 7880:
+case 7881:
+case 7882:
+case 7883:
+case 7884:
+case 7885:
+case 7886:
+case 7887:
+case 7888:
+case 7889:
+case 7890:
+case 7891:
+case 7892:
+case 7893:
+case 7894:
+case 7895:
+case 7896:
+case 7897:
+case 7898:
+case 7899:
+case 7900:
+case 7901:
+case 7902:
+case 7903:
+case 7904:
+case 7905:
+case 7906:
+case 7907:
+case 7908:
+case 7909:
+case 7910:
+case 7911:
+case 7912:
+case 7913:
+case 7914:
+case 7915:
+case 7916:
+case 7917:
+case 7918:
+case 7919:
+case 7920:
+case 7921:
+case 7922:
+case 7923:
+case 7924:
+case 7925:
+case 7926:
+case 7927:
+case 7928:
+case 7929:
+case 7930:
+case 7931:
+case 7932:
+case 7933:
+case 7934:
+case 7935:
+case 7936:
+case 7937:
+case 7938:
+case 7939:
+case 7940:
+case 7941:
+case 7942:
+case 7943:
+case 7944:
+case 7945:
+case 7946:
+case 7947:
+case 7948:
+case 7949:
+case 7950:
+case 7951:
+case 7952:
+case 7953:
+case 7954:
+case 7955:
+case 7956:
+case 7957:
+case 7958:
+case 7959:
+case 7960:
+case 7961:
+case 7962:
+case 7963:
+case 7964:
+case 7965:
+case 7966:
+case 7967:
+case 7968:
+case 7969:
+case 7970:
+case 7971:
+case 7972:
+case 7973:
+case 7974:
+case 7975:
+case 7976:
+case 7977:
+case 7978:
+case 7979:
+case 7980:
+case 7981:
+case 7982:
+case 7983:
+case 7984:
+case 7985:
+case 7986:
+case 7987:
+case 7988:
+case 7989:
+case 7990:
+case 7991:
+case 7992:
+case 7993:
+case 7994:
+case 7995:
+case 7996:
+case 7997:
+case 7998:
+case 7999:
+case 8000:
+case 8001:
+case 8002:
+case 8003:
+case 8004:
+case 8005:
+case 8006:
+case 8007:
+case 8008:
+case 8009:
+case 8010:
+case 8011:
+case 8012:
+case 8013:
+case 8014:
+case 8015:
+case 8016:
+case 8017:
+case 8018:
+case 8019:
+case 8020:
+case 8021:
+case 8022:
+case 8023:
+case 8024:
+case 8025:
+case 8026:
+case 8027:
+case 8028:
+case 8029:
+case 8030:
+case 8031:
+case 8032:
+case 8033:
+case 8034:
+case 8035:
+case 8036:
+case 8037:
+case 8038:
+case 8039:
+case 8040:
+case 8041:
+case 8042:
+case 8043:
+case 8044:
+case 8045:
+case 8046:
+case 8047:
+case 8048:
+case 8049:
+case 8050:
+case 8051:
+case 8052:
+case 8053:
+case 8054:
+case 8055:
+case 8056:
+case 8057:
+case 8058:
+case 8059:
+case 8060:
+case 8061:
+case 8062:
+case 8063:
+case 8064:
+case 8065:
+case 8066:
+case 8067:
+case 8068:
+case 8069:
+case 8070:
+case 8071:
+case 8072:
+case 8073:
+case 8074:
+case 8075:
+case 8076:
+case 8077:
+case 8078:
+case 8079:
+case 8080:
+case 8081:
+case 8082:
+case 8083:
+case 8084:
+case 8085:
+case 8086:
+case 8087:
+case 8088:
+case 8089:
+case 8090:
+case 8091:
+case 8092:
+case 8093:
+case 8094:
+case 8095:
+case 8096:
+case 8097:
+case 8098:
+case 8099:
+case 8100:
+case 8101:
+case 8102:
+case 8103:
+case 8104:
+case 8105:
+case 8106:
+case 8107:
+case 8108:
+case 8109:
+case 8110:
+case 8111:
+case 8112:
+case 8113:
+case 8114:
+case 8115:
+case 8116:
+case 8117:
+case 8118:
+case 8119:
+case 8120:
+case 8121:
+case 8122:
+case 8123:
+case 8124:
+case 8125:
+case 8126:
+case 8127:
+case 8128:
+case 8129:
+case 8130:
+case 8131:
+case 8132:
+case 8133:
+case 8134:
+case 8135:
+case 8136:
+case 8137:
+case 8138:
+case 8139:
+case 8140:
+case 8141:
+case 8142:
+case 8143:
+case 8144:
+case 8145:
+case 8146:
+case 8147:
+case 8148:
+case 8149:
+case 8150:
+case 8151:
+case 8152:
+case 8153:
+case 8154:
+case 8155:
+case 8156:
+case 8157:
+case 8158:
+case 8159:
+case 8160:
+case 8161:
+case 8162:
+case 8163:
+case 8164:
+case 8165:
+case 8166:
+case 8167:
+case 8168:
+case 8169:
+case 8170:
+case 8171:
+case 8172:
+case 8173:
+case 8174:
+case 8175:
+case 8176:
+case 8177:
+case 8178:
+case 8179:
+case 8180:
+case 8181:
+case 8182:
+case 8183:
+case 8184:
+case 8185:
+case 8186:
+case 8187:
+case 8188:
+case 8189:
+case 8190:
+case 8191:
+case 8192:
+case 8193:
+case 8194:
+case 8195:
+case 8196:
+case 8197:
+case 8198:
+case 8199:
+case 8200:
+case 8201:
+case 8202:
+case 8203:
+case 8204:
+case 8205:
+case 8206:
+case 8207:
+case 8208:
+case 8209:
+case 8210:
+case 8211:
+case 8212:
+case 8213:
+case 8214:
+case 8215:
+case 8216:
+case 8217:
+case 8218:
+case 8219:
+case 8220:
+case 8221:
+case 8222:
+case 8223:
+case 8224:
+case 8225:
+case 8226:
+case 8227:
+case 8228:
+case 8229:
+case 8230:
+case 8231:
+case 8232:
+case 8233:
+case 8234:
+case 8235:
+case 8236:
+case 8237:
+case 8238:
+case 8239:
+case 8240:
+case 8241:
+case 8242:
+case 8243:
+case 8244:
+case 8245:
+case 8246:
+case 8247:
+case 8248:
+case 8249:
+case 8250:
+case 8251:
+case 8252:
+case 8253:
+case 8254:
+case 8255:
+case 8256:
+case 8257:
+case 8258:
+case 8259:
+case 8260:
+case 8261:
+case 8262:
+case 8263:
+case 8264:
+case 8265:
+case 8266:
+case 8267:
+case 8268:
+case 8269:
+case 8270:
+case 8271:
+case 8272:
+case 8273:
+case 8274:
+case 8275:
+case 8276:
+case 8277:
+case 8278:
+case 8279:
+case 8280:
+case 8281:
+case 8282:
+case 8283:
+case 8284:
+case 8285:
+case 8286:
+case 8287:
+case 8288:
+case 8289:
+case 8290:
+case 8291:
+case 8292:
+case 8293:
+case 8294:
+case 8295:
+case 8296:
+case 8297:
+case 8298:
+case 8299:
+case 8300:
+case 8301:
+case 8302:
+case 8303:
+case 8304:
+case 8305:
+case 8306:
+case 8307:
+case 8308:
+case 8309:
+case 8310:
+case 8311:
+case 8312:
+case 8313:
+case 8314:
+case 8315:
+case 8316:
+case 8317:
+case 8318:
+case 8319:
+case 8320:
+case 8321:
+case 8322:
+case 8323:
+case 8324:
+case 8325:
+case 8326:
+case 8327:
+case 8328:
+case 8329:
+case 8330:
+case 8331:
+case 8332:
+case 8333:
+case 8334:
+case 8335:
+case 8336:
+case 8337:
+case 8338:
+case 8339:
+case 8340:
+case 8341:
+case 8342:
+case 8343:
+case 8344:
+case 8345:
+case 8346:
+case 8347:
+case 8348:
+case 8349:
+case 8350:
+case 8351:
+case 8352:
+case 8353:
+case 8354:
+case 8355:
+case 8356:
+case 8357:
+case 8358:
+case 8359:
+case 8360:
+case 8361:
+case 8362:
+case 8363:
+case 8364:
+case 8365:
+case 8366:
+case 8367:
+case 8368:
+case 8369:
+case 8370:
+case 8371:
+case 8372:
+case 8373:
+case 8374:
+case 8375:
+case 8376:
+case 8377:
+case 8378:
+case 8379:
+case 8380:
+case 8381:
+case 8382:
+case 8383:
+case 8384:
+case 8385:
+case 8386:
+case 8387:
+case 8388:
+case 8389:
+case 8390:
+case 8391:
+case 8392:
+case 8393:
+case 8394:
+case 8395:
+case 8396:
+case 8397:
+case 8398:
+case 8399:
+case 8400:
+case 8401:
+case 8402:
+case 8403:
+case 8404:
+case 8405:
+case 8406:
+case 8407:
+case 8408:
+case 8409:
+case 8410:
+case 8411:
+case 8412:
+case 8413:
+case 8414:
+case 8415:
+case 8416:
+case 8417:
+case 8418:
+case 8419:
+case 8420:
+case 8421:
+case 8422:
+case 8423:
+case 8424:
+case 8425:
+case 8426:
+case 8427:
+case 8428:
+case 8429:
+case 8430:
+case 8431:
+case 8432:
+case 8433:
+case 8434:
+case 8435:
+case 8436:
+case 8437:
+case 8438:
+case 8439:
+case 8440:
+case 8441:
+case 8442:
+case 8443:
+case 8444:
+case 8445:
+case 8446:
+case 8447:
+case 8448:
+case 8449:
+case 8450:
+case 8451:
+case 8452:
+case 8453:
+case 8454:
+case 8455:
+case 8456:
+case 8457:
+case 8458:
+case 8459:
+case 8460:
+case 8461:
+case 8462:
+case 8463:
+case 8464:
+case 8465:
+case 8466:
+case 8467:
+case 8468:
+case 8469:
+case 8470:
+case 8471:
+case 8472:
+case 8473:
+case 8474:
+case 8475:
+case 8476:
+case 8477:
+case 8478:
+case 8479:
+case 8480:
+case 8481:
+case 8482:
+case 8483:
+case 8484:
+case 8485:
+case 8486:
+case 8487:
+case 8488:
+case 8489:
+case 8490:
+case 8491:
+case 8492:
+case 8493:
+case 8494:
+case 8495:
+case 8496:
+case 8497:
+case 8498:
+case 8499:
+case 8500:
+case 8501:
+case 8502:
+case 8503:
+case 8504:
+case 8505:
+case 8506:
+case 8507:
+case 8508:
+case 8509:
+case 8510:
+case 8511:
+case 8512:
+case 8513:
+case 8514:
+case 8515:
+case 8516:
+case 8517:
+case 8518:
+case 8519:
+case 8520:
+case 8521:
+case 8522:
+case 8523:
+case 8524:
+case 8525:
+case 8526:
+case 8527:
+case 8528:
+case 8529:
+case 8530:
+case 8531:
+case 8532:
+case 8533:
+case 8534:
+case 8535:
+case 8536:
+case 8537:
+case 8538:
+case 8539:
+case 8540:
+case 8541:
+case 8542:
+case 8543:
+case 8544:
+case 8545:
+case 8546:
+case 8547:
+case 8548:
+case 8549:
+case 8550:
+case 8551:
+case 8552:
+case 8553:
+case 8554:
+case 8555:
+case 8556:
+case 8557:
+case 8558:
+case 8559:
+case 8560:
+case 8561:
+case 8562:
+case 8563:
+case 8564:
+case 8565:
+case 8566:
+case 8567:
+case 8568:
+case 8569:
+case 8570:
+case 8571:
+case 8572:
+case 8573:
+case 8574:
+case 8575:
+case 8576:
+case 8577:
+case 8578:
+case 8579:
+case 8580:
+case 8581:
+case 8582:
+case 8583:
+case 8584:
+case 8585:
+case 8586:
+case 8587:
+case 8588:
+case 8589:
+case 8590:
+case 8591:
+case 8592:
+case 8593:
+case 8594:
+case 8595:
+case 8596:
+case 8597:
+case 8598:
+case 8599:
+case 8600:
+case 8601:
+case 8602:
+case 8603:
+case 8604:
+case 8605:
+case 8606:
+case 8607:
+case 8608:
+case 8609:
+case 8610:
+case 8611:
+case 8612:
+case 8613:
+case 8614:
+case 8615:
+case 8616:
+case 8617:
+case 8618:
+case 8619:
+case 8620:
+case 8621:
+case 8622:
+case 8623:
+case 8624:
+case 8625:
+case 8626:
+case 8627:
+case 8628:
+case 8629:
+case 8630:
+case 8631:
+case 8632:
+case 8633:
+case 8634:
+case 8635:
+case 8636:
+case 8637:
+case 8638:
+case 8639:
+case 8640:
+case 8641:
+case 8642:
+case 8643:
+case 8644:
+case 8645:
+case 8646:
+case 8647:
+case 8648:
+case 8649:
+case 8650:
+case 8651:
+case 8652:
+case 8653:
+case 8654:
+case 8655:
+case 8656:
+case 8657:
+case 8658:
+case 8659:
+case 8660:
+case 8661:
+case 8662:
+case 8663:
+case 8664:
+case 8665:
+case 8666:
+case 8667:
+case 8668:
+case 8669:
+case 8670:
+case 8671:
+case 8672:
+case 8673:
+case 8674:
+case 8675:
+case 8676:
+case 8677:
+case 8678:
+case 8679:
+case 8680:
+case 8681:
+case 8682:
+case 8683:
+case 8684:
+case 8685:
+case 8686:
+case 8687:
+case 8688:
+case 8689:
+case 8690:
+case 8691:
+case 8692:
+case 8693:
+case 8694:
+case 8695:
+case 8696:
+case 8697:
+case 8698:
+case 8699:
+case 8700:
+case 8701:
+case 8702:
+case 8703:
+case 8704:
+case 8705:
+case 8706:
+case 8707:
+case 8708:
+case 8709:
+case 8710:
+case 8711:
+case 8712:
+case 8713:
+case 8714:
+case 8715:
+case 8716:
+case 8717:
+case 8718:
+case 8719:
+case 8720:
+case 8721:
+case 8722:
+case 8723:
+case 8724:
+case 8725:
+case 8726:
+case 8727:
+case 8728:
+case 8729:
+case 8730:
+case 8731:
+case 8732:
+case 8733:
+case 8734:
+case 8735:
+case 8736:
+case 8737:
+case 8738:
+case 8739:
+case 8740:
+case 8741:
+case 8742:
+case 8743:
+case 8744:
+case 8745:
+case 8746:
+case 8747:
+case 8748:
+case 8749:
+case 8750:
+case 8751:
+case 8752:
+case 8753:
+case 8754:
+case 8755:
+case 8756:
+case 8757:
+case 8758:
+case 8759:
+case 8760:
+case 8761:
+case 8762:
+case 8763:
+case 8764:
+case 8765:
+case 8766:
+case 8767:
+case 8768:
+case 8769:
+case 8770:
+case 8771:
+case 8772:
+case 8773:
+case 8774:
+case 8775:
+case 8776:
+case 8777:
+case 8778:
+case 8779:
+case 8780:
+case 8781:
+case 8782:
+case 8783:
+case 8784:
+case 8785:
+case 8786:
+case 8787:
+case 8788:
+case 8789:
+case 8790:
+case 8791:
+case 8792:
+case 8793:
+case 8794:
+case 8795:
+case 8796:
+case 8797:
+case 8798:
+case 8799:
+case 8800:
+case 8801:
+case 8802:
+case 8803:
+case 8804:
+case 8805:
+case 8806:
+case 8807:
+case 8808:
+case 8809:
+case 8810:
+case 8811:
+case 8812:
+case 8813:
+case 8814:
+case 8815:
+case 8816:
+case 8817:
+case 8818:
+case 8819:
+case 8820:
+case 8821:
+case 8822:
+case 8823:
+case 8824:
+case 8825:
+case 8826:
+case 8827:
+case 8828:
+case 8829:
+case 8830:
+case 8831:
+case 8832:
+case 8833:
+case 8834:
+case 8835:
+case 8836:
+case 8837:
+case 8838:
+case 8839:
+case 8840:
+case 8841:
+case 8842:
+case 8843:
+case 8844:
+case 8845:
+case 8846:
+case 8847:
+case 8848:
+case 8849:
+case 8850:
+case 8851:
+case 8852:
+case 8853:
+case 8854:
+case 8855:
+case 8856:
+case 8857:
+case 8858:
+case 8859:
+case 8860:
+case 8861:
+case 8862:
+case 8863:
+case 8864:
+case 8865:
+case 8866:
+case 8867:
+case 8868:
+case 8869:
+case 8870:
+case 8871:
+case 8872:
+case 8873:
+case 8874:
+case 8875:
+case 8876:
+case 8877:
+case 8878:
+case 8879:
+case 8880:
+case 8881:
+case 8882:
+case 8883:
+case 8884:
+case 8885:
+case 8886:
+case 8887:
+case 8888:
+case 8889:
+case 8890:
+case 8891:
+case 8892:
+case 8893:
+case 8894:
+case 8895:
+case 8896:
+case 8897:
+case 8898:
+case 8899:
+case 8900:
+case 8901:
+case 8902:
+case 8903:
+case 8904:
+case 8905:
+case 8906:
+case 8907:
+case 8908:
+case 8909:
+case 8910:
+case 8911:
+case 8912:
+case 8913:
+case 8914:
+case 8915:
+case 8916:
+case 8917:
+case 8918:
+case 8919:
+case 8920:
+case 8921:
+case 8922:
+case 8923:
+case 8924:
+case 8925:
+case 8926:
+case 8927:
+case 8928:
+case 8929:
+case 8930:
+case 8931:
+case 8932:
+case 8933:
+case 8934:
+case 8935:
+case 8936:
+case 8937:
+case 8938:
+case 8939:
+case 8940:
+case 8941:
+case 8942:
+case 8943:
+case 8944:
+case 8945:
+case 8946:
+case 8947:
+case 8948:
+case 8949:
+case 8950:
+case 8951:
+case 8952:
+case 8953:
+case 8954:
+case 8955:
+case 8956:
+case 8957:
+case 8958:
+case 8959:
+case 8960:
+case 8961:
+case 8962:
+case 8963:
+case 8964:
+case 8965:
+case 8966:
+case 8967:
+case 8968:
+case 8969:
+case 8970:
+case 8971:
+case 8972:
+case 8973:
+case 8974:
+case 8975:
+case 8976:
+case 8977:
+case 8978:
+case 8979:
+case 8980:
+case 8981:
+case 8982:
+case 8983:
+case 8984:
+case 8985:
+case 8986:
+case 8987:
+case 8988:
+case 8989:
+case 8990:
+case 8991:
+case 8992:
+case 8993:
+case 8994:
+case 8995:
+case 8996:
+case 8997:
+case 8998:
+case 8999:
+ actual += 'a';
+}
+expect = 'a';
+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 < UBound; i++)
+ {
+ reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
+ }
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-74474-003.js b/tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-74474-003.js
new file mode 100644
index 0000000000..0bbe062ca9
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-74474-003.js
@@ -0,0 +1,9099 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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):
+ * brendan@mozilla.org, 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 May 2001
+ *
+ * SUMMARY: Regression test for Bugzilla bug 74474
+ * "switch() misbehaves with duplicated labels"
+ *
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=74474
+ * See ECMA3 Section 12.11, "The switch Statement"
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-74474-003.js';
+var UBound = 0;
+var BUGNUMBER = 74474;
+var summary = 'Test of switch statement that overflows the stack-allocated bitmap';
+var status = '(One duplicated label [8998])';
+var statusitems = [ ];
+var actual = '';
+var actualvalues = [ ];
+var expect= '';
+var expectedvalues = [ ];
+var x = 3;
+
+
+switch (x)
+{
+case 0:
+case 1:
+case 2:
+case 3:
+case 4:
+case 5:
+case 6:
+case 7:
+case 8:
+case 9:
+case 10:
+case 11:
+case 12:
+case 13:
+case 14:
+case 15:
+case 16:
+case 17:
+case 18:
+case 19:
+case 20:
+case 21:
+case 22:
+case 23:
+case 24:
+case 25:
+case 26:
+case 27:
+case 28:
+case 29:
+case 30:
+case 31:
+case 32:
+case 33:
+case 34:
+case 35:
+case 36:
+case 37:
+case 38:
+case 39:
+case 40:
+case 41:
+case 42:
+case 43:
+case 44:
+case 45:
+case 46:
+case 47:
+case 48:
+case 49:
+case 50:
+case 51:
+case 52:
+case 53:
+case 54:
+case 55:
+case 56:
+case 57:
+case 58:
+case 59:
+case 60:
+case 61:
+case 62:
+case 63:
+case 64:
+case 65:
+case 66:
+case 67:
+case 68:
+case 69:
+case 70:
+case 71:
+case 72:
+case 73:
+case 74:
+case 75:
+case 76:
+case 77:
+case 78:
+case 79:
+case 80:
+case 81:
+case 82:
+case 83:
+case 84:
+case 85:
+case 86:
+case 87:
+case 88:
+case 89:
+case 90:
+case 91:
+case 92:
+case 93:
+case 94:
+case 95:
+case 96:
+case 97:
+case 98:
+case 99:
+case 100:
+case 101:
+case 102:
+case 103:
+case 104:
+case 105:
+case 106:
+case 107:
+case 108:
+case 109:
+case 110:
+case 111:
+case 112:
+case 113:
+case 114:
+case 115:
+case 116:
+case 117:
+case 118:
+case 119:
+case 120:
+case 121:
+case 122:
+case 123:
+case 124:
+case 125:
+case 126:
+case 127:
+case 128:
+case 129:
+case 130:
+case 131:
+case 132:
+case 133:
+case 134:
+case 135:
+case 136:
+case 137:
+case 138:
+case 139:
+case 140:
+case 141:
+case 142:
+case 143:
+case 144:
+case 145:
+case 146:
+case 147:
+case 148:
+case 149:
+case 150:
+case 151:
+case 152:
+case 153:
+case 154:
+case 155:
+case 156:
+case 157:
+case 158:
+case 159:
+case 160:
+case 161:
+case 162:
+case 163:
+case 164:
+case 165:
+case 166:
+case 167:
+case 168:
+case 169:
+case 170:
+case 171:
+case 172:
+case 173:
+case 174:
+case 175:
+case 176:
+case 177:
+case 178:
+case 179:
+case 180:
+case 181:
+case 182:
+case 183:
+case 184:
+case 185:
+case 186:
+case 187:
+case 188:
+case 189:
+case 190:
+case 191:
+case 192:
+case 193:
+case 194:
+case 195:
+case 196:
+case 197:
+case 198:
+case 199:
+case 200:
+case 201:
+case 202:
+case 203:
+case 204:
+case 205:
+case 206:
+case 207:
+case 208:
+case 209:
+case 210:
+case 211:
+case 212:
+case 213:
+case 214:
+case 215:
+case 216:
+case 217:
+case 218:
+case 219:
+case 220:
+case 221:
+case 222:
+case 223:
+case 224:
+case 225:
+case 226:
+case 227:
+case 228:
+case 229:
+case 230:
+case 231:
+case 232:
+case 233:
+case 234:
+case 235:
+case 236:
+case 237:
+case 238:
+case 239:
+case 240:
+case 241:
+case 242:
+case 243:
+case 244:
+case 245:
+case 246:
+case 247:
+case 248:
+case 249:
+case 250:
+case 251:
+case 252:
+case 253:
+case 254:
+case 255:
+case 256:
+case 257:
+case 258:
+case 259:
+case 260:
+case 261:
+case 262:
+case 263:
+case 264:
+case 265:
+case 266:
+case 267:
+case 268:
+case 269:
+case 270:
+case 271:
+case 272:
+case 273:
+case 274:
+case 275:
+case 276:
+case 277:
+case 278:
+case 279:
+case 280:
+case 281:
+case 282:
+case 283:
+case 284:
+case 285:
+case 286:
+case 287:
+case 288:
+case 289:
+case 290:
+case 291:
+case 292:
+case 293:
+case 294:
+case 295:
+case 296:
+case 297:
+case 298:
+case 299:
+case 300:
+case 301:
+case 302:
+case 303:
+case 304:
+case 305:
+case 306:
+case 307:
+case 308:
+case 309:
+case 310:
+case 311:
+case 312:
+case 313:
+case 314:
+case 315:
+case 316:
+case 317:
+case 318:
+case 319:
+case 320:
+case 321:
+case 322:
+case 323:
+case 324:
+case 325:
+case 326:
+case 327:
+case 328:
+case 329:
+case 330:
+case 331:
+case 332:
+case 333:
+case 334:
+case 335:
+case 336:
+case 337:
+case 338:
+case 339:
+case 340:
+case 341:
+case 342:
+case 343:
+case 344:
+case 345:
+case 346:
+case 347:
+case 348:
+case 349:
+case 350:
+case 351:
+case 352:
+case 353:
+case 354:
+case 355:
+case 356:
+case 357:
+case 358:
+case 359:
+case 360:
+case 361:
+case 362:
+case 363:
+case 364:
+case 365:
+case 366:
+case 367:
+case 368:
+case 369:
+case 370:
+case 371:
+case 372:
+case 373:
+case 374:
+case 375:
+case 376:
+case 377:
+case 378:
+case 379:
+case 380:
+case 381:
+case 382:
+case 383:
+case 384:
+case 385:
+case 386:
+case 387:
+case 388:
+case 389:
+case 390:
+case 391:
+case 392:
+case 393:
+case 394:
+case 395:
+case 396:
+case 397:
+case 398:
+case 399:
+case 400:
+case 401:
+case 402:
+case 403:
+case 404:
+case 405:
+case 406:
+case 407:
+case 408:
+case 409:
+case 410:
+case 411:
+case 412:
+case 413:
+case 414:
+case 415:
+case 416:
+case 417:
+case 418:
+case 419:
+case 420:
+case 421:
+case 422:
+case 423:
+case 424:
+case 425:
+case 426:
+case 427:
+case 428:
+case 429:
+case 430:
+case 431:
+case 432:
+case 433:
+case 434:
+case 435:
+case 436:
+case 437:
+case 438:
+case 439:
+case 440:
+case 441:
+case 442:
+case 443:
+case 444:
+case 445:
+case 446:
+case 447:
+case 448:
+case 449:
+case 450:
+case 451:
+case 452:
+case 453:
+case 454:
+case 455:
+case 456:
+case 457:
+case 458:
+case 459:
+case 460:
+case 461:
+case 462:
+case 463:
+case 464:
+case 465:
+case 466:
+case 467:
+case 468:
+case 469:
+case 470:
+case 471:
+case 472:
+case 473:
+case 474:
+case 475:
+case 476:
+case 477:
+case 478:
+case 479:
+case 480:
+case 481:
+case 482:
+case 483:
+case 484:
+case 485:
+case 486:
+case 487:
+case 488:
+case 489:
+case 490:
+case 491:
+case 492:
+case 493:
+case 494:
+case 495:
+case 496:
+case 497:
+case 498:
+case 499:
+case 500:
+case 501:
+case 502:
+case 503:
+case 504:
+case 505:
+case 506:
+case 507:
+case 508:
+case 509:
+case 510:
+case 511:
+case 512:
+case 513:
+case 514:
+case 515:
+case 516:
+case 517:
+case 518:
+case 519:
+case 520:
+case 521:
+case 522:
+case 523:
+case 524:
+case 525:
+case 526:
+case 527:
+case 528:
+case 529:
+case 530:
+case 531:
+case 532:
+case 533:
+case 534:
+case 535:
+case 536:
+case 537:
+case 538:
+case 539:
+case 540:
+case 541:
+case 542:
+case 543:
+case 544:
+case 545:
+case 546:
+case 547:
+case 548:
+case 549:
+case 550:
+case 551:
+case 552:
+case 553:
+case 554:
+case 555:
+case 556:
+case 557:
+case 558:
+case 559:
+case 560:
+case 561:
+case 562:
+case 563:
+case 564:
+case 565:
+case 566:
+case 567:
+case 568:
+case 569:
+case 570:
+case 571:
+case 572:
+case 573:
+case 574:
+case 575:
+case 576:
+case 577:
+case 578:
+case 579:
+case 580:
+case 581:
+case 582:
+case 583:
+case 584:
+case 585:
+case 586:
+case 587:
+case 588:
+case 589:
+case 590:
+case 591:
+case 592:
+case 593:
+case 594:
+case 595:
+case 596:
+case 597:
+case 598:
+case 599:
+case 600:
+case 601:
+case 602:
+case 603:
+case 604:
+case 605:
+case 606:
+case 607:
+case 608:
+case 609:
+case 610:
+case 611:
+case 612:
+case 613:
+case 614:
+case 615:
+case 616:
+case 617:
+case 618:
+case 619:
+case 620:
+case 621:
+case 622:
+case 623:
+case 624:
+case 625:
+case 626:
+case 627:
+case 628:
+case 629:
+case 630:
+case 631:
+case 632:
+case 633:
+case 634:
+case 635:
+case 636:
+case 637:
+case 638:
+case 639:
+case 640:
+case 641:
+case 642:
+case 643:
+case 644:
+case 645:
+case 646:
+case 647:
+case 648:
+case 649:
+case 650:
+case 651:
+case 652:
+case 653:
+case 654:
+case 655:
+case 656:
+case 657:
+case 658:
+case 659:
+case 660:
+case 661:
+case 662:
+case 663:
+case 664:
+case 665:
+case 666:
+case 667:
+case 668:
+case 669:
+case 670:
+case 671:
+case 672:
+case 673:
+case 674:
+case 675:
+case 676:
+case 677:
+case 678:
+case 679:
+case 680:
+case 681:
+case 682:
+case 683:
+case 684:
+case 685:
+case 686:
+case 687:
+case 688:
+case 689:
+case 690:
+case 691:
+case 692:
+case 693:
+case 694:
+case 695:
+case 696:
+case 697:
+case 698:
+case 699:
+case 700:
+case 701:
+case 702:
+case 703:
+case 704:
+case 705:
+case 706:
+case 707:
+case 708:
+case 709:
+case 710:
+case 711:
+case 712:
+case 713:
+case 714:
+case 715:
+case 716:
+case 717:
+case 718:
+case 719:
+case 720:
+case 721:
+case 722:
+case 723:
+case 724:
+case 725:
+case 726:
+case 727:
+case 728:
+case 729:
+case 730:
+case 731:
+case 732:
+case 733:
+case 734:
+case 735:
+case 736:
+case 737:
+case 738:
+case 739:
+case 740:
+case 741:
+case 742:
+case 743:
+case 744:
+case 745:
+case 746:
+case 747:
+case 748:
+case 749:
+case 750:
+case 751:
+case 752:
+case 753:
+case 754:
+case 755:
+case 756:
+case 757:
+case 758:
+case 759:
+case 760:
+case 761:
+case 762:
+case 763:
+case 764:
+case 765:
+case 766:
+case 767:
+case 768:
+case 769:
+case 770:
+case 771:
+case 772:
+case 773:
+case 774:
+case 775:
+case 776:
+case 777:
+case 778:
+case 779:
+case 780:
+case 781:
+case 782:
+case 783:
+case 784:
+case 785:
+case 786:
+case 787:
+case 788:
+case 789:
+case 790:
+case 791:
+case 792:
+case 793:
+case 794:
+case 795:
+case 796:
+case 797:
+case 798:
+case 799:
+case 800:
+case 801:
+case 802:
+case 803:
+case 804:
+case 805:
+case 806:
+case 807:
+case 808:
+case 809:
+case 810:
+case 811:
+case 812:
+case 813:
+case 814:
+case 815:
+case 816:
+case 817:
+case 818:
+case 819:
+case 820:
+case 821:
+case 822:
+case 823:
+case 824:
+case 825:
+case 826:
+case 827:
+case 828:
+case 829:
+case 830:
+case 831:
+case 832:
+case 833:
+case 834:
+case 835:
+case 836:
+case 837:
+case 838:
+case 839:
+case 840:
+case 841:
+case 842:
+case 843:
+case 844:
+case 845:
+case 846:
+case 847:
+case 848:
+case 849:
+case 850:
+case 851:
+case 852:
+case 853:
+case 854:
+case 855:
+case 856:
+case 857:
+case 858:
+case 859:
+case 860:
+case 861:
+case 862:
+case 863:
+case 864:
+case 865:
+case 866:
+case 867:
+case 868:
+case 869:
+case 870:
+case 871:
+case 872:
+case 873:
+case 874:
+case 875:
+case 876:
+case 877:
+case 878:
+case 879:
+case 880:
+case 881:
+case 882:
+case 883:
+case 884:
+case 885:
+case 886:
+case 887:
+case 888:
+case 889:
+case 890:
+case 891:
+case 892:
+case 893:
+case 894:
+case 895:
+case 896:
+case 897:
+case 898:
+case 899:
+case 900:
+case 901:
+case 902:
+case 903:
+case 904:
+case 905:
+case 906:
+case 907:
+case 908:
+case 909:
+case 910:
+case 911:
+case 912:
+case 913:
+case 914:
+case 915:
+case 916:
+case 917:
+case 918:
+case 919:
+case 920:
+case 921:
+case 922:
+case 923:
+case 924:
+case 925:
+case 926:
+case 927:
+case 928:
+case 929:
+case 930:
+case 931:
+case 932:
+case 933:
+case 934:
+case 935:
+case 936:
+case 937:
+case 938:
+case 939:
+case 940:
+case 941:
+case 942:
+case 943:
+case 944:
+case 945:
+case 946:
+case 947:
+case 948:
+case 949:
+case 950:
+case 951:
+case 952:
+case 953:
+case 954:
+case 955:
+case 956:
+case 957:
+case 958:
+case 959:
+case 960:
+case 961:
+case 962:
+case 963:
+case 964:
+case 965:
+case 966:
+case 967:
+case 968:
+case 969:
+case 970:
+case 971:
+case 972:
+case 973:
+case 974:
+case 975:
+case 976:
+case 977:
+case 978:
+case 979:
+case 980:
+case 981:
+case 982:
+case 983:
+case 984:
+case 985:
+case 986:
+case 987:
+case 988:
+case 989:
+case 990:
+case 991:
+case 992:
+case 993:
+case 994:
+case 995:
+case 996:
+case 997:
+case 998:
+case 999:
+case 1000:
+case 1001:
+case 1002:
+case 1003:
+case 1004:
+case 1005:
+case 1006:
+case 1007:
+case 1008:
+case 1009:
+case 1010:
+case 1011:
+case 1012:
+case 1013:
+case 1014:
+case 1015:
+case 1016:
+case 1017:
+case 1018:
+case 1019:
+case 1020:
+case 1021:
+case 1022:
+case 1023:
+case 1024:
+case 1025:
+case 1026:
+case 1027:
+case 1028:
+case 1029:
+case 1030:
+case 1031:
+case 1032:
+case 1033:
+case 1034:
+case 1035:
+case 1036:
+case 1037:
+case 1038:
+case 1039:
+case 1040:
+case 1041:
+case 1042:
+case 1043:
+case 1044:
+case 1045:
+case 1046:
+case 1047:
+case 1048:
+case 1049:
+case 1050:
+case 1051:
+case 1052:
+case 1053:
+case 1054:
+case 1055:
+case 1056:
+case 1057:
+case 1058:
+case 1059:
+case 1060:
+case 1061:
+case 1062:
+case 1063:
+case 1064:
+case 1065:
+case 1066:
+case 1067:
+case 1068:
+case 1069:
+case 1070:
+case 1071:
+case 1072:
+case 1073:
+case 1074:
+case 1075:
+case 1076:
+case 1077:
+case 1078:
+case 1079:
+case 1080:
+case 1081:
+case 1082:
+case 1083:
+case 1084:
+case 1085:
+case 1086:
+case 1087:
+case 1088:
+case 1089:
+case 1090:
+case 1091:
+case 1092:
+case 1093:
+case 1094:
+case 1095:
+case 1096:
+case 1097:
+case 1098:
+case 1099:
+case 1100:
+case 1101:
+case 1102:
+case 1103:
+case 1104:
+case 1105:
+case 1106:
+case 1107:
+case 1108:
+case 1109:
+case 1110:
+case 1111:
+case 1112:
+case 1113:
+case 1114:
+case 1115:
+case 1116:
+case 1117:
+case 1118:
+case 1119:
+case 1120:
+case 1121:
+case 1122:
+case 1123:
+case 1124:
+case 1125:
+case 1126:
+case 1127:
+case 1128:
+case 1129:
+case 1130:
+case 1131:
+case 1132:
+case 1133:
+case 1134:
+case 1135:
+case 1136:
+case 1137:
+case 1138:
+case 1139:
+case 1140:
+case 1141:
+case 1142:
+case 1143:
+case 1144:
+case 1145:
+case 1146:
+case 1147:
+case 1148:
+case 1149:
+case 1150:
+case 1151:
+case 1152:
+case 1153:
+case 1154:
+case 1155:
+case 1156:
+case 1157:
+case 1158:
+case 1159:
+case 1160:
+case 1161:
+case 1162:
+case 1163:
+case 1164:
+case 1165:
+case 1166:
+case 1167:
+case 1168:
+case 1169:
+case 1170:
+case 1171:
+case 1172:
+case 1173:
+case 1174:
+case 1175:
+case 1176:
+case 1177:
+case 1178:
+case 1179:
+case 1180:
+case 1181:
+case 1182:
+case 1183:
+case 1184:
+case 1185:
+case 1186:
+case 1187:
+case 1188:
+case 1189:
+case 1190:
+case 1191:
+case 1192:
+case 1193:
+case 1194:
+case 1195:
+case 1196:
+case 1197:
+case 1198:
+case 1199:
+case 1200:
+case 1201:
+case 1202:
+case 1203:
+case 1204:
+case 1205:
+case 1206:
+case 1207:
+case 1208:
+case 1209:
+case 1210:
+case 1211:
+case 1212:
+case 1213:
+case 1214:
+case 1215:
+case 1216:
+case 1217:
+case 1218:
+case 1219:
+case 1220:
+case 1221:
+case 1222:
+case 1223:
+case 1224:
+case 1225:
+case 1226:
+case 1227:
+case 1228:
+case 1229:
+case 1230:
+case 1231:
+case 1232:
+case 1233:
+case 1234:
+case 1235:
+case 1236:
+case 1237:
+case 1238:
+case 1239:
+case 1240:
+case 1241:
+case 1242:
+case 1243:
+case 1244:
+case 1245:
+case 1246:
+case 1247:
+case 1248:
+case 1249:
+case 1250:
+case 1251:
+case 1252:
+case 1253:
+case 1254:
+case 1255:
+case 1256:
+case 1257:
+case 1258:
+case 1259:
+case 1260:
+case 1261:
+case 1262:
+case 1263:
+case 1264:
+case 1265:
+case 1266:
+case 1267:
+case 1268:
+case 1269:
+case 1270:
+case 1271:
+case 1272:
+case 1273:
+case 1274:
+case 1275:
+case 1276:
+case 1277:
+case 1278:
+case 1279:
+case 1280:
+case 1281:
+case 1282:
+case 1283:
+case 1284:
+case 1285:
+case 1286:
+case 1287:
+case 1288:
+case 1289:
+case 1290:
+case 1291:
+case 1292:
+case 1293:
+case 1294:
+case 1295:
+case 1296:
+case 1297:
+case 1298:
+case 1299:
+case 1300:
+case 1301:
+case 1302:
+case 1303:
+case 1304:
+case 1305:
+case 1306:
+case 1307:
+case 1308:
+case 1309:
+case 1310:
+case 1311:
+case 1312:
+case 1313:
+case 1314:
+case 1315:
+case 1316:
+case 1317:
+case 1318:
+case 1319:
+case 1320:
+case 1321:
+case 1322:
+case 1323:
+case 1324:
+case 1325:
+case 1326:
+case 1327:
+case 1328:
+case 1329:
+case 1330:
+case 1331:
+case 1332:
+case 1333:
+case 1334:
+case 1335:
+case 1336:
+case 1337:
+case 1338:
+case 1339:
+case 1340:
+case 1341:
+case 1342:
+case 1343:
+case 1344:
+case 1345:
+case 1346:
+case 1347:
+case 1348:
+case 1349:
+case 1350:
+case 1351:
+case 1352:
+case 1353:
+case 1354:
+case 1355:
+case 1356:
+case 1357:
+case 1358:
+case 1359:
+case 1360:
+case 1361:
+case 1362:
+case 1363:
+case 1364:
+case 1365:
+case 1366:
+case 1367:
+case 1368:
+case 1369:
+case 1370:
+case 1371:
+case 1372:
+case 1373:
+case 1374:
+case 1375:
+case 1376:
+case 1377:
+case 1378:
+case 1379:
+case 1380:
+case 1381:
+case 1382:
+case 1383:
+case 1384:
+case 1385:
+case 1386:
+case 1387:
+case 1388:
+case 1389:
+case 1390:
+case 1391:
+case 1392:
+case 1393:
+case 1394:
+case 1395:
+case 1396:
+case 1397:
+case 1398:
+case 1399:
+case 1400:
+case 1401:
+case 1402:
+case 1403:
+case 1404:
+case 1405:
+case 1406:
+case 1407:
+case 1408:
+case 1409:
+case 1410:
+case 1411:
+case 1412:
+case 1413:
+case 1414:
+case 1415:
+case 1416:
+case 1417:
+case 1418:
+case 1419:
+case 1420:
+case 1421:
+case 1422:
+case 1423:
+case 1424:
+case 1425:
+case 1426:
+case 1427:
+case 1428:
+case 1429:
+case 1430:
+case 1431:
+case 1432:
+case 1433:
+case 1434:
+case 1435:
+case 1436:
+case 1437:
+case 1438:
+case 1439:
+case 1440:
+case 1441:
+case 1442:
+case 1443:
+case 1444:
+case 1445:
+case 1446:
+case 1447:
+case 1448:
+case 1449:
+case 1450:
+case 1451:
+case 1452:
+case 1453:
+case 1454:
+case 1455:
+case 1456:
+case 1457:
+case 1458:
+case 1459:
+case 1460:
+case 1461:
+case 1462:
+case 1463:
+case 1464:
+case 1465:
+case 1466:
+case 1467:
+case 1468:
+case 1469:
+case 1470:
+case 1471:
+case 1472:
+case 1473:
+case 1474:
+case 1475:
+case 1476:
+case 1477:
+case 1478:
+case 1479:
+case 1480:
+case 1481:
+case 1482:
+case 1483:
+case 1484:
+case 1485:
+case 1486:
+case 1487:
+case 1488:
+case 1489:
+case 1490:
+case 1491:
+case 1492:
+case 1493:
+case 1494:
+case 1495:
+case 1496:
+case 1497:
+case 1498:
+case 1499:
+case 1500:
+case 1501:
+case 1502:
+case 1503:
+case 1504:
+case 1505:
+case 1506:
+case 1507:
+case 1508:
+case 1509:
+case 1510:
+case 1511:
+case 1512:
+case 1513:
+case 1514:
+case 1515:
+case 1516:
+case 1517:
+case 1518:
+case 1519:
+case 1520:
+case 1521:
+case 1522:
+case 1523:
+case 1524:
+case 1525:
+case 1526:
+case 1527:
+case 1528:
+case 1529:
+case 1530:
+case 1531:
+case 1532:
+case 1533:
+case 1534:
+case 1535:
+case 1536:
+case 1537:
+case 1538:
+case 1539:
+case 1540:
+case 1541:
+case 1542:
+case 1543:
+case 1544:
+case 1545:
+case 1546:
+case 1547:
+case 1548:
+case 1549:
+case 1550:
+case 1551:
+case 1552:
+case 1553:
+case 1554:
+case 1555:
+case 1556:
+case 1557:
+case 1558:
+case 1559:
+case 1560:
+case 1561:
+case 1562:
+case 1563:
+case 1564:
+case 1565:
+case 1566:
+case 1567:
+case 1568:
+case 1569:
+case 1570:
+case 1571:
+case 1572:
+case 1573:
+case 1574:
+case 1575:
+case 1576:
+case 1577:
+case 1578:
+case 1579:
+case 1580:
+case 1581:
+case 1582:
+case 1583:
+case 1584:
+case 1585:
+case 1586:
+case 1587:
+case 1588:
+case 1589:
+case 1590:
+case 1591:
+case 1592:
+case 1593:
+case 1594:
+case 1595:
+case 1596:
+case 1597:
+case 1598:
+case 1599:
+case 1600:
+case 1601:
+case 1602:
+case 1603:
+case 1604:
+case 1605:
+case 1606:
+case 1607:
+case 1608:
+case 1609:
+case 1610:
+case 1611:
+case 1612:
+case 1613:
+case 1614:
+case 1615:
+case 1616:
+case 1617:
+case 1618:
+case 1619:
+case 1620:
+case 1621:
+case 1622:
+case 1623:
+case 1624:
+case 1625:
+case 1626:
+case 1627:
+case 1628:
+case 1629:
+case 1630:
+case 1631:
+case 1632:
+case 1633:
+case 1634:
+case 1635:
+case 1636:
+case 1637:
+case 1638:
+case 1639:
+case 1640:
+case 1641:
+case 1642:
+case 1643:
+case 1644:
+case 1645:
+case 1646:
+case 1647:
+case 1648:
+case 1649:
+case 1650:
+case 1651:
+case 1652:
+case 1653:
+case 1654:
+case 1655:
+case 1656:
+case 1657:
+case 1658:
+case 1659:
+case 1660:
+case 1661:
+case 1662:
+case 1663:
+case 1664:
+case 1665:
+case 1666:
+case 1667:
+case 1668:
+case 1669:
+case 1670:
+case 1671:
+case 1672:
+case 1673:
+case 1674:
+case 1675:
+case 1676:
+case 1677:
+case 1678:
+case 1679:
+case 1680:
+case 1681:
+case 1682:
+case 1683:
+case 1684:
+case 1685:
+case 1686:
+case 1687:
+case 1688:
+case 1689:
+case 1690:
+case 1691:
+case 1692:
+case 1693:
+case 1694:
+case 1695:
+case 1696:
+case 1697:
+case 1698:
+case 1699:
+case 1700:
+case 1701:
+case 1702:
+case 1703:
+case 1704:
+case 1705:
+case 1706:
+case 1707:
+case 1708:
+case 1709:
+case 1710:
+case 1711:
+case 1712:
+case 1713:
+case 1714:
+case 1715:
+case 1716:
+case 1717:
+case 1718:
+case 1719:
+case 1720:
+case 1721:
+case 1722:
+case 1723:
+case 1724:
+case 1725:
+case 1726:
+case 1727:
+case 1728:
+case 1729:
+case 1730:
+case 1731:
+case 1732:
+case 1733:
+case 1734:
+case 1735:
+case 1736:
+case 1737:
+case 1738:
+case 1739:
+case 1740:
+case 1741:
+case 1742:
+case 1743:
+case 1744:
+case 1745:
+case 1746:
+case 1747:
+case 1748:
+case 1749:
+case 1750:
+case 1751:
+case 1752:
+case 1753:
+case 1754:
+case 1755:
+case 1756:
+case 1757:
+case 1758:
+case 1759:
+case 1760:
+case 1761:
+case 1762:
+case 1763:
+case 1764:
+case 1765:
+case 1766:
+case 1767:
+case 1768:
+case 1769:
+case 1770:
+case 1771:
+case 1772:
+case 1773:
+case 1774:
+case 1775:
+case 1776:
+case 1777:
+case 1778:
+case 1779:
+case 1780:
+case 1781:
+case 1782:
+case 1783:
+case 1784:
+case 1785:
+case 1786:
+case 1787:
+case 1788:
+case 1789:
+case 1790:
+case 1791:
+case 1792:
+case 1793:
+case 1794:
+case 1795:
+case 1796:
+case 1797:
+case 1798:
+case 1799:
+case 1800:
+case 1801:
+case 1802:
+case 1803:
+case 1804:
+case 1805:
+case 1806:
+case 1807:
+case 1808:
+case 1809:
+case 1810:
+case 1811:
+case 1812:
+case 1813:
+case 1814:
+case 1815:
+case 1816:
+case 1817:
+case 1818:
+case 1819:
+case 1820:
+case 1821:
+case 1822:
+case 1823:
+case 1824:
+case 1825:
+case 1826:
+case 1827:
+case 1828:
+case 1829:
+case 1830:
+case 1831:
+case 1832:
+case 1833:
+case 1834:
+case 1835:
+case 1836:
+case 1837:
+case 1838:
+case 1839:
+case 1840:
+case 1841:
+case 1842:
+case 1843:
+case 1844:
+case 1845:
+case 1846:
+case 1847:
+case 1848:
+case 1849:
+case 1850:
+case 1851:
+case 1852:
+case 1853:
+case 1854:
+case 1855:
+case 1856:
+case 1857:
+case 1858:
+case 1859:
+case 1860:
+case 1861:
+case 1862:
+case 1863:
+case 1864:
+case 1865:
+case 1866:
+case 1867:
+case 1868:
+case 1869:
+case 1870:
+case 1871:
+case 1872:
+case 1873:
+case 1874:
+case 1875:
+case 1876:
+case 1877:
+case 1878:
+case 1879:
+case 1880:
+case 1881:
+case 1882:
+case 1883:
+case 1884:
+case 1885:
+case 1886:
+case 1887:
+case 1888:
+case 1889:
+case 1890:
+case 1891:
+case 1892:
+case 1893:
+case 1894:
+case 1895:
+case 1896:
+case 1897:
+case 1898:
+case 1899:
+case 1900:
+case 1901:
+case 1902:
+case 1903:
+case 1904:
+case 1905:
+case 1906:
+case 1907:
+case 1908:
+case 1909:
+case 1910:
+case 1911:
+case 1912:
+case 1913:
+case 1914:
+case 1915:
+case 1916:
+case 1917:
+case 1918:
+case 1919:
+case 1920:
+case 1921:
+case 1922:
+case 1923:
+case 1924:
+case 1925:
+case 1926:
+case 1927:
+case 1928:
+case 1929:
+case 1930:
+case 1931:
+case 1932:
+case 1933:
+case 1934:
+case 1935:
+case 1936:
+case 1937:
+case 1938:
+case 1939:
+case 1940:
+case 1941:
+case 1942:
+case 1943:
+case 1944:
+case 1945:
+case 1946:
+case 1947:
+case 1948:
+case 1949:
+case 1950:
+case 1951:
+case 1952:
+case 1953:
+case 1954:
+case 1955:
+case 1956:
+case 1957:
+case 1958:
+case 1959:
+case 1960:
+case 1961:
+case 1962:
+case 1963:
+case 1964:
+case 1965:
+case 1966:
+case 1967:
+case 1968:
+case 1969:
+case 1970:
+case 1971:
+case 1972:
+case 1973:
+case 1974:
+case 1975:
+case 1976:
+case 1977:
+case 1978:
+case 1979:
+case 1980:
+case 1981:
+case 1982:
+case 1983:
+case 1984:
+case 1985:
+case 1986:
+case 1987:
+case 1988:
+case 1989:
+case 1990:
+case 1991:
+case 1992:
+case 1993:
+case 1994:
+case 1995:
+case 1996:
+case 1997:
+case 1998:
+case 1999:
+case 2000:
+case 2001:
+case 2002:
+case 2003:
+case 2004:
+case 2005:
+case 2006:
+case 2007:
+case 2008:
+case 2009:
+case 2010:
+case 2011:
+case 2012:
+case 2013:
+case 2014:
+case 2015:
+case 2016:
+case 2017:
+case 2018:
+case 2019:
+case 2020:
+case 2021:
+case 2022:
+case 2023:
+case 2024:
+case 2025:
+case 2026:
+case 2027:
+case 2028:
+case 2029:
+case 2030:
+case 2031:
+case 2032:
+case 2033:
+case 2034:
+case 2035:
+case 2036:
+case 2037:
+case 2038:
+case 2039:
+case 2040:
+case 2041:
+case 2042:
+case 2043:
+case 2044:
+case 2045:
+case 2046:
+case 2047:
+case 2048:
+case 2049:
+case 2050:
+case 2051:
+case 2052:
+case 2053:
+case 2054:
+case 2055:
+case 2056:
+case 2057:
+case 2058:
+case 2059:
+case 2060:
+case 2061:
+case 2062:
+case 2063:
+case 2064:
+case 2065:
+case 2066:
+case 2067:
+case 2068:
+case 2069:
+case 2070:
+case 2071:
+case 2072:
+case 2073:
+case 2074:
+case 2075:
+case 2076:
+case 2077:
+case 2078:
+case 2079:
+case 2080:
+case 2081:
+case 2082:
+case 2083:
+case 2084:
+case 2085:
+case 2086:
+case 2087:
+case 2088:
+case 2089:
+case 2090:
+case 2091:
+case 2092:
+case 2093:
+case 2094:
+case 2095:
+case 2096:
+case 2097:
+case 2098:
+case 2099:
+case 2100:
+case 2101:
+case 2102:
+case 2103:
+case 2104:
+case 2105:
+case 2106:
+case 2107:
+case 2108:
+case 2109:
+case 2110:
+case 2111:
+case 2112:
+case 2113:
+case 2114:
+case 2115:
+case 2116:
+case 2117:
+case 2118:
+case 2119:
+case 2120:
+case 2121:
+case 2122:
+case 2123:
+case 2124:
+case 2125:
+case 2126:
+case 2127:
+case 2128:
+case 2129:
+case 2130:
+case 2131:
+case 2132:
+case 2133:
+case 2134:
+case 2135:
+case 2136:
+case 2137:
+case 2138:
+case 2139:
+case 2140:
+case 2141:
+case 2142:
+case 2143:
+case 2144:
+case 2145:
+case 2146:
+case 2147:
+case 2148:
+case 2149:
+case 2150:
+case 2151:
+case 2152:
+case 2153:
+case 2154:
+case 2155:
+case 2156:
+case 2157:
+case 2158:
+case 2159:
+case 2160:
+case 2161:
+case 2162:
+case 2163:
+case 2164:
+case 2165:
+case 2166:
+case 2167:
+case 2168:
+case 2169:
+case 2170:
+case 2171:
+case 2172:
+case 2173:
+case 2174:
+case 2175:
+case 2176:
+case 2177:
+case 2178:
+case 2179:
+case 2180:
+case 2181:
+case 2182:
+case 2183:
+case 2184:
+case 2185:
+case 2186:
+case 2187:
+case 2188:
+case 2189:
+case 2190:
+case 2191:
+case 2192:
+case 2193:
+case 2194:
+case 2195:
+case 2196:
+case 2197:
+case 2198:
+case 2199:
+case 2200:
+case 2201:
+case 2202:
+case 2203:
+case 2204:
+case 2205:
+case 2206:
+case 2207:
+case 2208:
+case 2209:
+case 2210:
+case 2211:
+case 2212:
+case 2213:
+case 2214:
+case 2215:
+case 2216:
+case 2217:
+case 2218:
+case 2219:
+case 2220:
+case 2221:
+case 2222:
+case 2223:
+case 2224:
+case 2225:
+case 2226:
+case 2227:
+case 2228:
+case 2229:
+case 2230:
+case 2231:
+case 2232:
+case 2233:
+case 2234:
+case 2235:
+case 2236:
+case 2237:
+case 2238:
+case 2239:
+case 2240:
+case 2241:
+case 2242:
+case 2243:
+case 2244:
+case 2245:
+case 2246:
+case 2247:
+case 2248:
+case 2249:
+case 2250:
+case 2251:
+case 2252:
+case 2253:
+case 2254:
+case 2255:
+case 2256:
+case 2257:
+case 2258:
+case 2259:
+case 2260:
+case 2261:
+case 2262:
+case 2263:
+case 2264:
+case 2265:
+case 2266:
+case 2267:
+case 2268:
+case 2269:
+case 2270:
+case 2271:
+case 2272:
+case 2273:
+case 2274:
+case 2275:
+case 2276:
+case 2277:
+case 2278:
+case 2279:
+case 2280:
+case 2281:
+case 2282:
+case 2283:
+case 2284:
+case 2285:
+case 2286:
+case 2287:
+case 2288:
+case 2289:
+case 2290:
+case 2291:
+case 2292:
+case 2293:
+case 2294:
+case 2295:
+case 2296:
+case 2297:
+case 2298:
+case 2299:
+case 2300:
+case 2301:
+case 2302:
+case 2303:
+case 2304:
+case 2305:
+case 2306:
+case 2307:
+case 2308:
+case 2309:
+case 2310:
+case 2311:
+case 2312:
+case 2313:
+case 2314:
+case 2315:
+case 2316:
+case 2317:
+case 2318:
+case 2319:
+case 2320:
+case 2321:
+case 2322:
+case 2323:
+case 2324:
+case 2325:
+case 2326:
+case 2327:
+case 2328:
+case 2329:
+case 2330:
+case 2331:
+case 2332:
+case 2333:
+case 2334:
+case 2335:
+case 2336:
+case 2337:
+case 2338:
+case 2339:
+case 2340:
+case 2341:
+case 2342:
+case 2343:
+case 2344:
+case 2345:
+case 2346:
+case 2347:
+case 2348:
+case 2349:
+case 2350:
+case 2351:
+case 2352:
+case 2353:
+case 2354:
+case 2355:
+case 2356:
+case 2357:
+case 2358:
+case 2359:
+case 2360:
+case 2361:
+case 2362:
+case 2363:
+case 2364:
+case 2365:
+case 2366:
+case 2367:
+case 2368:
+case 2369:
+case 2370:
+case 2371:
+case 2372:
+case 2373:
+case 2374:
+case 2375:
+case 2376:
+case 2377:
+case 2378:
+case 2379:
+case 2380:
+case 2381:
+case 2382:
+case 2383:
+case 2384:
+case 2385:
+case 2386:
+case 2387:
+case 2388:
+case 2389:
+case 2390:
+case 2391:
+case 2392:
+case 2393:
+case 2394:
+case 2395:
+case 2396:
+case 2397:
+case 2398:
+case 2399:
+case 2400:
+case 2401:
+case 2402:
+case 2403:
+case 2404:
+case 2405:
+case 2406:
+case 2407:
+case 2408:
+case 2409:
+case 2410:
+case 2411:
+case 2412:
+case 2413:
+case 2414:
+case 2415:
+case 2416:
+case 2417:
+case 2418:
+case 2419:
+case 2420:
+case 2421:
+case 2422:
+case 2423:
+case 2424:
+case 2425:
+case 2426:
+case 2427:
+case 2428:
+case 2429:
+case 2430:
+case 2431:
+case 2432:
+case 2433:
+case 2434:
+case 2435:
+case 2436:
+case 2437:
+case 2438:
+case 2439:
+case 2440:
+case 2441:
+case 2442:
+case 2443:
+case 2444:
+case 2445:
+case 2446:
+case 2447:
+case 2448:
+case 2449:
+case 2450:
+case 2451:
+case 2452:
+case 2453:
+case 2454:
+case 2455:
+case 2456:
+case 2457:
+case 2458:
+case 2459:
+case 2460:
+case 2461:
+case 2462:
+case 2463:
+case 2464:
+case 2465:
+case 2466:
+case 2467:
+case 2468:
+case 2469:
+case 2470:
+case 2471:
+case 2472:
+case 2473:
+case 2474:
+case 2475:
+case 2476:
+case 2477:
+case 2478:
+case 2479:
+case 2480:
+case 2481:
+case 2482:
+case 2483:
+case 2484:
+case 2485:
+case 2486:
+case 2487:
+case 2488:
+case 2489:
+case 2490:
+case 2491:
+case 2492:
+case 2493:
+case 2494:
+case 2495:
+case 2496:
+case 2497:
+case 2498:
+case 2499:
+case 2500:
+case 2501:
+case 2502:
+case 2503:
+case 2504:
+case 2505:
+case 2506:
+case 2507:
+case 2508:
+case 2509:
+case 2510:
+case 2511:
+case 2512:
+case 2513:
+case 2514:
+case 2515:
+case 2516:
+case 2517:
+case 2518:
+case 2519:
+case 2520:
+case 2521:
+case 2522:
+case 2523:
+case 2524:
+case 2525:
+case 2526:
+case 2527:
+case 2528:
+case 2529:
+case 2530:
+case 2531:
+case 2532:
+case 2533:
+case 2534:
+case 2535:
+case 2536:
+case 2537:
+case 2538:
+case 2539:
+case 2540:
+case 2541:
+case 2542:
+case 2543:
+case 2544:
+case 2545:
+case 2546:
+case 2547:
+case 2548:
+case 2549:
+case 2550:
+case 2551:
+case 2552:
+case 2553:
+case 2554:
+case 2555:
+case 2556:
+case 2557:
+case 2558:
+case 2559:
+case 2560:
+case 2561:
+case 2562:
+case 2563:
+case 2564:
+case 2565:
+case 2566:
+case 2567:
+case 2568:
+case 2569:
+case 2570:
+case 2571:
+case 2572:
+case 2573:
+case 2574:
+case 2575:
+case 2576:
+case 2577:
+case 2578:
+case 2579:
+case 2580:
+case 2581:
+case 2582:
+case 2583:
+case 2584:
+case 2585:
+case 2586:
+case 2587:
+case 2588:
+case 2589:
+case 2590:
+case 2591:
+case 2592:
+case 2593:
+case 2594:
+case 2595:
+case 2596:
+case 2597:
+case 2598:
+case 2599:
+case 2600:
+case 2601:
+case 2602:
+case 2603:
+case 2604:
+case 2605:
+case 2606:
+case 2607:
+case 2608:
+case 2609:
+case 2610:
+case 2611:
+case 2612:
+case 2613:
+case 2614:
+case 2615:
+case 2616:
+case 2617:
+case 2618:
+case 2619:
+case 2620:
+case 2621:
+case 2622:
+case 2623:
+case 2624:
+case 2625:
+case 2626:
+case 2627:
+case 2628:
+case 2629:
+case 2630:
+case 2631:
+case 2632:
+case 2633:
+case 2634:
+case 2635:
+case 2636:
+case 2637:
+case 2638:
+case 2639:
+case 2640:
+case 2641:
+case 2642:
+case 2643:
+case 2644:
+case 2645:
+case 2646:
+case 2647:
+case 2648:
+case 2649:
+case 2650:
+case 2651:
+case 2652:
+case 2653:
+case 2654:
+case 2655:
+case 2656:
+case 2657:
+case 2658:
+case 2659:
+case 2660:
+case 2661:
+case 2662:
+case 2663:
+case 2664:
+case 2665:
+case 2666:
+case 2667:
+case 2668:
+case 2669:
+case 2670:
+case 2671:
+case 2672:
+case 2673:
+case 2674:
+case 2675:
+case 2676:
+case 2677:
+case 2678:
+case 2679:
+case 2680:
+case 2681:
+case 2682:
+case 2683:
+case 2684:
+case 2685:
+case 2686:
+case 2687:
+case 2688:
+case 2689:
+case 2690:
+case 2691:
+case 2692:
+case 2693:
+case 2694:
+case 2695:
+case 2696:
+case 2697:
+case 2698:
+case 2699:
+case 2700:
+case 2701:
+case 2702:
+case 2703:
+case 2704:
+case 2705:
+case 2706:
+case 2707:
+case 2708:
+case 2709:
+case 2710:
+case 2711:
+case 2712:
+case 2713:
+case 2714:
+case 2715:
+case 2716:
+case 2717:
+case 2718:
+case 2719:
+case 2720:
+case 2721:
+case 2722:
+case 2723:
+case 2724:
+case 2725:
+case 2726:
+case 2727:
+case 2728:
+case 2729:
+case 2730:
+case 2731:
+case 2732:
+case 2733:
+case 2734:
+case 2735:
+case 2736:
+case 2737:
+case 2738:
+case 2739:
+case 2740:
+case 2741:
+case 2742:
+case 2743:
+case 2744:
+case 2745:
+case 2746:
+case 2747:
+case 2748:
+case 2749:
+case 2750:
+case 2751:
+case 2752:
+case 2753:
+case 2754:
+case 2755:
+case 2756:
+case 2757:
+case 2758:
+case 2759:
+case 2760:
+case 2761:
+case 2762:
+case 2763:
+case 2764:
+case 2765:
+case 2766:
+case 2767:
+case 2768:
+case 2769:
+case 2770:
+case 2771:
+case 2772:
+case 2773:
+case 2774:
+case 2775:
+case 2776:
+case 2777:
+case 2778:
+case 2779:
+case 2780:
+case 2781:
+case 2782:
+case 2783:
+case 2784:
+case 2785:
+case 2786:
+case 2787:
+case 2788:
+case 2789:
+case 2790:
+case 2791:
+case 2792:
+case 2793:
+case 2794:
+case 2795:
+case 2796:
+case 2797:
+case 2798:
+case 2799:
+case 2800:
+case 2801:
+case 2802:
+case 2803:
+case 2804:
+case 2805:
+case 2806:
+case 2807:
+case 2808:
+case 2809:
+case 2810:
+case 2811:
+case 2812:
+case 2813:
+case 2814:
+case 2815:
+case 2816:
+case 2817:
+case 2818:
+case 2819:
+case 2820:
+case 2821:
+case 2822:
+case 2823:
+case 2824:
+case 2825:
+case 2826:
+case 2827:
+case 2828:
+case 2829:
+case 2830:
+case 2831:
+case 2832:
+case 2833:
+case 2834:
+case 2835:
+case 2836:
+case 2837:
+case 2838:
+case 2839:
+case 2840:
+case 2841:
+case 2842:
+case 2843:
+case 2844:
+case 2845:
+case 2846:
+case 2847:
+case 2848:
+case 2849:
+case 2850:
+case 2851:
+case 2852:
+case 2853:
+case 2854:
+case 2855:
+case 2856:
+case 2857:
+case 2858:
+case 2859:
+case 2860:
+case 2861:
+case 2862:
+case 2863:
+case 2864:
+case 2865:
+case 2866:
+case 2867:
+case 2868:
+case 2869:
+case 2870:
+case 2871:
+case 2872:
+case 2873:
+case 2874:
+case 2875:
+case 2876:
+case 2877:
+case 2878:
+case 2879:
+case 2880:
+case 2881:
+case 2882:
+case 2883:
+case 2884:
+case 2885:
+case 2886:
+case 2887:
+case 2888:
+case 2889:
+case 2890:
+case 2891:
+case 2892:
+case 2893:
+case 2894:
+case 2895:
+case 2896:
+case 2897:
+case 2898:
+case 2899:
+case 2900:
+case 2901:
+case 2902:
+case 2903:
+case 2904:
+case 2905:
+case 2906:
+case 2907:
+case 2908:
+case 2909:
+case 2910:
+case 2911:
+case 2912:
+case 2913:
+case 2914:
+case 2915:
+case 2916:
+case 2917:
+case 2918:
+case 2919:
+case 2920:
+case 2921:
+case 2922:
+case 2923:
+case 2924:
+case 2925:
+case 2926:
+case 2927:
+case 2928:
+case 2929:
+case 2930:
+case 2931:
+case 2932:
+case 2933:
+case 2934:
+case 2935:
+case 2936:
+case 2937:
+case 2938:
+case 2939:
+case 2940:
+case 2941:
+case 2942:
+case 2943:
+case 2944:
+case 2945:
+case 2946:
+case 2947:
+case 2948:
+case 2949:
+case 2950:
+case 2951:
+case 2952:
+case 2953:
+case 2954:
+case 2955:
+case 2956:
+case 2957:
+case 2958:
+case 2959:
+case 2960:
+case 2961:
+case 2962:
+case 2963:
+case 2964:
+case 2965:
+case 2966:
+case 2967:
+case 2968:
+case 2969:
+case 2970:
+case 2971:
+case 2972:
+case 2973:
+case 2974:
+case 2975:
+case 2976:
+case 2977:
+case 2978:
+case 2979:
+case 2980:
+case 2981:
+case 2982:
+case 2983:
+case 2984:
+case 2985:
+case 2986:
+case 2987:
+case 2988:
+case 2989:
+case 2990:
+case 2991:
+case 2992:
+case 2993:
+case 2994:
+case 2995:
+case 2996:
+case 2997:
+case 2998:
+case 2999:
+case 3000:
+case 3001:
+case 3002:
+case 3003:
+case 3004:
+case 3005:
+case 3006:
+case 3007:
+case 3008:
+case 3009:
+case 3010:
+case 3011:
+case 3012:
+case 3013:
+case 3014:
+case 3015:
+case 3016:
+case 3017:
+case 3018:
+case 3019:
+case 3020:
+case 3021:
+case 3022:
+case 3023:
+case 3024:
+case 3025:
+case 3026:
+case 3027:
+case 3028:
+case 3029:
+case 3030:
+case 3031:
+case 3032:
+case 3033:
+case 3034:
+case 3035:
+case 3036:
+case 3037:
+case 3038:
+case 3039:
+case 3040:
+case 3041:
+case 3042:
+case 3043:
+case 3044:
+case 3045:
+case 3046:
+case 3047:
+case 3048:
+case 3049:
+case 3050:
+case 3051:
+case 3052:
+case 3053:
+case 3054:
+case 3055:
+case 3056:
+case 3057:
+case 3058:
+case 3059:
+case 3060:
+case 3061:
+case 3062:
+case 3063:
+case 3064:
+case 3065:
+case 3066:
+case 3067:
+case 3068:
+case 3069:
+case 3070:
+case 3071:
+case 3072:
+case 3073:
+case 3074:
+case 3075:
+case 3076:
+case 3077:
+case 3078:
+case 3079:
+case 3080:
+case 3081:
+case 3082:
+case 3083:
+case 3084:
+case 3085:
+case 3086:
+case 3087:
+case 3088:
+case 3089:
+case 3090:
+case 3091:
+case 3092:
+case 3093:
+case 3094:
+case 3095:
+case 3096:
+case 3097:
+case 3098:
+case 3099:
+case 3100:
+case 3101:
+case 3102:
+case 3103:
+case 3104:
+case 3105:
+case 3106:
+case 3107:
+case 3108:
+case 3109:
+case 3110:
+case 3111:
+case 3112:
+case 3113:
+case 3114:
+case 3115:
+case 3116:
+case 3117:
+case 3118:
+case 3119:
+case 3120:
+case 3121:
+case 3122:
+case 3123:
+case 3124:
+case 3125:
+case 3126:
+case 3127:
+case 3128:
+case 3129:
+case 3130:
+case 3131:
+case 3132:
+case 3133:
+case 3134:
+case 3135:
+case 3136:
+case 3137:
+case 3138:
+case 3139:
+case 3140:
+case 3141:
+case 3142:
+case 3143:
+case 3144:
+case 3145:
+case 3146:
+case 3147:
+case 3148:
+case 3149:
+case 3150:
+case 3151:
+case 3152:
+case 3153:
+case 3154:
+case 3155:
+case 3156:
+case 3157:
+case 3158:
+case 3159:
+case 3160:
+case 3161:
+case 3162:
+case 3163:
+case 3164:
+case 3165:
+case 3166:
+case 3167:
+case 3168:
+case 3169:
+case 3170:
+case 3171:
+case 3172:
+case 3173:
+case 3174:
+case 3175:
+case 3176:
+case 3177:
+case 3178:
+case 3179:
+case 3180:
+case 3181:
+case 3182:
+case 3183:
+case 3184:
+case 3185:
+case 3186:
+case 3187:
+case 3188:
+case 3189:
+case 3190:
+case 3191:
+case 3192:
+case 3193:
+case 3194:
+case 3195:
+case 3196:
+case 3197:
+case 3198:
+case 3199:
+case 3200:
+case 3201:
+case 3202:
+case 3203:
+case 3204:
+case 3205:
+case 3206:
+case 3207:
+case 3208:
+case 3209:
+case 3210:
+case 3211:
+case 3212:
+case 3213:
+case 3214:
+case 3215:
+case 3216:
+case 3217:
+case 3218:
+case 3219:
+case 3220:
+case 3221:
+case 3222:
+case 3223:
+case 3224:
+case 3225:
+case 3226:
+case 3227:
+case 3228:
+case 3229:
+case 3230:
+case 3231:
+case 3232:
+case 3233:
+case 3234:
+case 3235:
+case 3236:
+case 3237:
+case 3238:
+case 3239:
+case 3240:
+case 3241:
+case 3242:
+case 3243:
+case 3244:
+case 3245:
+case 3246:
+case 3247:
+case 3248:
+case 3249:
+case 3250:
+case 3251:
+case 3252:
+case 3253:
+case 3254:
+case 3255:
+case 3256:
+case 3257:
+case 3258:
+case 3259:
+case 3260:
+case 3261:
+case 3262:
+case 3263:
+case 3264:
+case 3265:
+case 3266:
+case 3267:
+case 3268:
+case 3269:
+case 3270:
+case 3271:
+case 3272:
+case 3273:
+case 3274:
+case 3275:
+case 3276:
+case 3277:
+case 3278:
+case 3279:
+case 3280:
+case 3281:
+case 3282:
+case 3283:
+case 3284:
+case 3285:
+case 3286:
+case 3287:
+case 3288:
+case 3289:
+case 3290:
+case 3291:
+case 3292:
+case 3293:
+case 3294:
+case 3295:
+case 3296:
+case 3297:
+case 3298:
+case 3299:
+case 3300:
+case 3301:
+case 3302:
+case 3303:
+case 3304:
+case 3305:
+case 3306:
+case 3307:
+case 3308:
+case 3309:
+case 3310:
+case 3311:
+case 3312:
+case 3313:
+case 3314:
+case 3315:
+case 3316:
+case 3317:
+case 3318:
+case 3319:
+case 3320:
+case 3321:
+case 3322:
+case 3323:
+case 3324:
+case 3325:
+case 3326:
+case 3327:
+case 3328:
+case 3329:
+case 3330:
+case 3331:
+case 3332:
+case 3333:
+case 3334:
+case 3335:
+case 3336:
+case 3337:
+case 3338:
+case 3339:
+case 3340:
+case 3341:
+case 3342:
+case 3343:
+case 3344:
+case 3345:
+case 3346:
+case 3347:
+case 3348:
+case 3349:
+case 3350:
+case 3351:
+case 3352:
+case 3353:
+case 3354:
+case 3355:
+case 3356:
+case 3357:
+case 3358:
+case 3359:
+case 3360:
+case 3361:
+case 3362:
+case 3363:
+case 3364:
+case 3365:
+case 3366:
+case 3367:
+case 3368:
+case 3369:
+case 3370:
+case 3371:
+case 3372:
+case 3373:
+case 3374:
+case 3375:
+case 3376:
+case 3377:
+case 3378:
+case 3379:
+case 3380:
+case 3381:
+case 3382:
+case 3383:
+case 3384:
+case 3385:
+case 3386:
+case 3387:
+case 3388:
+case 3389:
+case 3390:
+case 3391:
+case 3392:
+case 3393:
+case 3394:
+case 3395:
+case 3396:
+case 3397:
+case 3398:
+case 3399:
+case 3400:
+case 3401:
+case 3402:
+case 3403:
+case 3404:
+case 3405:
+case 3406:
+case 3407:
+case 3408:
+case 3409:
+case 3410:
+case 3411:
+case 3412:
+case 3413:
+case 3414:
+case 3415:
+case 3416:
+case 3417:
+case 3418:
+case 3419:
+case 3420:
+case 3421:
+case 3422:
+case 3423:
+case 3424:
+case 3425:
+case 3426:
+case 3427:
+case 3428:
+case 3429:
+case 3430:
+case 3431:
+case 3432:
+case 3433:
+case 3434:
+case 3435:
+case 3436:
+case 3437:
+case 3438:
+case 3439:
+case 3440:
+case 3441:
+case 3442:
+case 3443:
+case 3444:
+case 3445:
+case 3446:
+case 3447:
+case 3448:
+case 3449:
+case 3450:
+case 3451:
+case 3452:
+case 3453:
+case 3454:
+case 3455:
+case 3456:
+case 3457:
+case 3458:
+case 3459:
+case 3460:
+case 3461:
+case 3462:
+case 3463:
+case 3464:
+case 3465:
+case 3466:
+case 3467:
+case 3468:
+case 3469:
+case 3470:
+case 3471:
+case 3472:
+case 3473:
+case 3474:
+case 3475:
+case 3476:
+case 3477:
+case 3478:
+case 3479:
+case 3480:
+case 3481:
+case 3482:
+case 3483:
+case 3484:
+case 3485:
+case 3486:
+case 3487:
+case 3488:
+case 3489:
+case 3490:
+case 3491:
+case 3492:
+case 3493:
+case 3494:
+case 3495:
+case 3496:
+case 3497:
+case 3498:
+case 3499:
+case 3500:
+case 3501:
+case 3502:
+case 3503:
+case 3504:
+case 3505:
+case 3506:
+case 3507:
+case 3508:
+case 3509:
+case 3510:
+case 3511:
+case 3512:
+case 3513:
+case 3514:
+case 3515:
+case 3516:
+case 3517:
+case 3518:
+case 3519:
+case 3520:
+case 3521:
+case 3522:
+case 3523:
+case 3524:
+case 3525:
+case 3526:
+case 3527:
+case 3528:
+case 3529:
+case 3530:
+case 3531:
+case 3532:
+case 3533:
+case 3534:
+case 3535:
+case 3536:
+case 3537:
+case 3538:
+case 3539:
+case 3540:
+case 3541:
+case 3542:
+case 3543:
+case 3544:
+case 3545:
+case 3546:
+case 3547:
+case 3548:
+case 3549:
+case 3550:
+case 3551:
+case 3552:
+case 3553:
+case 3554:
+case 3555:
+case 3556:
+case 3557:
+case 3558:
+case 3559:
+case 3560:
+case 3561:
+case 3562:
+case 3563:
+case 3564:
+case 3565:
+case 3566:
+case 3567:
+case 3568:
+case 3569:
+case 3570:
+case 3571:
+case 3572:
+case 3573:
+case 3574:
+case 3575:
+case 3576:
+case 3577:
+case 3578:
+case 3579:
+case 3580:
+case 3581:
+case 3582:
+case 3583:
+case 3584:
+case 3585:
+case 3586:
+case 3587:
+case 3588:
+case 3589:
+case 3590:
+case 3591:
+case 3592:
+case 3593:
+case 3594:
+case 3595:
+case 3596:
+case 3597:
+case 3598:
+case 3599:
+case 3600:
+case 3601:
+case 3602:
+case 3603:
+case 3604:
+case 3605:
+case 3606:
+case 3607:
+case 3608:
+case 3609:
+case 3610:
+case 3611:
+case 3612:
+case 3613:
+case 3614:
+case 3615:
+case 3616:
+case 3617:
+case 3618:
+case 3619:
+case 3620:
+case 3621:
+case 3622:
+case 3623:
+case 3624:
+case 3625:
+case 3626:
+case 3627:
+case 3628:
+case 3629:
+case 3630:
+case 3631:
+case 3632:
+case 3633:
+case 3634:
+case 3635:
+case 3636:
+case 3637:
+case 3638:
+case 3639:
+case 3640:
+case 3641:
+case 3642:
+case 3643:
+case 3644:
+case 3645:
+case 3646:
+case 3647:
+case 3648:
+case 3649:
+case 3650:
+case 3651:
+case 3652:
+case 3653:
+case 3654:
+case 3655:
+case 3656:
+case 3657:
+case 3658:
+case 3659:
+case 3660:
+case 3661:
+case 3662:
+case 3663:
+case 3664:
+case 3665:
+case 3666:
+case 3667:
+case 3668:
+case 3669:
+case 3670:
+case 3671:
+case 3672:
+case 3673:
+case 3674:
+case 3675:
+case 3676:
+case 3677:
+case 3678:
+case 3679:
+case 3680:
+case 3681:
+case 3682:
+case 3683:
+case 3684:
+case 3685:
+case 3686:
+case 3687:
+case 3688:
+case 3689:
+case 3690:
+case 3691:
+case 3692:
+case 3693:
+case 3694:
+case 3695:
+case 3696:
+case 3697:
+case 3698:
+case 3699:
+case 3700:
+case 3701:
+case 3702:
+case 3703:
+case 3704:
+case 3705:
+case 3706:
+case 3707:
+case 3708:
+case 3709:
+case 3710:
+case 3711:
+case 3712:
+case 3713:
+case 3714:
+case 3715:
+case 3716:
+case 3717:
+case 3718:
+case 3719:
+case 3720:
+case 3721:
+case 3722:
+case 3723:
+case 3724:
+case 3725:
+case 3726:
+case 3727:
+case 3728:
+case 3729:
+case 3730:
+case 3731:
+case 3732:
+case 3733:
+case 3734:
+case 3735:
+case 3736:
+case 3737:
+case 3738:
+case 3739:
+case 3740:
+case 3741:
+case 3742:
+case 3743:
+case 3744:
+case 3745:
+case 3746:
+case 3747:
+case 3748:
+case 3749:
+case 3750:
+case 3751:
+case 3752:
+case 3753:
+case 3754:
+case 3755:
+case 3756:
+case 3757:
+case 3758:
+case 3759:
+case 3760:
+case 3761:
+case 3762:
+case 3763:
+case 3764:
+case 3765:
+case 3766:
+case 3767:
+case 3768:
+case 3769:
+case 3770:
+case 3771:
+case 3772:
+case 3773:
+case 3774:
+case 3775:
+case 3776:
+case 3777:
+case 3778:
+case 3779:
+case 3780:
+case 3781:
+case 3782:
+case 3783:
+case 3784:
+case 3785:
+case 3786:
+case 3787:
+case 3788:
+case 3789:
+case 3790:
+case 3791:
+case 3792:
+case 3793:
+case 3794:
+case 3795:
+case 3796:
+case 3797:
+case 3798:
+case 3799:
+case 3800:
+case 3801:
+case 3802:
+case 3803:
+case 3804:
+case 3805:
+case 3806:
+case 3807:
+case 3808:
+case 3809:
+case 3810:
+case 3811:
+case 3812:
+case 3813:
+case 3814:
+case 3815:
+case 3816:
+case 3817:
+case 3818:
+case 3819:
+case 3820:
+case 3821:
+case 3822:
+case 3823:
+case 3824:
+case 3825:
+case 3826:
+case 3827:
+case 3828:
+case 3829:
+case 3830:
+case 3831:
+case 3832:
+case 3833:
+case 3834:
+case 3835:
+case 3836:
+case 3837:
+case 3838:
+case 3839:
+case 3840:
+case 3841:
+case 3842:
+case 3843:
+case 3844:
+case 3845:
+case 3846:
+case 3847:
+case 3848:
+case 3849:
+case 3850:
+case 3851:
+case 3852:
+case 3853:
+case 3854:
+case 3855:
+case 3856:
+case 3857:
+case 3858:
+case 3859:
+case 3860:
+case 3861:
+case 3862:
+case 3863:
+case 3864:
+case 3865:
+case 3866:
+case 3867:
+case 3868:
+case 3869:
+case 3870:
+case 3871:
+case 3872:
+case 3873:
+case 3874:
+case 3875:
+case 3876:
+case 3877:
+case 3878:
+case 3879:
+case 3880:
+case 3881:
+case 3882:
+case 3883:
+case 3884:
+case 3885:
+case 3886:
+case 3887:
+case 3888:
+case 3889:
+case 3890:
+case 3891:
+case 3892:
+case 3893:
+case 3894:
+case 3895:
+case 3896:
+case 3897:
+case 3898:
+case 3899:
+case 3900:
+case 3901:
+case 3902:
+case 3903:
+case 3904:
+case 3905:
+case 3906:
+case 3907:
+case 3908:
+case 3909:
+case 3910:
+case 3911:
+case 3912:
+case 3913:
+case 3914:
+case 3915:
+case 3916:
+case 3917:
+case 3918:
+case 3919:
+case 3920:
+case 3921:
+case 3922:
+case 3923:
+case 3924:
+case 3925:
+case 3926:
+case 3927:
+case 3928:
+case 3929:
+case 3930:
+case 3931:
+case 3932:
+case 3933:
+case 3934:
+case 3935:
+case 3936:
+case 3937:
+case 3938:
+case 3939:
+case 3940:
+case 3941:
+case 3942:
+case 3943:
+case 3944:
+case 3945:
+case 3946:
+case 3947:
+case 3948:
+case 3949:
+case 3950:
+case 3951:
+case 3952:
+case 3953:
+case 3954:
+case 3955:
+case 3956:
+case 3957:
+case 3958:
+case 3959:
+case 3960:
+case 3961:
+case 3962:
+case 3963:
+case 3964:
+case 3965:
+case 3966:
+case 3967:
+case 3968:
+case 3969:
+case 3970:
+case 3971:
+case 3972:
+case 3973:
+case 3974:
+case 3975:
+case 3976:
+case 3977:
+case 3978:
+case 3979:
+case 3980:
+case 3981:
+case 3982:
+case 3983:
+case 3984:
+case 3985:
+case 3986:
+case 3987:
+case 3988:
+case 3989:
+case 3990:
+case 3991:
+case 3992:
+case 3993:
+case 3994:
+case 3995:
+case 3996:
+case 3997:
+case 3998:
+case 3999:
+case 4000:
+case 4001:
+case 4002:
+case 4003:
+case 4004:
+case 4005:
+case 4006:
+case 4007:
+case 4008:
+case 4009:
+case 4010:
+case 4011:
+case 4012:
+case 4013:
+case 4014:
+case 4015:
+case 4016:
+case 4017:
+case 4018:
+case 4019:
+case 4020:
+case 4021:
+case 4022:
+case 4023:
+case 4024:
+case 4025:
+case 4026:
+case 4027:
+case 4028:
+case 4029:
+case 4030:
+case 4031:
+case 4032:
+case 4033:
+case 4034:
+case 4035:
+case 4036:
+case 4037:
+case 4038:
+case 4039:
+case 4040:
+case 4041:
+case 4042:
+case 4043:
+case 4044:
+case 4045:
+case 4046:
+case 4047:
+case 4048:
+case 4049:
+case 4050:
+case 4051:
+case 4052:
+case 4053:
+case 4054:
+case 4055:
+case 4056:
+case 4057:
+case 4058:
+case 4059:
+case 4060:
+case 4061:
+case 4062:
+case 4063:
+case 4064:
+case 4065:
+case 4066:
+case 4067:
+case 4068:
+case 4069:
+case 4070:
+case 4071:
+case 4072:
+case 4073:
+case 4074:
+case 4075:
+case 4076:
+case 4077:
+case 4078:
+case 4079:
+case 4080:
+case 4081:
+case 4082:
+case 4083:
+case 4084:
+case 4085:
+case 4086:
+case 4087:
+case 4088:
+case 4089:
+case 4090:
+case 4091:
+case 4092:
+case 4093:
+case 4094:
+case 4095:
+case 4096:
+case 4097:
+case 4098:
+case 4099:
+case 4100:
+case 4101:
+case 4102:
+case 4103:
+case 4104:
+case 4105:
+case 4106:
+case 4107:
+case 4108:
+case 4109:
+case 4110:
+case 4111:
+case 4112:
+case 4113:
+case 4114:
+case 4115:
+case 4116:
+case 4117:
+case 4118:
+case 4119:
+case 4120:
+case 4121:
+case 4122:
+case 4123:
+case 4124:
+case 4125:
+case 4126:
+case 4127:
+case 4128:
+case 4129:
+case 4130:
+case 4131:
+case 4132:
+case 4133:
+case 4134:
+case 4135:
+case 4136:
+case 4137:
+case 4138:
+case 4139:
+case 4140:
+case 4141:
+case 4142:
+case 4143:
+case 4144:
+case 4145:
+case 4146:
+case 4147:
+case 4148:
+case 4149:
+case 4150:
+case 4151:
+case 4152:
+case 4153:
+case 4154:
+case 4155:
+case 4156:
+case 4157:
+case 4158:
+case 4159:
+case 4160:
+case 4161:
+case 4162:
+case 4163:
+case 4164:
+case 4165:
+case 4166:
+case 4167:
+case 4168:
+case 4169:
+case 4170:
+case 4171:
+case 4172:
+case 4173:
+case 4174:
+case 4175:
+case 4176:
+case 4177:
+case 4178:
+case 4179:
+case 4180:
+case 4181:
+case 4182:
+case 4183:
+case 4184:
+case 4185:
+case 4186:
+case 4187:
+case 4188:
+case 4189:
+case 4190:
+case 4191:
+case 4192:
+case 4193:
+case 4194:
+case 4195:
+case 4196:
+case 4197:
+case 4198:
+case 4199:
+case 4200:
+case 4201:
+case 4202:
+case 4203:
+case 4204:
+case 4205:
+case 4206:
+case 4207:
+case 4208:
+case 4209:
+case 4210:
+case 4211:
+case 4212:
+case 4213:
+case 4214:
+case 4215:
+case 4216:
+case 4217:
+case 4218:
+case 4219:
+case 4220:
+case 4221:
+case 4222:
+case 4223:
+case 4224:
+case 4225:
+case 4226:
+case 4227:
+case 4228:
+case 4229:
+case 4230:
+case 4231:
+case 4232:
+case 4233:
+case 4234:
+case 4235:
+case 4236:
+case 4237:
+case 4238:
+case 4239:
+case 4240:
+case 4241:
+case 4242:
+case 4243:
+case 4244:
+case 4245:
+case 4246:
+case 4247:
+case 4248:
+case 4249:
+case 4250:
+case 4251:
+case 4252:
+case 4253:
+case 4254:
+case 4255:
+case 4256:
+case 4257:
+case 4258:
+case 4259:
+case 4260:
+case 4261:
+case 4262:
+case 4263:
+case 4264:
+case 4265:
+case 4266:
+case 4267:
+case 4268:
+case 4269:
+case 4270:
+case 4271:
+case 4272:
+case 4273:
+case 4274:
+case 4275:
+case 4276:
+case 4277:
+case 4278:
+case 4279:
+case 4280:
+case 4281:
+case 4282:
+case 4283:
+case 4284:
+case 4285:
+case 4286:
+case 4287:
+case 4288:
+case 4289:
+case 4290:
+case 4291:
+case 4292:
+case 4293:
+case 4294:
+case 4295:
+case 4296:
+case 4297:
+case 4298:
+case 4299:
+case 4300:
+case 4301:
+case 4302:
+case 4303:
+case 4304:
+case 4305:
+case 4306:
+case 4307:
+case 4308:
+case 4309:
+case 4310:
+case 4311:
+case 4312:
+case 4313:
+case 4314:
+case 4315:
+case 4316:
+case 4317:
+case 4318:
+case 4319:
+case 4320:
+case 4321:
+case 4322:
+case 4323:
+case 4324:
+case 4325:
+case 4326:
+case 4327:
+case 4328:
+case 4329:
+case 4330:
+case 4331:
+case 4332:
+case 4333:
+case 4334:
+case 4335:
+case 4336:
+case 4337:
+case 4338:
+case 4339:
+case 4340:
+case 4341:
+case 4342:
+case 4343:
+case 4344:
+case 4345:
+case 4346:
+case 4347:
+case 4348:
+case 4349:
+case 4350:
+case 4351:
+case 4352:
+case 4353:
+case 4354:
+case 4355:
+case 4356:
+case 4357:
+case 4358:
+case 4359:
+case 4360:
+case 4361:
+case 4362:
+case 4363:
+case 4364:
+case 4365:
+case 4366:
+case 4367:
+case 4368:
+case 4369:
+case 4370:
+case 4371:
+case 4372:
+case 4373:
+case 4374:
+case 4375:
+case 4376:
+case 4377:
+case 4378:
+case 4379:
+case 4380:
+case 4381:
+case 4382:
+case 4383:
+case 4384:
+case 4385:
+case 4386:
+case 4387:
+case 4388:
+case 4389:
+case 4390:
+case 4391:
+case 4392:
+case 4393:
+case 4394:
+case 4395:
+case 4396:
+case 4397:
+case 4398:
+case 4399:
+case 4400:
+case 4401:
+case 4402:
+case 4403:
+case 4404:
+case 4405:
+case 4406:
+case 4407:
+case 4408:
+case 4409:
+case 4410:
+case 4411:
+case 4412:
+case 4413:
+case 4414:
+case 4415:
+case 4416:
+case 4417:
+case 4418:
+case 4419:
+case 4420:
+case 4421:
+case 4422:
+case 4423:
+case 4424:
+case 4425:
+case 4426:
+case 4427:
+case 4428:
+case 4429:
+case 4430:
+case 4431:
+case 4432:
+case 4433:
+case 4434:
+case 4435:
+case 4436:
+case 4437:
+case 4438:
+case 4439:
+case 4440:
+case 4441:
+case 4442:
+case 4443:
+case 4444:
+case 4445:
+case 4446:
+case 4447:
+case 4448:
+case 4449:
+case 4450:
+case 4451:
+case 4452:
+case 4453:
+case 4454:
+case 4455:
+case 4456:
+case 4457:
+case 4458:
+case 4459:
+case 4460:
+case 4461:
+case 4462:
+case 4463:
+case 4464:
+case 4465:
+case 4466:
+case 4467:
+case 4468:
+case 4469:
+case 4470:
+case 4471:
+case 4472:
+case 4473:
+case 4474:
+case 4475:
+case 4476:
+case 4477:
+case 4478:
+case 4479:
+case 4480:
+case 4481:
+case 4482:
+case 4483:
+case 4484:
+case 4485:
+case 4486:
+case 4487:
+case 4488:
+case 4489:
+case 4490:
+case 4491:
+case 4492:
+case 4493:
+case 4494:
+case 4495:
+case 4496:
+case 4497:
+case 4498:
+case 4499:
+case 4500:
+case 4501:
+case 4502:
+case 4503:
+case 4504:
+case 4505:
+case 4506:
+case 4507:
+case 4508:
+case 4509:
+case 4510:
+case 4511:
+case 4512:
+case 4513:
+case 4514:
+case 4515:
+case 4516:
+case 4517:
+case 4518:
+case 4519:
+case 4520:
+case 4521:
+case 4522:
+case 4523:
+case 4524:
+case 4525:
+case 4526:
+case 4527:
+case 4528:
+case 4529:
+case 4530:
+case 4531:
+case 4532:
+case 4533:
+case 4534:
+case 4535:
+case 4536:
+case 4537:
+case 4538:
+case 4539:
+case 4540:
+case 4541:
+case 4542:
+case 4543:
+case 4544:
+case 4545:
+case 4546:
+case 4547:
+case 4548:
+case 4549:
+case 4550:
+case 4551:
+case 4552:
+case 4553:
+case 4554:
+case 4555:
+case 4556:
+case 4557:
+case 4558:
+case 4559:
+case 4560:
+case 4561:
+case 4562:
+case 4563:
+case 4564:
+case 4565:
+case 4566:
+case 4567:
+case 4568:
+case 4569:
+case 4570:
+case 4571:
+case 4572:
+case 4573:
+case 4574:
+case 4575:
+case 4576:
+case 4577:
+case 4578:
+case 4579:
+case 4580:
+case 4581:
+case 4582:
+case 4583:
+case 4584:
+case 4585:
+case 4586:
+case 4587:
+case 4588:
+case 4589:
+case 4590:
+case 4591:
+case 4592:
+case 4593:
+case 4594:
+case 4595:
+case 4596:
+case 4597:
+case 4598:
+case 4599:
+case 4600:
+case 4601:
+case 4602:
+case 4603:
+case 4604:
+case 4605:
+case 4606:
+case 4607:
+case 4608:
+case 4609:
+case 4610:
+case 4611:
+case 4612:
+case 4613:
+case 4614:
+case 4615:
+case 4616:
+case 4617:
+case 4618:
+case 4619:
+case 4620:
+case 4621:
+case 4622:
+case 4623:
+case 4624:
+case 4625:
+case 4626:
+case 4627:
+case 4628:
+case 4629:
+case 4630:
+case 4631:
+case 4632:
+case 4633:
+case 4634:
+case 4635:
+case 4636:
+case 4637:
+case 4638:
+case 4639:
+case 4640:
+case 4641:
+case 4642:
+case 4643:
+case 4644:
+case 4645:
+case 4646:
+case 4647:
+case 4648:
+case 4649:
+case 4650:
+case 4651:
+case 4652:
+case 4653:
+case 4654:
+case 4655:
+case 4656:
+case 4657:
+case 4658:
+case 4659:
+case 4660:
+case 4661:
+case 4662:
+case 4663:
+case 4664:
+case 4665:
+case 4666:
+case 4667:
+case 4668:
+case 4669:
+case 4670:
+case 4671:
+case 4672:
+case 4673:
+case 4674:
+case 4675:
+case 4676:
+case 4677:
+case 4678:
+case 4679:
+case 4680:
+case 4681:
+case 4682:
+case 4683:
+case 4684:
+case 4685:
+case 4686:
+case 4687:
+case 4688:
+case 4689:
+case 4690:
+case 4691:
+case 4692:
+case 4693:
+case 4694:
+case 4695:
+case 4696:
+case 4697:
+case 4698:
+case 4699:
+case 4700:
+case 4701:
+case 4702:
+case 4703:
+case 4704:
+case 4705:
+case 4706:
+case 4707:
+case 4708:
+case 4709:
+case 4710:
+case 4711:
+case 4712:
+case 4713:
+case 4714:
+case 4715:
+case 4716:
+case 4717:
+case 4718:
+case 4719:
+case 4720:
+case 4721:
+case 4722:
+case 4723:
+case 4724:
+case 4725:
+case 4726:
+case 4727:
+case 4728:
+case 4729:
+case 4730:
+case 4731:
+case 4732:
+case 4733:
+case 4734:
+case 4735:
+case 4736:
+case 4737:
+case 4738:
+case 4739:
+case 4740:
+case 4741:
+case 4742:
+case 4743:
+case 4744:
+case 4745:
+case 4746:
+case 4747:
+case 4748:
+case 4749:
+case 4750:
+case 4751:
+case 4752:
+case 4753:
+case 4754:
+case 4755:
+case 4756:
+case 4757:
+case 4758:
+case 4759:
+case 4760:
+case 4761:
+case 4762:
+case 4763:
+case 4764:
+case 4765:
+case 4766:
+case 4767:
+case 4768:
+case 4769:
+case 4770:
+case 4771:
+case 4772:
+case 4773:
+case 4774:
+case 4775:
+case 4776:
+case 4777:
+case 4778:
+case 4779:
+case 4780:
+case 4781:
+case 4782:
+case 4783:
+case 4784:
+case 4785:
+case 4786:
+case 4787:
+case 4788:
+case 4789:
+case 4790:
+case 4791:
+case 4792:
+case 4793:
+case 4794:
+case 4795:
+case 4796:
+case 4797:
+case 4798:
+case 4799:
+case 4800:
+case 4801:
+case 4802:
+case 4803:
+case 4804:
+case 4805:
+case 4806:
+case 4807:
+case 4808:
+case 4809:
+case 4810:
+case 4811:
+case 4812:
+case 4813:
+case 4814:
+case 4815:
+case 4816:
+case 4817:
+case 4818:
+case 4819:
+case 4820:
+case 4821:
+case 4822:
+case 4823:
+case 4824:
+case 4825:
+case 4826:
+case 4827:
+case 4828:
+case 4829:
+case 4830:
+case 4831:
+case 4832:
+case 4833:
+case 4834:
+case 4835:
+case 4836:
+case 4837:
+case 4838:
+case 4839:
+case 4840:
+case 4841:
+case 4842:
+case 4843:
+case 4844:
+case 4845:
+case 4846:
+case 4847:
+case 4848:
+case 4849:
+case 4850:
+case 4851:
+case 4852:
+case 4853:
+case 4854:
+case 4855:
+case 4856:
+case 4857:
+case 4858:
+case 4859:
+case 4860:
+case 4861:
+case 4862:
+case 4863:
+case 4864:
+case 4865:
+case 4866:
+case 4867:
+case 4868:
+case 4869:
+case 4870:
+case 4871:
+case 4872:
+case 4873:
+case 4874:
+case 4875:
+case 4876:
+case 4877:
+case 4878:
+case 4879:
+case 4880:
+case 4881:
+case 4882:
+case 4883:
+case 4884:
+case 4885:
+case 4886:
+case 4887:
+case 4888:
+case 4889:
+case 4890:
+case 4891:
+case 4892:
+case 4893:
+case 4894:
+case 4895:
+case 4896:
+case 4897:
+case 4898:
+case 4899:
+case 4900:
+case 4901:
+case 4902:
+case 4903:
+case 4904:
+case 4905:
+case 4906:
+case 4907:
+case 4908:
+case 4909:
+case 4910:
+case 4911:
+case 4912:
+case 4913:
+case 4914:
+case 4915:
+case 4916:
+case 4917:
+case 4918:
+case 4919:
+case 4920:
+case 4921:
+case 4922:
+case 4923:
+case 4924:
+case 4925:
+case 4926:
+case 4927:
+case 4928:
+case 4929:
+case 4930:
+case 4931:
+case 4932:
+case 4933:
+case 4934:
+case 4935:
+case 4936:
+case 4937:
+case 4938:
+case 4939:
+case 4940:
+case 4941:
+case 4942:
+case 4943:
+case 4944:
+case 4945:
+case 4946:
+case 4947:
+case 4948:
+case 4949:
+case 4950:
+case 4951:
+case 4952:
+case 4953:
+case 4954:
+case 4955:
+case 4956:
+case 4957:
+case 4958:
+case 4959:
+case 4960:
+case 4961:
+case 4962:
+case 4963:
+case 4964:
+case 4965:
+case 4966:
+case 4967:
+case 4968:
+case 4969:
+case 4970:
+case 4971:
+case 4972:
+case 4973:
+case 4974:
+case 4975:
+case 4976:
+case 4977:
+case 4978:
+case 4979:
+case 4980:
+case 4981:
+case 4982:
+case 4983:
+case 4984:
+case 4985:
+case 4986:
+case 4987:
+case 4988:
+case 4989:
+case 4990:
+case 4991:
+case 4992:
+case 4993:
+case 4994:
+case 4995:
+case 4996:
+case 4997:
+case 4998:
+case 4999:
+case 5000:
+case 5001:
+case 5002:
+case 5003:
+case 5004:
+case 5005:
+case 5006:
+case 5007:
+case 5008:
+case 5009:
+case 5010:
+case 5011:
+case 5012:
+case 5013:
+case 5014:
+case 5015:
+case 5016:
+case 5017:
+case 5018:
+case 5019:
+case 5020:
+case 5021:
+case 5022:
+case 5023:
+case 5024:
+case 5025:
+case 5026:
+case 5027:
+case 5028:
+case 5029:
+case 5030:
+case 5031:
+case 5032:
+case 5033:
+case 5034:
+case 5035:
+case 5036:
+case 5037:
+case 5038:
+case 5039:
+case 5040:
+case 5041:
+case 5042:
+case 5043:
+case 5044:
+case 5045:
+case 5046:
+case 5047:
+case 5048:
+case 5049:
+case 5050:
+case 5051:
+case 5052:
+case 5053:
+case 5054:
+case 5055:
+case 5056:
+case 5057:
+case 5058:
+case 5059:
+case 5060:
+case 5061:
+case 5062:
+case 5063:
+case 5064:
+case 5065:
+case 5066:
+case 5067:
+case 5068:
+case 5069:
+case 5070:
+case 5071:
+case 5072:
+case 5073:
+case 5074:
+case 5075:
+case 5076:
+case 5077:
+case 5078:
+case 5079:
+case 5080:
+case 5081:
+case 5082:
+case 5083:
+case 5084:
+case 5085:
+case 5086:
+case 5087:
+case 5088:
+case 5089:
+case 5090:
+case 5091:
+case 5092:
+case 5093:
+case 5094:
+case 5095:
+case 5096:
+case 5097:
+case 5098:
+case 5099:
+case 5100:
+case 5101:
+case 5102:
+case 5103:
+case 5104:
+case 5105:
+case 5106:
+case 5107:
+case 5108:
+case 5109:
+case 5110:
+case 5111:
+case 5112:
+case 5113:
+case 5114:
+case 5115:
+case 5116:
+case 5117:
+case 5118:
+case 5119:
+case 5120:
+case 5121:
+case 5122:
+case 5123:
+case 5124:
+case 5125:
+case 5126:
+case 5127:
+case 5128:
+case 5129:
+case 5130:
+case 5131:
+case 5132:
+case 5133:
+case 5134:
+case 5135:
+case 5136:
+case 5137:
+case 5138:
+case 5139:
+case 5140:
+case 5141:
+case 5142:
+case 5143:
+case 5144:
+case 5145:
+case 5146:
+case 5147:
+case 5148:
+case 5149:
+case 5150:
+case 5151:
+case 5152:
+case 5153:
+case 5154:
+case 5155:
+case 5156:
+case 5157:
+case 5158:
+case 5159:
+case 5160:
+case 5161:
+case 5162:
+case 5163:
+case 5164:
+case 5165:
+case 5166:
+case 5167:
+case 5168:
+case 5169:
+case 5170:
+case 5171:
+case 5172:
+case 5173:
+case 5174:
+case 5175:
+case 5176:
+case 5177:
+case 5178:
+case 5179:
+case 5180:
+case 5181:
+case 5182:
+case 5183:
+case 5184:
+case 5185:
+case 5186:
+case 5187:
+case 5188:
+case 5189:
+case 5190:
+case 5191:
+case 5192:
+case 5193:
+case 5194:
+case 5195:
+case 5196:
+case 5197:
+case 5198:
+case 5199:
+case 5200:
+case 5201:
+case 5202:
+case 5203:
+case 5204:
+case 5205:
+case 5206:
+case 5207:
+case 5208:
+case 5209:
+case 5210:
+case 5211:
+case 5212:
+case 5213:
+case 5214:
+case 5215:
+case 5216:
+case 5217:
+case 5218:
+case 5219:
+case 5220:
+case 5221:
+case 5222:
+case 5223:
+case 5224:
+case 5225:
+case 5226:
+case 5227:
+case 5228:
+case 5229:
+case 5230:
+case 5231:
+case 5232:
+case 5233:
+case 5234:
+case 5235:
+case 5236:
+case 5237:
+case 5238:
+case 5239:
+case 5240:
+case 5241:
+case 5242:
+case 5243:
+case 5244:
+case 5245:
+case 5246:
+case 5247:
+case 5248:
+case 5249:
+case 5250:
+case 5251:
+case 5252:
+case 5253:
+case 5254:
+case 5255:
+case 5256:
+case 5257:
+case 5258:
+case 5259:
+case 5260:
+case 5261:
+case 5262:
+case 5263:
+case 5264:
+case 5265:
+case 5266:
+case 5267:
+case 5268:
+case 5269:
+case 5270:
+case 5271:
+case 5272:
+case 5273:
+case 5274:
+case 5275:
+case 5276:
+case 5277:
+case 5278:
+case 5279:
+case 5280:
+case 5281:
+case 5282:
+case 5283:
+case 5284:
+case 5285:
+case 5286:
+case 5287:
+case 5288:
+case 5289:
+case 5290:
+case 5291:
+case 5292:
+case 5293:
+case 5294:
+case 5295:
+case 5296:
+case 5297:
+case 5298:
+case 5299:
+case 5300:
+case 5301:
+case 5302:
+case 5303:
+case 5304:
+case 5305:
+case 5306:
+case 5307:
+case 5308:
+case 5309:
+case 5310:
+case 5311:
+case 5312:
+case 5313:
+case 5314:
+case 5315:
+case 5316:
+case 5317:
+case 5318:
+case 5319:
+case 5320:
+case 5321:
+case 5322:
+case 5323:
+case 5324:
+case 5325:
+case 5326:
+case 5327:
+case 5328:
+case 5329:
+case 5330:
+case 5331:
+case 5332:
+case 5333:
+case 5334:
+case 5335:
+case 5336:
+case 5337:
+case 5338:
+case 5339:
+case 5340:
+case 5341:
+case 5342:
+case 5343:
+case 5344:
+case 5345:
+case 5346:
+case 5347:
+case 5348:
+case 5349:
+case 5350:
+case 5351:
+case 5352:
+case 5353:
+case 5354:
+case 5355:
+case 5356:
+case 5357:
+case 5358:
+case 5359:
+case 5360:
+case 5361:
+case 5362:
+case 5363:
+case 5364:
+case 5365:
+case 5366:
+case 5367:
+case 5368:
+case 5369:
+case 5370:
+case 5371:
+case 5372:
+case 5373:
+case 5374:
+case 5375:
+case 5376:
+case 5377:
+case 5378:
+case 5379:
+case 5380:
+case 5381:
+case 5382:
+case 5383:
+case 5384:
+case 5385:
+case 5386:
+case 5387:
+case 5388:
+case 5389:
+case 5390:
+case 5391:
+case 5392:
+case 5393:
+case 5394:
+case 5395:
+case 5396:
+case 5397:
+case 5398:
+case 5399:
+case 5400:
+case 5401:
+case 5402:
+case 5403:
+case 5404:
+case 5405:
+case 5406:
+case 5407:
+case 5408:
+case 5409:
+case 5410:
+case 5411:
+case 5412:
+case 5413:
+case 5414:
+case 5415:
+case 5416:
+case 5417:
+case 5418:
+case 5419:
+case 5420:
+case 5421:
+case 5422:
+case 5423:
+case 5424:
+case 5425:
+case 5426:
+case 5427:
+case 5428:
+case 5429:
+case 5430:
+case 5431:
+case 5432:
+case 5433:
+case 5434:
+case 5435:
+case 5436:
+case 5437:
+case 5438:
+case 5439:
+case 5440:
+case 5441:
+case 5442:
+case 5443:
+case 5444:
+case 5445:
+case 5446:
+case 5447:
+case 5448:
+case 5449:
+case 5450:
+case 5451:
+case 5452:
+case 5453:
+case 5454:
+case 5455:
+case 5456:
+case 5457:
+case 5458:
+case 5459:
+case 5460:
+case 5461:
+case 5462:
+case 5463:
+case 5464:
+case 5465:
+case 5466:
+case 5467:
+case 5468:
+case 5469:
+case 5470:
+case 5471:
+case 5472:
+case 5473:
+case 5474:
+case 5475:
+case 5476:
+case 5477:
+case 5478:
+case 5479:
+case 5480:
+case 5481:
+case 5482:
+case 5483:
+case 5484:
+case 5485:
+case 5486:
+case 5487:
+case 5488:
+case 5489:
+case 5490:
+case 5491:
+case 5492:
+case 5493:
+case 5494:
+case 5495:
+case 5496:
+case 5497:
+case 5498:
+case 5499:
+case 5500:
+case 5501:
+case 5502:
+case 5503:
+case 5504:
+case 5505:
+case 5506:
+case 5507:
+case 5508:
+case 5509:
+case 5510:
+case 5511:
+case 5512:
+case 5513:
+case 5514:
+case 5515:
+case 5516:
+case 5517:
+case 5518:
+case 5519:
+case 5520:
+case 5521:
+case 5522:
+case 5523:
+case 5524:
+case 5525:
+case 5526:
+case 5527:
+case 5528:
+case 5529:
+case 5530:
+case 5531:
+case 5532:
+case 5533:
+case 5534:
+case 5535:
+case 5536:
+case 5537:
+case 5538:
+case 5539:
+case 5540:
+case 5541:
+case 5542:
+case 5543:
+case 5544:
+case 5545:
+case 5546:
+case 5547:
+case 5548:
+case 5549:
+case 5550:
+case 5551:
+case 5552:
+case 5553:
+case 5554:
+case 5555:
+case 5556:
+case 5557:
+case 5558:
+case 5559:
+case 5560:
+case 5561:
+case 5562:
+case 5563:
+case 5564:
+case 5565:
+case 5566:
+case 5567:
+case 5568:
+case 5569:
+case 5570:
+case 5571:
+case 5572:
+case 5573:
+case 5574:
+case 5575:
+case 5576:
+case 5577:
+case 5578:
+case 5579:
+case 5580:
+case 5581:
+case 5582:
+case 5583:
+case 5584:
+case 5585:
+case 5586:
+case 5587:
+case 5588:
+case 5589:
+case 5590:
+case 5591:
+case 5592:
+case 5593:
+case 5594:
+case 5595:
+case 5596:
+case 5597:
+case 5598:
+case 5599:
+case 5600:
+case 5601:
+case 5602:
+case 5603:
+case 5604:
+case 5605:
+case 5606:
+case 5607:
+case 5608:
+case 5609:
+case 5610:
+case 5611:
+case 5612:
+case 5613:
+case 5614:
+case 5615:
+case 5616:
+case 5617:
+case 5618:
+case 5619:
+case 5620:
+case 5621:
+case 5622:
+case 5623:
+case 5624:
+case 5625:
+case 5626:
+case 5627:
+case 5628:
+case 5629:
+case 5630:
+case 5631:
+case 5632:
+case 5633:
+case 5634:
+case 5635:
+case 5636:
+case 5637:
+case 5638:
+case 5639:
+case 5640:
+case 5641:
+case 5642:
+case 5643:
+case 5644:
+case 5645:
+case 5646:
+case 5647:
+case 5648:
+case 5649:
+case 5650:
+case 5651:
+case 5652:
+case 5653:
+case 5654:
+case 5655:
+case 5656:
+case 5657:
+case 5658:
+case 5659:
+case 5660:
+case 5661:
+case 5662:
+case 5663:
+case 5664:
+case 5665:
+case 5666:
+case 5667:
+case 5668:
+case 5669:
+case 5670:
+case 5671:
+case 5672:
+case 5673:
+case 5674:
+case 5675:
+case 5676:
+case 5677:
+case 5678:
+case 5679:
+case 5680:
+case 5681:
+case 5682:
+case 5683:
+case 5684:
+case 5685:
+case 5686:
+case 5687:
+case 5688:
+case 5689:
+case 5690:
+case 5691:
+case 5692:
+case 5693:
+case 5694:
+case 5695:
+case 5696:
+case 5697:
+case 5698:
+case 5699:
+case 5700:
+case 5701:
+case 5702:
+case 5703:
+case 5704:
+case 5705:
+case 5706:
+case 5707:
+case 5708:
+case 5709:
+case 5710:
+case 5711:
+case 5712:
+case 5713:
+case 5714:
+case 5715:
+case 5716:
+case 5717:
+case 5718:
+case 5719:
+case 5720:
+case 5721:
+case 5722:
+case 5723:
+case 5724:
+case 5725:
+case 5726:
+case 5727:
+case 5728:
+case 5729:
+case 5730:
+case 5731:
+case 5732:
+case 5733:
+case 5734:
+case 5735:
+case 5736:
+case 5737:
+case 5738:
+case 5739:
+case 5740:
+case 5741:
+case 5742:
+case 5743:
+case 5744:
+case 5745:
+case 5746:
+case 5747:
+case 5748:
+case 5749:
+case 5750:
+case 5751:
+case 5752:
+case 5753:
+case 5754:
+case 5755:
+case 5756:
+case 5757:
+case 5758:
+case 5759:
+case 5760:
+case 5761:
+case 5762:
+case 5763:
+case 5764:
+case 5765:
+case 5766:
+case 5767:
+case 5768:
+case 5769:
+case 5770:
+case 5771:
+case 5772:
+case 5773:
+case 5774:
+case 5775:
+case 5776:
+case 5777:
+case 5778:
+case 5779:
+case 5780:
+case 5781:
+case 5782:
+case 5783:
+case 5784:
+case 5785:
+case 5786:
+case 5787:
+case 5788:
+case 5789:
+case 5790:
+case 5791:
+case 5792:
+case 5793:
+case 5794:
+case 5795:
+case 5796:
+case 5797:
+case 5798:
+case 5799:
+case 5800:
+case 5801:
+case 5802:
+case 5803:
+case 5804:
+case 5805:
+case 5806:
+case 5807:
+case 5808:
+case 5809:
+case 5810:
+case 5811:
+case 5812:
+case 5813:
+case 5814:
+case 5815:
+case 5816:
+case 5817:
+case 5818:
+case 5819:
+case 5820:
+case 5821:
+case 5822:
+case 5823:
+case 5824:
+case 5825:
+case 5826:
+case 5827:
+case 5828:
+case 5829:
+case 5830:
+case 5831:
+case 5832:
+case 5833:
+case 5834:
+case 5835:
+case 5836:
+case 5837:
+case 5838:
+case 5839:
+case 5840:
+case 5841:
+case 5842:
+case 5843:
+case 5844:
+case 5845:
+case 5846:
+case 5847:
+case 5848:
+case 5849:
+case 5850:
+case 5851:
+case 5852:
+case 5853:
+case 5854:
+case 5855:
+case 5856:
+case 5857:
+case 5858:
+case 5859:
+case 5860:
+case 5861:
+case 5862:
+case 5863:
+case 5864:
+case 5865:
+case 5866:
+case 5867:
+case 5868:
+case 5869:
+case 5870:
+case 5871:
+case 5872:
+case 5873:
+case 5874:
+case 5875:
+case 5876:
+case 5877:
+case 5878:
+case 5879:
+case 5880:
+case 5881:
+case 5882:
+case 5883:
+case 5884:
+case 5885:
+case 5886:
+case 5887:
+case 5888:
+case 5889:
+case 5890:
+case 5891:
+case 5892:
+case 5893:
+case 5894:
+case 5895:
+case 5896:
+case 5897:
+case 5898:
+case 5899:
+case 5900:
+case 5901:
+case 5902:
+case 5903:
+case 5904:
+case 5905:
+case 5906:
+case 5907:
+case 5908:
+case 5909:
+case 5910:
+case 5911:
+case 5912:
+case 5913:
+case 5914:
+case 5915:
+case 5916:
+case 5917:
+case 5918:
+case 5919:
+case 5920:
+case 5921:
+case 5922:
+case 5923:
+case 5924:
+case 5925:
+case 5926:
+case 5927:
+case 5928:
+case 5929:
+case 5930:
+case 5931:
+case 5932:
+case 5933:
+case 5934:
+case 5935:
+case 5936:
+case 5937:
+case 5938:
+case 5939:
+case 5940:
+case 5941:
+case 5942:
+case 5943:
+case 5944:
+case 5945:
+case 5946:
+case 5947:
+case 5948:
+case 5949:
+case 5950:
+case 5951:
+case 5952:
+case 5953:
+case 5954:
+case 5955:
+case 5956:
+case 5957:
+case 5958:
+case 5959:
+case 5960:
+case 5961:
+case 5962:
+case 5963:
+case 5964:
+case 5965:
+case 5966:
+case 5967:
+case 5968:
+case 5969:
+case 5970:
+case 5971:
+case 5972:
+case 5973:
+case 5974:
+case 5975:
+case 5976:
+case 5977:
+case 5978:
+case 5979:
+case 5980:
+case 5981:
+case 5982:
+case 5983:
+case 5984:
+case 5985:
+case 5986:
+case 5987:
+case 5988:
+case 5989:
+case 5990:
+case 5991:
+case 5992:
+case 5993:
+case 5994:
+case 5995:
+case 5996:
+case 5997:
+case 5998:
+case 5999:
+case 6000:
+case 6001:
+case 6002:
+case 6003:
+case 6004:
+case 6005:
+case 6006:
+case 6007:
+case 6008:
+case 6009:
+case 6010:
+case 6011:
+case 6012:
+case 6013:
+case 6014:
+case 6015:
+case 6016:
+case 6017:
+case 6018:
+case 6019:
+case 6020:
+case 6021:
+case 6022:
+case 6023:
+case 6024:
+case 6025:
+case 6026:
+case 6027:
+case 6028:
+case 6029:
+case 6030:
+case 6031:
+case 6032:
+case 6033:
+case 6034:
+case 6035:
+case 6036:
+case 6037:
+case 6038:
+case 6039:
+case 6040:
+case 6041:
+case 6042:
+case 6043:
+case 6044:
+case 6045:
+case 6046:
+case 6047:
+case 6048:
+case 6049:
+case 6050:
+case 6051:
+case 6052:
+case 6053:
+case 6054:
+case 6055:
+case 6056:
+case 6057:
+case 6058:
+case 6059:
+case 6060:
+case 6061:
+case 6062:
+case 6063:
+case 6064:
+case 6065:
+case 6066:
+case 6067:
+case 6068:
+case 6069:
+case 6070:
+case 6071:
+case 6072:
+case 6073:
+case 6074:
+case 6075:
+case 6076:
+case 6077:
+case 6078:
+case 6079:
+case 6080:
+case 6081:
+case 6082:
+case 6083:
+case 6084:
+case 6085:
+case 6086:
+case 6087:
+case 6088:
+case 6089:
+case 6090:
+case 6091:
+case 6092:
+case 6093:
+case 6094:
+case 6095:
+case 6096:
+case 6097:
+case 6098:
+case 6099:
+case 6100:
+case 6101:
+case 6102:
+case 6103:
+case 6104:
+case 6105:
+case 6106:
+case 6107:
+case 6108:
+case 6109:
+case 6110:
+case 6111:
+case 6112:
+case 6113:
+case 6114:
+case 6115:
+case 6116:
+case 6117:
+case 6118:
+case 6119:
+case 6120:
+case 6121:
+case 6122:
+case 6123:
+case 6124:
+case 6125:
+case 6126:
+case 6127:
+case 6128:
+case 6129:
+case 6130:
+case 6131:
+case 6132:
+case 6133:
+case 6134:
+case 6135:
+case 6136:
+case 6137:
+case 6138:
+case 6139:
+case 6140:
+case 6141:
+case 6142:
+case 6143:
+case 6144:
+case 6145:
+case 6146:
+case 6147:
+case 6148:
+case 6149:
+case 6150:
+case 6151:
+case 6152:
+case 6153:
+case 6154:
+case 6155:
+case 6156:
+case 6157:
+case 6158:
+case 6159:
+case 6160:
+case 6161:
+case 6162:
+case 6163:
+case 6164:
+case 6165:
+case 6166:
+case 6167:
+case 6168:
+case 6169:
+case 6170:
+case 6171:
+case 6172:
+case 6173:
+case 6174:
+case 6175:
+case 6176:
+case 6177:
+case 6178:
+case 6179:
+case 6180:
+case 6181:
+case 6182:
+case 6183:
+case 6184:
+case 6185:
+case 6186:
+case 6187:
+case 6188:
+case 6189:
+case 6190:
+case 6191:
+case 6192:
+case 6193:
+case 6194:
+case 6195:
+case 6196:
+case 6197:
+case 6198:
+case 6199:
+case 6200:
+case 6201:
+case 6202:
+case 6203:
+case 6204:
+case 6205:
+case 6206:
+case 6207:
+case 6208:
+case 6209:
+case 6210:
+case 6211:
+case 6212:
+case 6213:
+case 6214:
+case 6215:
+case 6216:
+case 6217:
+case 6218:
+case 6219:
+case 6220:
+case 6221:
+case 6222:
+case 6223:
+case 6224:
+case 6225:
+case 6226:
+case 6227:
+case 6228:
+case 6229:
+case 6230:
+case 6231:
+case 6232:
+case 6233:
+case 6234:
+case 6235:
+case 6236:
+case 6237:
+case 6238:
+case 6239:
+case 6240:
+case 6241:
+case 6242:
+case 6243:
+case 6244:
+case 6245:
+case 6246:
+case 6247:
+case 6248:
+case 6249:
+case 6250:
+case 6251:
+case 6252:
+case 6253:
+case 6254:
+case 6255:
+case 6256:
+case 6257:
+case 6258:
+case 6259:
+case 6260:
+case 6261:
+case 6262:
+case 6263:
+case 6264:
+case 6265:
+case 6266:
+case 6267:
+case 6268:
+case 6269:
+case 6270:
+case 6271:
+case 6272:
+case 6273:
+case 6274:
+case 6275:
+case 6276:
+case 6277:
+case 6278:
+case 6279:
+case 6280:
+case 6281:
+case 6282:
+case 6283:
+case 6284:
+case 6285:
+case 6286:
+case 6287:
+case 6288:
+case 6289:
+case 6290:
+case 6291:
+case 6292:
+case 6293:
+case 6294:
+case 6295:
+case 6296:
+case 6297:
+case 6298:
+case 6299:
+case 6300:
+case 6301:
+case 6302:
+case 6303:
+case 6304:
+case 6305:
+case 6306:
+case 6307:
+case 6308:
+case 6309:
+case 6310:
+case 6311:
+case 6312:
+case 6313:
+case 6314:
+case 6315:
+case 6316:
+case 6317:
+case 6318:
+case 6319:
+case 6320:
+case 6321:
+case 6322:
+case 6323:
+case 6324:
+case 6325:
+case 6326:
+case 6327:
+case 6328:
+case 6329:
+case 6330:
+case 6331:
+case 6332:
+case 6333:
+case 6334:
+case 6335:
+case 6336:
+case 6337:
+case 6338:
+case 6339:
+case 6340:
+case 6341:
+case 6342:
+case 6343:
+case 6344:
+case 6345:
+case 6346:
+case 6347:
+case 6348:
+case 6349:
+case 6350:
+case 6351:
+case 6352:
+case 6353:
+case 6354:
+case 6355:
+case 6356:
+case 6357:
+case 6358:
+case 6359:
+case 6360:
+case 6361:
+case 6362:
+case 6363:
+case 6364:
+case 6365:
+case 6366:
+case 6367:
+case 6368:
+case 6369:
+case 6370:
+case 6371:
+case 6372:
+case 6373:
+case 6374:
+case 6375:
+case 6376:
+case 6377:
+case 6378:
+case 6379:
+case 6380:
+case 6381:
+case 6382:
+case 6383:
+case 6384:
+case 6385:
+case 6386:
+case 6387:
+case 6388:
+case 6389:
+case 6390:
+case 6391:
+case 6392:
+case 6393:
+case 6394:
+case 6395:
+case 6396:
+case 6397:
+case 6398:
+case 6399:
+case 6400:
+case 6401:
+case 6402:
+case 6403:
+case 6404:
+case 6405:
+case 6406:
+case 6407:
+case 6408:
+case 6409:
+case 6410:
+case 6411:
+case 6412:
+case 6413:
+case 6414:
+case 6415:
+case 6416:
+case 6417:
+case 6418:
+case 6419:
+case 6420:
+case 6421:
+case 6422:
+case 6423:
+case 6424:
+case 6425:
+case 6426:
+case 6427:
+case 6428:
+case 6429:
+case 6430:
+case 6431:
+case 6432:
+case 6433:
+case 6434:
+case 6435:
+case 6436:
+case 6437:
+case 6438:
+case 6439:
+case 6440:
+case 6441:
+case 6442:
+case 6443:
+case 6444:
+case 6445:
+case 6446:
+case 6447:
+case 6448:
+case 6449:
+case 6450:
+case 6451:
+case 6452:
+case 6453:
+case 6454:
+case 6455:
+case 6456:
+case 6457:
+case 6458:
+case 6459:
+case 6460:
+case 6461:
+case 6462:
+case 6463:
+case 6464:
+case 6465:
+case 6466:
+case 6467:
+case 6468:
+case 6469:
+case 6470:
+case 6471:
+case 6472:
+case 6473:
+case 6474:
+case 6475:
+case 6476:
+case 6477:
+case 6478:
+case 6479:
+case 6480:
+case 6481:
+case 6482:
+case 6483:
+case 6484:
+case 6485:
+case 6486:
+case 6487:
+case 6488:
+case 6489:
+case 6490:
+case 6491:
+case 6492:
+case 6493:
+case 6494:
+case 6495:
+case 6496:
+case 6497:
+case 6498:
+case 6499:
+case 6500:
+case 6501:
+case 6502:
+case 6503:
+case 6504:
+case 6505:
+case 6506:
+case 6507:
+case 6508:
+case 6509:
+case 6510:
+case 6511:
+case 6512:
+case 6513:
+case 6514:
+case 6515:
+case 6516:
+case 6517:
+case 6518:
+case 6519:
+case 6520:
+case 6521:
+case 6522:
+case 6523:
+case 6524:
+case 6525:
+case 6526:
+case 6527:
+case 6528:
+case 6529:
+case 6530:
+case 6531:
+case 6532:
+case 6533:
+case 6534:
+case 6535:
+case 6536:
+case 6537:
+case 6538:
+case 6539:
+case 6540:
+case 6541:
+case 6542:
+case 6543:
+case 6544:
+case 6545:
+case 6546:
+case 6547:
+case 6548:
+case 6549:
+case 6550:
+case 6551:
+case 6552:
+case 6553:
+case 6554:
+case 6555:
+case 6556:
+case 6557:
+case 6558:
+case 6559:
+case 6560:
+case 6561:
+case 6562:
+case 6563:
+case 6564:
+case 6565:
+case 6566:
+case 6567:
+case 6568:
+case 6569:
+case 6570:
+case 6571:
+case 6572:
+case 6573:
+case 6574:
+case 6575:
+case 6576:
+case 6577:
+case 6578:
+case 6579:
+case 6580:
+case 6581:
+case 6582:
+case 6583:
+case 6584:
+case 6585:
+case 6586:
+case 6587:
+case 6588:
+case 6589:
+case 6590:
+case 6591:
+case 6592:
+case 6593:
+case 6594:
+case 6595:
+case 6596:
+case 6597:
+case 6598:
+case 6599:
+case 6600:
+case 6601:
+case 6602:
+case 6603:
+case 6604:
+case 6605:
+case 6606:
+case 6607:
+case 6608:
+case 6609:
+case 6610:
+case 6611:
+case 6612:
+case 6613:
+case 6614:
+case 6615:
+case 6616:
+case 6617:
+case 6618:
+case 6619:
+case 6620:
+case 6621:
+case 6622:
+case 6623:
+case 6624:
+case 6625:
+case 6626:
+case 6627:
+case 6628:
+case 6629:
+case 6630:
+case 6631:
+case 6632:
+case 6633:
+case 6634:
+case 6635:
+case 6636:
+case 6637:
+case 6638:
+case 6639:
+case 6640:
+case 6641:
+case 6642:
+case 6643:
+case 6644:
+case 6645:
+case 6646:
+case 6647:
+case 6648:
+case 6649:
+case 6650:
+case 6651:
+case 6652:
+case 6653:
+case 6654:
+case 6655:
+case 6656:
+case 6657:
+case 6658:
+case 6659:
+case 6660:
+case 6661:
+case 6662:
+case 6663:
+case 6664:
+case 6665:
+case 6666:
+case 6667:
+case 6668:
+case 6669:
+case 6670:
+case 6671:
+case 6672:
+case 6673:
+case 6674:
+case 6675:
+case 6676:
+case 6677:
+case 6678:
+case 6679:
+case 6680:
+case 6681:
+case 6682:
+case 6683:
+case 6684:
+case 6685:
+case 6686:
+case 6687:
+case 6688:
+case 6689:
+case 6690:
+case 6691:
+case 6692:
+case 6693:
+case 6694:
+case 6695:
+case 6696:
+case 6697:
+case 6698:
+case 6699:
+case 6700:
+case 6701:
+case 6702:
+case 6703:
+case 6704:
+case 6705:
+case 6706:
+case 6707:
+case 6708:
+case 6709:
+case 6710:
+case 6711:
+case 6712:
+case 6713:
+case 6714:
+case 6715:
+case 6716:
+case 6717:
+case 6718:
+case 6719:
+case 6720:
+case 6721:
+case 6722:
+case 6723:
+case 6724:
+case 6725:
+case 6726:
+case 6727:
+case 6728:
+case 6729:
+case 6730:
+case 6731:
+case 6732:
+case 6733:
+case 6734:
+case 6735:
+case 6736:
+case 6737:
+case 6738:
+case 6739:
+case 6740:
+case 6741:
+case 6742:
+case 6743:
+case 6744:
+case 6745:
+case 6746:
+case 6747:
+case 6748:
+case 6749:
+case 6750:
+case 6751:
+case 6752:
+case 6753:
+case 6754:
+case 6755:
+case 6756:
+case 6757:
+case 6758:
+case 6759:
+case 6760:
+case 6761:
+case 6762:
+case 6763:
+case 6764:
+case 6765:
+case 6766:
+case 6767:
+case 6768:
+case 6769:
+case 6770:
+case 6771:
+case 6772:
+case 6773:
+case 6774:
+case 6775:
+case 6776:
+case 6777:
+case 6778:
+case 6779:
+case 6780:
+case 6781:
+case 6782:
+case 6783:
+case 6784:
+case 6785:
+case 6786:
+case 6787:
+case 6788:
+case 6789:
+case 6790:
+case 6791:
+case 6792:
+case 6793:
+case 6794:
+case 6795:
+case 6796:
+case 6797:
+case 6798:
+case 6799:
+case 6800:
+case 6801:
+case 6802:
+case 6803:
+case 6804:
+case 6805:
+case 6806:
+case 6807:
+case 6808:
+case 6809:
+case 6810:
+case 6811:
+case 6812:
+case 6813:
+case 6814:
+case 6815:
+case 6816:
+case 6817:
+case 6818:
+case 6819:
+case 6820:
+case 6821:
+case 6822:
+case 6823:
+case 6824:
+case 6825:
+case 6826:
+case 6827:
+case 6828:
+case 6829:
+case 6830:
+case 6831:
+case 6832:
+case 6833:
+case 6834:
+case 6835:
+case 6836:
+case 6837:
+case 6838:
+case 6839:
+case 6840:
+case 6841:
+case 6842:
+case 6843:
+case 6844:
+case 6845:
+case 6846:
+case 6847:
+case 6848:
+case 6849:
+case 6850:
+case 6851:
+case 6852:
+case 6853:
+case 6854:
+case 6855:
+case 6856:
+case 6857:
+case 6858:
+case 6859:
+case 6860:
+case 6861:
+case 6862:
+case 6863:
+case 6864:
+case 6865:
+case 6866:
+case 6867:
+case 6868:
+case 6869:
+case 6870:
+case 6871:
+case 6872:
+case 6873:
+case 6874:
+case 6875:
+case 6876:
+case 6877:
+case 6878:
+case 6879:
+case 6880:
+case 6881:
+case 6882:
+case 6883:
+case 6884:
+case 6885:
+case 6886:
+case 6887:
+case 6888:
+case 6889:
+case 6890:
+case 6891:
+case 6892:
+case 6893:
+case 6894:
+case 6895:
+case 6896:
+case 6897:
+case 6898:
+case 6899:
+case 6900:
+case 6901:
+case 6902:
+case 6903:
+case 6904:
+case 6905:
+case 6906:
+case 6907:
+case 6908:
+case 6909:
+case 6910:
+case 6911:
+case 6912:
+case 6913:
+case 6914:
+case 6915:
+case 6916:
+case 6917:
+case 6918:
+case 6919:
+case 6920:
+case 6921:
+case 6922:
+case 6923:
+case 6924:
+case 6925:
+case 6926:
+case 6927:
+case 6928:
+case 6929:
+case 6930:
+case 6931:
+case 6932:
+case 6933:
+case 6934:
+case 6935:
+case 6936:
+case 6937:
+case 6938:
+case 6939:
+case 6940:
+case 6941:
+case 6942:
+case 6943:
+case 6944:
+case 6945:
+case 6946:
+case 6947:
+case 6948:
+case 6949:
+case 6950:
+case 6951:
+case 6952:
+case 6953:
+case 6954:
+case 6955:
+case 6956:
+case 6957:
+case 6958:
+case 6959:
+case 6960:
+case 6961:
+case 6962:
+case 6963:
+case 6964:
+case 6965:
+case 6966:
+case 6967:
+case 6968:
+case 6969:
+case 6970:
+case 6971:
+case 6972:
+case 6973:
+case 6974:
+case 6975:
+case 6976:
+case 6977:
+case 6978:
+case 6979:
+case 6980:
+case 6981:
+case 6982:
+case 6983:
+case 6984:
+case 6985:
+case 6986:
+case 6987:
+case 6988:
+case 6989:
+case 6990:
+case 6991:
+case 6992:
+case 6993:
+case 6994:
+case 6995:
+case 6996:
+case 6997:
+case 6998:
+case 6999:
+case 7000:
+case 7001:
+case 7002:
+case 7003:
+case 7004:
+case 7005:
+case 7006:
+case 7007:
+case 7008:
+case 7009:
+case 7010:
+case 7011:
+case 7012:
+case 7013:
+case 7014:
+case 7015:
+case 7016:
+case 7017:
+case 7018:
+case 7019:
+case 7020:
+case 7021:
+case 7022:
+case 7023:
+case 7024:
+case 7025:
+case 7026:
+case 7027:
+case 7028:
+case 7029:
+case 7030:
+case 7031:
+case 7032:
+case 7033:
+case 7034:
+case 7035:
+case 7036:
+case 7037:
+case 7038:
+case 7039:
+case 7040:
+case 7041:
+case 7042:
+case 7043:
+case 7044:
+case 7045:
+case 7046:
+case 7047:
+case 7048:
+case 7049:
+case 7050:
+case 7051:
+case 7052:
+case 7053:
+case 7054:
+case 7055:
+case 7056:
+case 7057:
+case 7058:
+case 7059:
+case 7060:
+case 7061:
+case 7062:
+case 7063:
+case 7064:
+case 7065:
+case 7066:
+case 7067:
+case 7068:
+case 7069:
+case 7070:
+case 7071:
+case 7072:
+case 7073:
+case 7074:
+case 7075:
+case 7076:
+case 7077:
+case 7078:
+case 7079:
+case 7080:
+case 7081:
+case 7082:
+case 7083:
+case 7084:
+case 7085:
+case 7086:
+case 7087:
+case 7088:
+case 7089:
+case 7090:
+case 7091:
+case 7092:
+case 7093:
+case 7094:
+case 7095:
+case 7096:
+case 7097:
+case 7098:
+case 7099:
+case 7100:
+case 7101:
+case 7102:
+case 7103:
+case 7104:
+case 7105:
+case 7106:
+case 7107:
+case 7108:
+case 7109:
+case 7110:
+case 7111:
+case 7112:
+case 7113:
+case 7114:
+case 7115:
+case 7116:
+case 7117:
+case 7118:
+case 7119:
+case 7120:
+case 7121:
+case 7122:
+case 7123:
+case 7124:
+case 7125:
+case 7126:
+case 7127:
+case 7128:
+case 7129:
+case 7130:
+case 7131:
+case 7132:
+case 7133:
+case 7134:
+case 7135:
+case 7136:
+case 7137:
+case 7138:
+case 7139:
+case 7140:
+case 7141:
+case 7142:
+case 7143:
+case 7144:
+case 7145:
+case 7146:
+case 7147:
+case 7148:
+case 7149:
+case 7150:
+case 7151:
+case 7152:
+case 7153:
+case 7154:
+case 7155:
+case 7156:
+case 7157:
+case 7158:
+case 7159:
+case 7160:
+case 7161:
+case 7162:
+case 7163:
+case 7164:
+case 7165:
+case 7166:
+case 7167:
+case 7168:
+case 7169:
+case 7170:
+case 7171:
+case 7172:
+case 7173:
+case 7174:
+case 7175:
+case 7176:
+case 7177:
+case 7178:
+case 7179:
+case 7180:
+case 7181:
+case 7182:
+case 7183:
+case 7184:
+case 7185:
+case 7186:
+case 7187:
+case 7188:
+case 7189:
+case 7190:
+case 7191:
+case 7192:
+case 7193:
+case 7194:
+case 7195:
+case 7196:
+case 7197:
+case 7198:
+case 7199:
+case 7200:
+case 7201:
+case 7202:
+case 7203:
+case 7204:
+case 7205:
+case 7206:
+case 7207:
+case 7208:
+case 7209:
+case 7210:
+case 7211:
+case 7212:
+case 7213:
+case 7214:
+case 7215:
+case 7216:
+case 7217:
+case 7218:
+case 7219:
+case 7220:
+case 7221:
+case 7222:
+case 7223:
+case 7224:
+case 7225:
+case 7226:
+case 7227:
+case 7228:
+case 7229:
+case 7230:
+case 7231:
+case 7232:
+case 7233:
+case 7234:
+case 7235:
+case 7236:
+case 7237:
+case 7238:
+case 7239:
+case 7240:
+case 7241:
+case 7242:
+case 7243:
+case 7244:
+case 7245:
+case 7246:
+case 7247:
+case 7248:
+case 7249:
+case 7250:
+case 7251:
+case 7252:
+case 7253:
+case 7254:
+case 7255:
+case 7256:
+case 7257:
+case 7258:
+case 7259:
+case 7260:
+case 7261:
+case 7262:
+case 7263:
+case 7264:
+case 7265:
+case 7266:
+case 7267:
+case 7268:
+case 7269:
+case 7270:
+case 7271:
+case 7272:
+case 7273:
+case 7274:
+case 7275:
+case 7276:
+case 7277:
+case 7278:
+case 7279:
+case 7280:
+case 7281:
+case 7282:
+case 7283:
+case 7284:
+case 7285:
+case 7286:
+case 7287:
+case 7288:
+case 7289:
+case 7290:
+case 7291:
+case 7292:
+case 7293:
+case 7294:
+case 7295:
+case 7296:
+case 7297:
+case 7298:
+case 7299:
+case 7300:
+case 7301:
+case 7302:
+case 7303:
+case 7304:
+case 7305:
+case 7306:
+case 7307:
+case 7308:
+case 7309:
+case 7310:
+case 7311:
+case 7312:
+case 7313:
+case 7314:
+case 7315:
+case 7316:
+case 7317:
+case 7318:
+case 7319:
+case 7320:
+case 7321:
+case 7322:
+case 7323:
+case 7324:
+case 7325:
+case 7326:
+case 7327:
+case 7328:
+case 7329:
+case 7330:
+case 7331:
+case 7332:
+case 7333:
+case 7334:
+case 7335:
+case 7336:
+case 7337:
+case 7338:
+case 7339:
+case 7340:
+case 7341:
+case 7342:
+case 7343:
+case 7344:
+case 7345:
+case 7346:
+case 7347:
+case 7348:
+case 7349:
+case 7350:
+case 7351:
+case 7352:
+case 7353:
+case 7354:
+case 7355:
+case 7356:
+case 7357:
+case 7358:
+case 7359:
+case 7360:
+case 7361:
+case 7362:
+case 7363:
+case 7364:
+case 7365:
+case 7366:
+case 7367:
+case 7368:
+case 7369:
+case 7370:
+case 7371:
+case 7372:
+case 7373:
+case 7374:
+case 7375:
+case 7376:
+case 7377:
+case 7378:
+case 7379:
+case 7380:
+case 7381:
+case 7382:
+case 7383:
+case 7384:
+case 7385:
+case 7386:
+case 7387:
+case 7388:
+case 7389:
+case 7390:
+case 7391:
+case 7392:
+case 7393:
+case 7394:
+case 7395:
+case 7396:
+case 7397:
+case 7398:
+case 7399:
+case 7400:
+case 7401:
+case 7402:
+case 7403:
+case 7404:
+case 7405:
+case 7406:
+case 7407:
+case 7408:
+case 7409:
+case 7410:
+case 7411:
+case 7412:
+case 7413:
+case 7414:
+case 7415:
+case 7416:
+case 7417:
+case 7418:
+case 7419:
+case 7420:
+case 7421:
+case 7422:
+case 7423:
+case 7424:
+case 7425:
+case 7426:
+case 7427:
+case 7428:
+case 7429:
+case 7430:
+case 7431:
+case 7432:
+case 7433:
+case 7434:
+case 7435:
+case 7436:
+case 7437:
+case 7438:
+case 7439:
+case 7440:
+case 7441:
+case 7442:
+case 7443:
+case 7444:
+case 7445:
+case 7446:
+case 7447:
+case 7448:
+case 7449:
+case 7450:
+case 7451:
+case 7452:
+case 7453:
+case 7454:
+case 7455:
+case 7456:
+case 7457:
+case 7458:
+case 7459:
+case 7460:
+case 7461:
+case 7462:
+case 7463:
+case 7464:
+case 7465:
+case 7466:
+case 7467:
+case 7468:
+case 7469:
+case 7470:
+case 7471:
+case 7472:
+case 7473:
+case 7474:
+case 7475:
+case 7476:
+case 7477:
+case 7478:
+case 7479:
+case 7480:
+case 7481:
+case 7482:
+case 7483:
+case 7484:
+case 7485:
+case 7486:
+case 7487:
+case 7488:
+case 7489:
+case 7490:
+case 7491:
+case 7492:
+case 7493:
+case 7494:
+case 7495:
+case 7496:
+case 7497:
+case 7498:
+case 7499:
+case 7500:
+case 7501:
+case 7502:
+case 7503:
+case 7504:
+case 7505:
+case 7506:
+case 7507:
+case 7508:
+case 7509:
+case 7510:
+case 7511:
+case 7512:
+case 7513:
+case 7514:
+case 7515:
+case 7516:
+case 7517:
+case 7518:
+case 7519:
+case 7520:
+case 7521:
+case 7522:
+case 7523:
+case 7524:
+case 7525:
+case 7526:
+case 7527:
+case 7528:
+case 7529:
+case 7530:
+case 7531:
+case 7532:
+case 7533:
+case 7534:
+case 7535:
+case 7536:
+case 7537:
+case 7538:
+case 7539:
+case 7540:
+case 7541:
+case 7542:
+case 7543:
+case 7544:
+case 7545:
+case 7546:
+case 7547:
+case 7548:
+case 7549:
+case 7550:
+case 7551:
+case 7552:
+case 7553:
+case 7554:
+case 7555:
+case 7556:
+case 7557:
+case 7558:
+case 7559:
+case 7560:
+case 7561:
+case 7562:
+case 7563:
+case 7564:
+case 7565:
+case 7566:
+case 7567:
+case 7568:
+case 7569:
+case 7570:
+case 7571:
+case 7572:
+case 7573:
+case 7574:
+case 7575:
+case 7576:
+case 7577:
+case 7578:
+case 7579:
+case 7580:
+case 7581:
+case 7582:
+case 7583:
+case 7584:
+case 7585:
+case 7586:
+case 7587:
+case 7588:
+case 7589:
+case 7590:
+case 7591:
+case 7592:
+case 7593:
+case 7594:
+case 7595:
+case 7596:
+case 7597:
+case 7598:
+case 7599:
+case 7600:
+case 7601:
+case 7602:
+case 7603:
+case 7604:
+case 7605:
+case 7606:
+case 7607:
+case 7608:
+case 7609:
+case 7610:
+case 7611:
+case 7612:
+case 7613:
+case 7614:
+case 7615:
+case 7616:
+case 7617:
+case 7618:
+case 7619:
+case 7620:
+case 7621:
+case 7622:
+case 7623:
+case 7624:
+case 7625:
+case 7626:
+case 7627:
+case 7628:
+case 7629:
+case 7630:
+case 7631:
+case 7632:
+case 7633:
+case 7634:
+case 7635:
+case 7636:
+case 7637:
+case 7638:
+case 7639:
+case 7640:
+case 7641:
+case 7642:
+case 7643:
+case 7644:
+case 7645:
+case 7646:
+case 7647:
+case 7648:
+case 7649:
+case 7650:
+case 7651:
+case 7652:
+case 7653:
+case 7654:
+case 7655:
+case 7656:
+case 7657:
+case 7658:
+case 7659:
+case 7660:
+case 7661:
+case 7662:
+case 7663:
+case 7664:
+case 7665:
+case 7666:
+case 7667:
+case 7668:
+case 7669:
+case 7670:
+case 7671:
+case 7672:
+case 7673:
+case 7674:
+case 7675:
+case 7676:
+case 7677:
+case 7678:
+case 7679:
+case 7680:
+case 7681:
+case 7682:
+case 7683:
+case 7684:
+case 7685:
+case 7686:
+case 7687:
+case 7688:
+case 7689:
+case 7690:
+case 7691:
+case 7692:
+case 7693:
+case 7694:
+case 7695:
+case 7696:
+case 7697:
+case 7698:
+case 7699:
+case 7700:
+case 7701:
+case 7702:
+case 7703:
+case 7704:
+case 7705:
+case 7706:
+case 7707:
+case 7708:
+case 7709:
+case 7710:
+case 7711:
+case 7712:
+case 7713:
+case 7714:
+case 7715:
+case 7716:
+case 7717:
+case 7718:
+case 7719:
+case 7720:
+case 7721:
+case 7722:
+case 7723:
+case 7724:
+case 7725:
+case 7726:
+case 7727:
+case 7728:
+case 7729:
+case 7730:
+case 7731:
+case 7732:
+case 7733:
+case 7734:
+case 7735:
+case 7736:
+case 7737:
+case 7738:
+case 7739:
+case 7740:
+case 7741:
+case 7742:
+case 7743:
+case 7744:
+case 7745:
+case 7746:
+case 7747:
+case 7748:
+case 7749:
+case 7750:
+case 7751:
+case 7752:
+case 7753:
+case 7754:
+case 7755:
+case 7756:
+case 7757:
+case 7758:
+case 7759:
+case 7760:
+case 7761:
+case 7762:
+case 7763:
+case 7764:
+case 7765:
+case 7766:
+case 7767:
+case 7768:
+case 7769:
+case 7770:
+case 7771:
+case 7772:
+case 7773:
+case 7774:
+case 7775:
+case 7776:
+case 7777:
+case 7778:
+case 7779:
+case 7780:
+case 7781:
+case 7782:
+case 7783:
+case 7784:
+case 7785:
+case 7786:
+case 7787:
+case 7788:
+case 7789:
+case 7790:
+case 7791:
+case 7792:
+case 7793:
+case 7794:
+case 7795:
+case 7796:
+case 7797:
+case 7798:
+case 7799:
+case 7800:
+case 7801:
+case 7802:
+case 7803:
+case 7804:
+case 7805:
+case 7806:
+case 7807:
+case 7808:
+case 7809:
+case 7810:
+case 7811:
+case 7812:
+case 7813:
+case 7814:
+case 7815:
+case 7816:
+case 7817:
+case 7818:
+case 7819:
+case 7820:
+case 7821:
+case 7822:
+case 7823:
+case 7824:
+case 7825:
+case 7826:
+case 7827:
+case 7828:
+case 7829:
+case 7830:
+case 7831:
+case 7832:
+case 7833:
+case 7834:
+case 7835:
+case 7836:
+case 7837:
+case 7838:
+case 7839:
+case 7840:
+case 7841:
+case 7842:
+case 7843:
+case 7844:
+case 7845:
+case 7846:
+case 7847:
+case 7848:
+case 7849:
+case 7850:
+case 7851:
+case 7852:
+case 7853:
+case 7854:
+case 7855:
+case 7856:
+case 7857:
+case 7858:
+case 7859:
+case 7860:
+case 7861:
+case 7862:
+case 7863:
+case 7864:
+case 7865:
+case 7866:
+case 7867:
+case 7868:
+case 7869:
+case 7870:
+case 7871:
+case 7872:
+case 7873:
+case 7874:
+case 7875:
+case 7876:
+case 7877:
+case 7878:
+case 7879:
+case 7880:
+case 7881:
+case 7882:
+case 7883:
+case 7884:
+case 7885:
+case 7886:
+case 7887:
+case 7888:
+case 7889:
+case 7890:
+case 7891:
+case 7892:
+case 7893:
+case 7894:
+case 7895:
+case 7896:
+case 7897:
+case 7898:
+case 7899:
+case 7900:
+case 7901:
+case 7902:
+case 7903:
+case 7904:
+case 7905:
+case 7906:
+case 7907:
+case 7908:
+case 7909:
+case 7910:
+case 7911:
+case 7912:
+case 7913:
+case 7914:
+case 7915:
+case 7916:
+case 7917:
+case 7918:
+case 7919:
+case 7920:
+case 7921:
+case 7922:
+case 7923:
+case 7924:
+case 7925:
+case 7926:
+case 7927:
+case 7928:
+case 7929:
+case 7930:
+case 7931:
+case 7932:
+case 7933:
+case 7934:
+case 7935:
+case 7936:
+case 7937:
+case 7938:
+case 7939:
+case 7940:
+case 7941:
+case 7942:
+case 7943:
+case 7944:
+case 7945:
+case 7946:
+case 7947:
+case 7948:
+case 7949:
+case 7950:
+case 7951:
+case 7952:
+case 7953:
+case 7954:
+case 7955:
+case 7956:
+case 7957:
+case 7958:
+case 7959:
+case 7960:
+case 7961:
+case 7962:
+case 7963:
+case 7964:
+case 7965:
+case 7966:
+case 7967:
+case 7968:
+case 7969:
+case 7970:
+case 7971:
+case 7972:
+case 7973:
+case 7974:
+case 7975:
+case 7976:
+case 7977:
+case 7978:
+case 7979:
+case 7980:
+case 7981:
+case 7982:
+case 7983:
+case 7984:
+case 7985:
+case 7986:
+case 7987:
+case 7988:
+case 7989:
+case 7990:
+case 7991:
+case 7992:
+case 7993:
+case 7994:
+case 7995:
+case 7996:
+case 7997:
+case 7998:
+case 7999:
+case 8000:
+case 8001:
+case 8002:
+case 8003:
+case 8004:
+case 8005:
+case 8006:
+case 8007:
+case 8008:
+case 8009:
+case 8010:
+case 8011:
+case 8012:
+case 8013:
+case 8014:
+case 8015:
+case 8016:
+case 8017:
+case 8018:
+case 8019:
+case 8020:
+case 8021:
+case 8022:
+case 8023:
+case 8024:
+case 8025:
+case 8026:
+case 8027:
+case 8028:
+case 8029:
+case 8030:
+case 8031:
+case 8032:
+case 8033:
+case 8034:
+case 8035:
+case 8036:
+case 8037:
+case 8038:
+case 8039:
+case 8040:
+case 8041:
+case 8042:
+case 8043:
+case 8044:
+case 8045:
+case 8046:
+case 8047:
+case 8048:
+case 8049:
+case 8050:
+case 8051:
+case 8052:
+case 8053:
+case 8054:
+case 8055:
+case 8056:
+case 8057:
+case 8058:
+case 8059:
+case 8060:
+case 8061:
+case 8062:
+case 8063:
+case 8064:
+case 8065:
+case 8066:
+case 8067:
+case 8068:
+case 8069:
+case 8070:
+case 8071:
+case 8072:
+case 8073:
+case 8074:
+case 8075:
+case 8076:
+case 8077:
+case 8078:
+case 8079:
+case 8080:
+case 8081:
+case 8082:
+case 8083:
+case 8084:
+case 8085:
+case 8086:
+case 8087:
+case 8088:
+case 8089:
+case 8090:
+case 8091:
+case 8092:
+case 8093:
+case 8094:
+case 8095:
+case 8096:
+case 8097:
+case 8098:
+case 8099:
+case 8100:
+case 8101:
+case 8102:
+case 8103:
+case 8104:
+case 8105:
+case 8106:
+case 8107:
+case 8108:
+case 8109:
+case 8110:
+case 8111:
+case 8112:
+case 8113:
+case 8114:
+case 8115:
+case 8116:
+case 8117:
+case 8118:
+case 8119:
+case 8120:
+case 8121:
+case 8122:
+case 8123:
+case 8124:
+case 8125:
+case 8126:
+case 8127:
+case 8128:
+case 8129:
+case 8130:
+case 8131:
+case 8132:
+case 8133:
+case 8134:
+case 8135:
+case 8136:
+case 8137:
+case 8138:
+case 8139:
+case 8140:
+case 8141:
+case 8142:
+case 8143:
+case 8144:
+case 8145:
+case 8146:
+case 8147:
+case 8148:
+case 8149:
+case 8150:
+case 8151:
+case 8152:
+case 8153:
+case 8154:
+case 8155:
+case 8156:
+case 8157:
+case 8158:
+case 8159:
+case 8160:
+case 8161:
+case 8162:
+case 8163:
+case 8164:
+case 8165:
+case 8166:
+case 8167:
+case 8168:
+case 8169:
+case 8170:
+case 8171:
+case 8172:
+case 8173:
+case 8174:
+case 8175:
+case 8176:
+case 8177:
+case 8178:
+case 8179:
+case 8180:
+case 8181:
+case 8182:
+case 8183:
+case 8184:
+case 8185:
+case 8186:
+case 8187:
+case 8188:
+case 8189:
+case 8190:
+case 8191:
+case 8192:
+case 8193:
+case 8194:
+case 8195:
+case 8196:
+case 8197:
+case 8198:
+case 8199:
+case 8200:
+case 8201:
+case 8202:
+case 8203:
+case 8204:
+case 8205:
+case 8206:
+case 8207:
+case 8208:
+case 8209:
+case 8210:
+case 8211:
+case 8212:
+case 8213:
+case 8214:
+case 8215:
+case 8216:
+case 8217:
+case 8218:
+case 8219:
+case 8220:
+case 8221:
+case 8222:
+case 8223:
+case 8224:
+case 8225:
+case 8226:
+case 8227:
+case 8228:
+case 8229:
+case 8230:
+case 8231:
+case 8232:
+case 8233:
+case 8234:
+case 8235:
+case 8236:
+case 8237:
+case 8238:
+case 8239:
+case 8240:
+case 8241:
+case 8242:
+case 8243:
+case 8244:
+case 8245:
+case 8246:
+case 8247:
+case 8248:
+case 8249:
+case 8250:
+case 8251:
+case 8252:
+case 8253:
+case 8254:
+case 8255:
+case 8256:
+case 8257:
+case 8258:
+case 8259:
+case 8260:
+case 8261:
+case 8262:
+case 8263:
+case 8264:
+case 8265:
+case 8266:
+case 8267:
+case 8268:
+case 8269:
+case 8270:
+case 8271:
+case 8272:
+case 8273:
+case 8274:
+case 8275:
+case 8276:
+case 8277:
+case 8278:
+case 8279:
+case 8280:
+case 8281:
+case 8282:
+case 8283:
+case 8284:
+case 8285:
+case 8286:
+case 8287:
+case 8288:
+case 8289:
+case 8290:
+case 8291:
+case 8292:
+case 8293:
+case 8294:
+case 8295:
+case 8296:
+case 8297:
+case 8298:
+case 8299:
+case 8300:
+case 8301:
+case 8302:
+case 8303:
+case 8304:
+case 8305:
+case 8306:
+case 8307:
+case 8308:
+case 8309:
+case 8310:
+case 8311:
+case 8312:
+case 8313:
+case 8314:
+case 8315:
+case 8316:
+case 8317:
+case 8318:
+case 8319:
+case 8320:
+case 8321:
+case 8322:
+case 8323:
+case 8324:
+case 8325:
+case 8326:
+case 8327:
+case 8328:
+case 8329:
+case 8330:
+case 8331:
+case 8332:
+case 8333:
+case 8334:
+case 8335:
+case 8336:
+case 8337:
+case 8338:
+case 8339:
+case 8340:
+case 8341:
+case 8342:
+case 8343:
+case 8344:
+case 8345:
+case 8346:
+case 8347:
+case 8348:
+case 8349:
+case 8350:
+case 8351:
+case 8352:
+case 8353:
+case 8354:
+case 8355:
+case 8356:
+case 8357:
+case 8358:
+case 8359:
+case 8360:
+case 8361:
+case 8362:
+case 8363:
+case 8364:
+case 8365:
+case 8366:
+case 8367:
+case 8368:
+case 8369:
+case 8370:
+case 8371:
+case 8372:
+case 8373:
+case 8374:
+case 8375:
+case 8376:
+case 8377:
+case 8378:
+case 8379:
+case 8380:
+case 8381:
+case 8382:
+case 8383:
+case 8384:
+case 8385:
+case 8386:
+case 8387:
+case 8388:
+case 8389:
+case 8390:
+case 8391:
+case 8392:
+case 8393:
+case 8394:
+case 8395:
+case 8396:
+case 8397:
+case 8398:
+case 8399:
+case 8400:
+case 8401:
+case 8402:
+case 8403:
+case 8404:
+case 8405:
+case 8406:
+case 8407:
+case 8408:
+case 8409:
+case 8410:
+case 8411:
+case 8412:
+case 8413:
+case 8414:
+case 8415:
+case 8416:
+case 8417:
+case 8418:
+case 8419:
+case 8420:
+case 8421:
+case 8422:
+case 8423:
+case 8424:
+case 8425:
+case 8426:
+case 8427:
+case 8428:
+case 8429:
+case 8430:
+case 8431:
+case 8432:
+case 8433:
+case 8434:
+case 8435:
+case 8436:
+case 8437:
+case 8438:
+case 8439:
+case 8440:
+case 8441:
+case 8442:
+case 8443:
+case 8444:
+case 8445:
+case 8446:
+case 8447:
+case 8448:
+case 8449:
+case 8450:
+case 8451:
+case 8452:
+case 8453:
+case 8454:
+case 8455:
+case 8456:
+case 8457:
+case 8458:
+case 8459:
+case 8460:
+case 8461:
+case 8462:
+case 8463:
+case 8464:
+case 8465:
+case 8466:
+case 8467:
+case 8468:
+case 8469:
+case 8470:
+case 8471:
+case 8472:
+case 8473:
+case 8474:
+case 8475:
+case 8476:
+case 8477:
+case 8478:
+case 8479:
+case 8480:
+case 8481:
+case 8482:
+case 8483:
+case 8484:
+case 8485:
+case 8486:
+case 8487:
+case 8488:
+case 8489:
+case 8490:
+case 8491:
+case 8492:
+case 8493:
+case 8494:
+case 8495:
+case 8496:
+case 8497:
+case 8498:
+case 8499:
+case 8500:
+case 8501:
+case 8502:
+case 8503:
+case 8504:
+case 8505:
+case 8506:
+case 8507:
+case 8508:
+case 8509:
+case 8510:
+case 8511:
+case 8512:
+case 8513:
+case 8514:
+case 8515:
+case 8516:
+case 8517:
+case 8518:
+case 8519:
+case 8520:
+case 8521:
+case 8522:
+case 8523:
+case 8524:
+case 8525:
+case 8526:
+case 8527:
+case 8528:
+case 8529:
+case 8530:
+case 8531:
+case 8532:
+case 8533:
+case 8534:
+case 8535:
+case 8536:
+case 8537:
+case 8538:
+case 8539:
+case 8540:
+case 8541:
+case 8542:
+case 8543:
+case 8544:
+case 8545:
+case 8546:
+case 8547:
+case 8548:
+case 8549:
+case 8550:
+case 8551:
+case 8552:
+case 8553:
+case 8554:
+case 8555:
+case 8556:
+case 8557:
+case 8558:
+case 8559:
+case 8560:
+case 8561:
+case 8562:
+case 8563:
+case 8564:
+case 8565:
+case 8566:
+case 8567:
+case 8568:
+case 8569:
+case 8570:
+case 8571:
+case 8572:
+case 8573:
+case 8574:
+case 8575:
+case 8576:
+case 8577:
+case 8578:
+case 8579:
+case 8580:
+case 8581:
+case 8582:
+case 8583:
+case 8584:
+case 8585:
+case 8586:
+case 8587:
+case 8588:
+case 8589:
+case 8590:
+case 8591:
+case 8592:
+case 8593:
+case 8594:
+case 8595:
+case 8596:
+case 8597:
+case 8598:
+case 8599:
+case 8600:
+case 8601:
+case 8602:
+case 8603:
+case 8604:
+case 8605:
+case 8606:
+case 8607:
+case 8608:
+case 8609:
+case 8610:
+case 8611:
+case 8612:
+case 8613:
+case 8614:
+case 8615:
+case 8616:
+case 8617:
+case 8618:
+case 8619:
+case 8620:
+case 8621:
+case 8622:
+case 8623:
+case 8624:
+case 8625:
+case 8626:
+case 8627:
+case 8628:
+case 8629:
+case 8630:
+case 8631:
+case 8632:
+case 8633:
+case 8634:
+case 8635:
+case 8636:
+case 8637:
+case 8638:
+case 8639:
+case 8640:
+case 8641:
+case 8642:
+case 8643:
+case 8644:
+case 8645:
+case 8646:
+case 8647:
+case 8648:
+case 8649:
+case 8650:
+case 8651:
+case 8652:
+case 8653:
+case 8654:
+case 8655:
+case 8656:
+case 8657:
+case 8658:
+case 8659:
+case 8660:
+case 8661:
+case 8662:
+case 8663:
+case 8664:
+case 8665:
+case 8666:
+case 8667:
+case 8668:
+case 8669:
+case 8670:
+case 8671:
+case 8672:
+case 8673:
+case 8674:
+case 8675:
+case 8676:
+case 8677:
+case 8678:
+case 8679:
+case 8680:
+case 8681:
+case 8682:
+case 8683:
+case 8684:
+case 8685:
+case 8686:
+case 8687:
+case 8688:
+case 8689:
+case 8690:
+case 8691:
+case 8692:
+case 8693:
+case 8694:
+case 8695:
+case 8696:
+case 8697:
+case 8698:
+case 8699:
+case 8700:
+case 8701:
+case 8702:
+case 8703:
+case 8704:
+case 8705:
+case 8706:
+case 8707:
+case 8708:
+case 8709:
+case 8710:
+case 8711:
+case 8712:
+case 8713:
+case 8714:
+case 8715:
+case 8716:
+case 8717:
+case 8718:
+case 8719:
+case 8720:
+case 8721:
+case 8722:
+case 8723:
+case 8724:
+case 8725:
+case 8726:
+case 8727:
+case 8728:
+case 8729:
+case 8730:
+case 8731:
+case 8732:
+case 8733:
+case 8734:
+case 8735:
+case 8736:
+case 8737:
+case 8738:
+case 8739:
+case 8740:
+case 8741:
+case 8742:
+case 8743:
+case 8744:
+case 8745:
+case 8746:
+case 8747:
+case 8748:
+case 8749:
+case 8750:
+case 8751:
+case 8752:
+case 8753:
+case 8754:
+case 8755:
+case 8756:
+case 8757:
+case 8758:
+case 8759:
+case 8760:
+case 8761:
+case 8762:
+case 8763:
+case 8764:
+case 8765:
+case 8766:
+case 8767:
+case 8768:
+case 8769:
+case 8770:
+case 8771:
+case 8772:
+case 8773:
+case 8774:
+case 8775:
+case 8776:
+case 8777:
+case 8778:
+case 8779:
+case 8780:
+case 8781:
+case 8782:
+case 8783:
+case 8784:
+case 8785:
+case 8786:
+case 8787:
+case 8788:
+case 8789:
+case 8790:
+case 8791:
+case 8792:
+case 8793:
+case 8794:
+case 8795:
+case 8796:
+case 8797:
+case 8798:
+case 8799:
+case 8800:
+case 8801:
+case 8802:
+case 8803:
+case 8804:
+case 8805:
+case 8806:
+case 8807:
+case 8808:
+case 8809:
+case 8810:
+case 8811:
+case 8812:
+case 8813:
+case 8814:
+case 8815:
+case 8816:
+case 8817:
+case 8818:
+case 8819:
+case 8820:
+case 8821:
+case 8822:
+case 8823:
+case 8824:
+case 8825:
+case 8826:
+case 8827:
+case 8828:
+case 8829:
+case 8830:
+case 8831:
+case 8832:
+case 8833:
+case 8834:
+case 8835:
+case 8836:
+case 8837:
+case 8838:
+case 8839:
+case 8840:
+case 8841:
+case 8842:
+case 8843:
+case 8844:
+case 8845:
+case 8846:
+case 8847:
+case 8848:
+case 8849:
+case 8850:
+case 8851:
+case 8852:
+case 8853:
+case 8854:
+case 8855:
+case 8856:
+case 8857:
+case 8858:
+case 8859:
+case 8860:
+case 8861:
+case 8862:
+case 8863:
+case 8864:
+case 8865:
+case 8866:
+case 8867:
+case 8868:
+case 8869:
+case 8870:
+case 8871:
+case 8872:
+case 8873:
+case 8874:
+case 8875:
+case 8876:
+case 8877:
+case 8878:
+case 8879:
+case 8880:
+case 8881:
+case 8882:
+case 8883:
+case 8884:
+case 8885:
+case 8886:
+case 8887:
+case 8888:
+case 8889:
+case 8890:
+case 8891:
+case 8892:
+case 8893:
+case 8894:
+case 8895:
+case 8896:
+case 8897:
+case 8898:
+case 8899:
+case 8900:
+case 8901:
+case 8902:
+case 8903:
+case 8904:
+case 8905:
+case 8906:
+case 8907:
+case 8908:
+case 8909:
+case 8910:
+case 8911:
+case 8912:
+case 8913:
+case 8914:
+case 8915:
+case 8916:
+case 8917:
+case 8918:
+case 8919:
+case 8920:
+case 8921:
+case 8922:
+case 8923:
+case 8924:
+case 8925:
+case 8926:
+case 8927:
+case 8928:
+case 8929:
+case 8930:
+case 8931:
+case 8932:
+case 8933:
+case 8934:
+case 8935:
+case 8936:
+case 8937:
+case 8938:
+case 8939:
+case 8940:
+case 8941:
+case 8942:
+case 8943:
+case 8944:
+case 8945:
+case 8946:
+case 8947:
+case 8948:
+case 8949:
+case 8950:
+case 8951:
+case 8952:
+case 8953:
+case 8954:
+case 8955:
+case 8956:
+case 8957:
+case 8958:
+case 8959:
+case 8960:
+case 8961:
+case 8962:
+case 8963:
+case 8964:
+case 8965:
+case 8966:
+case 8967:
+case 8968:
+case 8969:
+case 8970:
+case 8971:
+case 8972:
+case 8973:
+case 8974:
+case 8975:
+case 8976:
+case 8977:
+case 8978:
+case 8979:
+case 8980:
+case 8981:
+case 8982:
+case 8983:
+case 8984:
+case 8985:
+case 8986:
+case 8987:
+case 8988:
+case 8989:
+case 8990:
+case 8991:
+case 8992:
+case 8993:
+case 8994:
+case 8995:
+case 8996:
+case 8997:
+case 8998:
+case 8998: // DUPLICATE LABEL
+ actual += 'a';
+case 8999:
+ actual += 'b';
+}
+expect = 'ab';
+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 < UBound; i++)
+ {
+ reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
+ }
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-83532-001.js b/tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-83532-001.js
new file mode 100644
index 0000000000..8e2bb6b010
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-83532-001.js
@@ -0,0 +1,71 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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 June 2001
+ *
+ * SUMMARY: Testing that we don't crash on switch case -1...
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=83532
+ *
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-83532-001.js';
+var BUGNUMBER = 83532;
+var summary = "Testing that we don't crash on switch case -1";
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ // Just testing that we don't crash on these -
+ function f () {switch(1) {case -1:}}
+ function g(){switch(1){case (-1):}}
+ var h = function() {switch(1) {case -1:}}
+ f();
+ g();
+ h();
+ reportCompare('No Crash', 'No Crash', '');
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-83532-002.js b/tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-83532-002.js
new file mode 100644
index 0000000000..3bd5ce8703
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Statements/regress-83532-002.js
@@ -0,0 +1,74 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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 June 2001
+ *
+ * SUMMARY: Testing that we don't crash on switch case -1...
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=83532
+ *
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-83532-002.js';
+var BUGNUMBER = 83532;
+var summary = "Testing that we don't crash on switch case -1";
+var sToEval = '';
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ // Just testing that we don't crash on these -
+ sToEval += 'function f () {switch(1) {case -1:}};';
+ sToEval += 'function g(){switch(1){case (-1):}};';
+ sToEval += 'var h = function() {switch(1) {case -1:}};'
+ sToEval += 'f();';
+ sToEval += 'g();';
+ sToEval += 'h();';
+ eval(sToEval);
+
+ reportCompare('No Crash', 'No Crash', '');
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Statements/shell.js b/tests/auto/qml/parserstress/tests/ecma_3/Statements/shell.js
new file mode 100644
index 0000000000..7346f697a5
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Statements/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'Statements';
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Statements/switch-001.js b/tests/auto/qml/parserstress/tests/ecma_3/Statements/switch-001.js
new file mode 100644
index 0000000000..aae6659cc1
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Statements/switch-001.js
@@ -0,0 +1,143 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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: 07 May 2001
+ *
+ * SUMMARY: Testing the switch statement
+ *
+ * See ECMA3 Section 12.11, "The switch Statement"
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'switch-001.js';
+var UBound = 0;
+var BUGNUMBER = '(none)';
+var summary = 'Testing the switch statement';
+var cnMatch = 'Match';
+var cnNoMatch = 'NoMatch';
+var status = '';
+var statusitems = [ ];
+var actual = '';
+var actualvalues = [ ];
+var expect= '';
+var expectedvalues = [ ];
+
+
+status = 'Section A of test';
+actual = match(17, f(fInverse(17)), f, fInverse);
+expect = cnMatch;
+addThis();
+
+status = 'Section B of test';
+actual = match(17, 18, f, fInverse);
+expect = cnNoMatch;
+addThis();
+
+status = 'Section C of test';
+actual = match(1, 1, Math.exp, Math.log);
+expect = cnMatch;
+addThis();
+
+status = 'Section D of test';
+actual = match(1, 2, Math.exp, Math.log);
+expect = cnNoMatch;
+addThis();
+
+status = 'Section E of test';
+actual = match(1, 1, Math.sin, Math.cos);
+expect = cnNoMatch;
+addThis();
+
+
+
+//---------------------------------------------------------------------------------
+test();
+//---------------------------------------------------------------------------------
+
+
+
+/*
+ * If F,G are inverse functions and x==y, this should return cnMatch -
+ */
+function match(x, y, F, G)
+{
+ switch (x)
+ {
+ case F(G(y)):
+ return cnMatch;
+
+ default:
+ return cnNoMatch;
+ }
+}
+
+
+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');
+}
+
+
+function f(m)
+{
+ return 2*(m+1);
+}
+
+
+function fInverse(n)
+{
+ return (n-2)/2;
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/String/15.5.4.11.js b/tests/auto/qml/parserstress/tests/ecma_3/String/15.5.4.11.js
new file mode 100644
index 0000000000..ef518bb9e5
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/String/15.5.4.11.js
@@ -0,0 +1,532 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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):
+ * <x00000000@freenet.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 ***** */
+
+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/qml/parserstress/tests/ecma_3/String/15.5.4.14.js b/tests/auto/qml/parserstress/tests/ecma_3/String/15.5.4.14.js
new file mode 100644
index 0000000000..aa6c7354c2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/String/15.5.4.14.js
@@ -0,0 +1,50 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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 <spiff@phreax.net>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient 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/qml/parserstress/tests/ecma_3/String/browser.js b/tests/auto/qml/parserstress/tests/ecma_3/String/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/String/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/String/regress-104375.js b/tests/auto/qml/parserstress/tests/ecma_3/String/regress-104375.js
new file mode 100644
index 0000000000..c5593948d7
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/String/regress-104375.js
@@ -0,0 +1,116 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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<UBound; i++)
+ {
+ reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
+ }
+
+ exitFunc ('test');
+}
+
+
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/String/regress-189898.js b/tests/auto/qml/parserstress/tests/ecma_3/String/regress-189898.js
new file mode 100644
index 0000000000..c75c081513
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/String/regress-189898.js
@@ -0,0 +1,157 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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@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: 21 January 2003
+ * SUMMARY: Regression test for bug 189898
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=189898
+ *
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-189898.js';
+var UBound = 0;
+var BUGNUMBER = 189898;
+var summary = 'Regression test for bug 189898';
+var status = '';
+var statusitems = [];
+var actual = '';
+var actualvalues = [];
+var expect= '';
+var expectedvalues = [];
+
+
+status = inSection(1);
+actual = 'XaXY'.replace('XY', '--')
+ expect = 'Xa--';
+addThis();
+
+status = inSection(2);
+actual = '$a$^'.replace('$^', '--')
+ expect = '$a--';
+addThis();
+
+status = inSection(3);
+actual = 'ababc'.replace('abc', '--')
+ expect = 'ab--';
+addThis();
+
+status = inSection(4);
+actual = 'ababc'.replace('abc', '^$')
+ expect = 'ab^$';
+addThis();
+
+
+
+/*
+ * Same as above, but providing a regexp in the first parameter
+ * to String.prototype.replace() instead of a string.
+ *
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=83293
+ * for subtleties on this issue -
+ */
+status = inSection(5);
+actual = 'XaXY'.replace(/XY/, '--')
+ expect = 'Xa--';
+addThis();
+
+status = inSection(6);
+actual = 'XaXY'.replace(/XY/g, '--')
+ expect = 'Xa--';
+addThis();
+
+status = inSection(7);
+actual = '$a$^'.replace(/\$\^/, '--')
+ expect = '$a--';
+addThis();
+
+status = inSection(8);
+actual = '$a$^'.replace(/\$\^/g, '--')
+ expect = '$a--';
+addThis();
+
+status = inSection(9);
+actual = 'ababc'.replace(/abc/, '--')
+ expect = 'ab--';
+addThis();
+
+status = inSection(10);
+actual = 'ababc'.replace(/abc/g, '--')
+ expect = 'ab--';
+addThis();
+
+status = inSection(11);
+actual = 'ababc'.replace(/abc/, '^$')
+ expect = 'ab^$';
+addThis();
+
+status = inSection(12);
+actual = 'ababc'.replace(/abc/g, '^$')
+ expect = 'ab^$';
+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<UBound; i++)
+ {
+ reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
+ }
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/String/regress-304376.js b/tests/auto/qml/parserstress/tests/ecma_3/String/regress-304376.js
new file mode 100755
index 0000000000..733cd713d8
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/String/regress-304376.js
@@ -0,0 +1,68 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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): Blake Kaplan
+ * 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-304376.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 304376;
+var summary = 'String.prototype should be readonly and permanent';
+var actual = '';
+var expect = '';
+printBugNumber(BUGNUMBER);
+printStatus (summary);
+
+expect = 'TypeError';
+
+var saveString = String;
+
+String = Array;
+
+try
+{
+ // see if we can crash...
+ "".join();
+ String = saveString;
+ actual = 'No Error';
+}
+catch(ex)
+{
+ String = saveString;
+ actual = ex.name;
+ printStatus(ex + '');
+}
+
+reportCompare(expect, actual, summary);
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/String/regress-313567.js b/tests/auto/qml/parserstress/tests/ecma_3/String/regress-313567.js
new file mode 100755
index 0000000000..9610238cc3
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/String/regress-313567.js
@@ -0,0 +1,56 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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 = 'regress-313567.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 313567;
+var summary = 'String.prototype.length should not be generic';
+var actual = '';
+var expect = '';
+
+printBugNumber(BUGNUMBER);
+printStatus (summary);
+
+var s = new String("1");
+s.toString = function() {
+ return "22";
+}
+ var expect = 1;
+var actual = s.length;
+printStatus("expect="+expect+" actual="+actual);
+
+reportCompare(expect, actual, summary);
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/String/regress-392378.js b/tests/auto/qml/parserstress/tests/ecma_3/String/regress-392378.js
new file mode 100755
index 0000000000..368fde1278
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/String/regress-392378.js
@@ -0,0 +1,77 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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 ***** */
+
+var gTestfile = 'regress-392378.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 392378;
+var summary = 'Regular Expression Non-participating Capture Groups are inaccurate in edge cases';
+var actual = '';
+var expect = '';
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ expect = ["", undefined, ""] + '';
+ actual = "y".split(/(x)?\1y/) + '';
+ reportCompare(expect, actual, summary + ': "y".split(/(x)?\1y/)');
+
+ expect = ["", undefined, ""] + '';
+ actual = "y".split(/(x)?y/) + '';
+ reportCompare(expect, actual, summary + ': "y".split(/(x)?y/)');
+
+ expect = 'undefined';
+ actual = "y".replace(/(x)?\1y/, function($0, $1){ return String($1); }) + '';
+ reportCompare(expect, actual, summary + ': "y".replace(/(x)?\\1y/, function($0, $1){ return String($1); })');
+
+ expect = 'undefined';
+ actual = "y".replace(/(x)?y/, function($0, $1){ return String($1); }) + '';
+ reportCompare(expect, actual, summary + ': "y".replace(/(x)?y/, function($0, $1){ return String($1); })');
+
+ expect = 'undefined';
+ actual = "y".replace(/(x)?y/, function($0, $1){ return $1; }) + '';
+ reportCompare(expect, actual, summary + ': "y".replace(/(x)?y/, function($0, $1){ return $1; })');
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/String/regress-83293.js b/tests/auto/qml/parserstress/tests/ecma_3/String/regress-83293.js
new file mode 100644
index 0000000000..55e74d4dd5
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/String/regress-83293.js
@@ -0,0 +1,216 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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, jim@jibbering.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-83293.js';
+
+/*
+ * Creation Date: 30 May 2001
+ * Correction Date: 14 Aug 2001
+ *
+ * SUMMARY: Regression test for bugs 83293, 103351
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=83293
+ * http://bugzilla.mozilla.org/show_bug.cgi?id=103351
+ * http://bugzilla.mozilla.org/show_bug.cgi?id=92942
+ *
+ *
+ * ******************** CORRECTION !!! *****************************
+ *
+ * When I originally wrote this test, I thought this was true:
+ * str.replace(strA, strB) == str.replace(new RegExp(strA),strB).
+ * See ECMA-262 Final Draft, 15.5.4.11 String.prototype.replace
+ *
+ * However, in http://bugzilla.mozilla.org/show_bug.cgi?id=83293
+ * Jim Ley points out the ECMA-262 Final Edition changed on this.
+ * String.prototype.replace (searchValue, replaceValue), if provided
+ * a searchValue that is not a RegExp, is NO LONGER to replace it with
+ *
+ * new RegExp(searchValue)
+ * but rather:
+ * String(searchValue)
+ *
+ * This puts the replace() method at variance with search() and match(),
+ * which continue to follow the RegExp conversion of the Final Draft.
+ * It also makes most of this testcase, as originally written, invalid.
+ **********************************************************************
+ */
+
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 103351; // <--- (Outgrowth of original bug 83293)
+var summ_OLD = 'Testing str.replace(strA, strB) == str.replace(new RegExp(strA),strB)';
+var summ_NEW = 'Testing String.prototype.replace(x,y) when x is a string';
+var summary = summ_NEW;
+var status = '';
+var actual = '';
+var expect= '';
+var cnEmptyString = '';
+var str = 'abc';
+var strA = cnEmptyString;
+var strB = 'Z';
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+
+/*
+ * In this test, it's important to reportCompare() each other case
+ * BEFORE the last two cases are attempted. Don't store all results
+ * in an array and reportCompare() them at the end, as we usually do.
+ *
+ * When this bug was filed, str.replace(strA, strB) would return no value
+ * whatsoever if strA == cnEmptyString, and no error, either -
+ */
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+/******************* THESE WERE INCORRECT; SEE ABOVE ************************
+ status = 'Section A of test';
+ strA = 'a';
+ actual = str.replace(strA, strB);
+ expect = str.replace(new RegExp(strA), strB);
+ reportCompare(expect, actual, status);
+
+ status = 'Section B of test';
+ strA = 'x';
+ actual = str.replace(strA, strB);
+ expect = str.replace(new RegExp(strA), strB);
+ reportCompare(expect, actual, status);
+
+ status = 'Section C of test';
+ strA = undefined;
+ actual = str.replace(strA, strB);
+ expect = str.replace(new RegExp(strA), strB);
+ reportCompare(expect, actual, status);
+
+ status = 'Section D of test';
+ strA = null;
+ actual = str.replace(strA, strB);
+ expect = str.replace(new RegExp(strA), strB);
+ reportCompare(expect, actual, status);
+
+
+ * This example is from jim@jibbering.com (see Bugzilla bug 92942)
+ * It is a variation on the example below.
+ *
+ * Namely, we are using the regexp /$/ instead of the regexp //.
+ * The regexp /$/ means we should match the "empty string" at the
+ * end-boundary of the word, instead of the one at the beginning.
+ *
+ status = 'Section E of test';
+ var strJim = 'aa$aa';
+ strA = '$';
+ actual = strJim.replace(strA, strB); // bug -> '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/qml/parserstress/tests/ecma_3/String/shell.js b/tests/auto/qml/parserstress/tests/ecma_3/String/shell.js
new file mode 100644
index 0000000000..7d850446cc
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/String/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'String';
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Unicode/browser.js b/tests/auto/qml/parserstress/tests/ecma_3/Unicode/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Unicode/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Unicode/regress-352044-01.js b/tests/auto/qml/parserstress/tests/ecma_3/Unicode/regress-352044-01.js
new file mode 100755
index 0000000000..bb10ac6f7a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Unicode/regress-352044-01.js
@@ -0,0 +1,72 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_3/Unicode/regress-352044-02-n.js b/tests/auto/qml/parserstress/tests/ecma_3/Unicode/regress-352044-02-n.js
new file mode 100755
index 0000000000..0e3c4b0189
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Unicode/regress-352044-02-n.js
@@ -0,0 +1,72 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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/qml/parserstress/tests/ecma_3/Unicode/shell.js b/tests/auto/qml/parserstress/tests/ecma_3/Unicode/shell.js
new file mode 100644
index 0000000000..97a64fe83d
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Unicode/shell.js
@@ -0,0 +1 @@
+gTestsubsuite = 'Unicode';
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/Unicode/uc-001-n.js b/tests/auto/qml/parserstress/tests/ecma_3/Unicode/uc-001-n.js
new file mode 100644
index 0000000000..31a13f70e2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Unicode/uc-001-n.js
@@ -0,0 +1,62 @@
+/* -*- 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/qml/parserstress/tests/ecma_3/Unicode/uc-001.js b/tests/auto/qml/parserstress/tests/ecma_3/Unicode/uc-001.js
new file mode 100644
index 0000000000..3fc0c8d927
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Unicode/uc-001.js
@@ -0,0 +1,56 @@
+/* -*- 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/qml/parserstress/tests/ecma_3/Unicode/uc-002-n.js b/tests/auto/qml/parserstress/tests/ecma_3/Unicode/uc-002-n.js
new file mode 100644
index 0000000000..f1ae9a749d
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Unicode/uc-002-n.js
@@ -0,0 +1,55 @@
+/* -*- 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/qml/parserstress/tests/ecma_3/Unicode/uc-002.js b/tests/auto/qml/parserstress/tests/ecma_3/Unicode/uc-002.js
new file mode 100644
index 0000000000..d19b2c4786
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Unicode/uc-002.js
@@ -0,0 +1,60 @@
+/* -*- 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/qml/parserstress/tests/ecma_3/Unicode/uc-003.js b/tests/auto/qml/parserstress/tests/ecma_3/Unicode/uc-003.js
new file mode 100644
index 0000000000..66c3f09860
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Unicode/uc-003.js
@@ -0,0 +1,71 @@
+/* -*- 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/qml/parserstress/tests/ecma_3/Unicode/uc-004.js b/tests/auto/qml/parserstress/tests/ecma_3/Unicode/uc-004.js
new file mode 100644
index 0000000000..a54923c525
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Unicode/uc-004.js
@@ -0,0 +1,65 @@
+/* -*- 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/qml/parserstress/tests/ecma_3/Unicode/uc-005.js b/tests/auto/qml/parserstress/tests/ecma_3/Unicode/uc-005.js
new file mode 100644
index 0000000000..3727042046
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/Unicode/uc-005.js
@@ -0,0 +1,276 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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<UBound; i++)
+ {
+ reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
+ }
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/browser.js b/tests/auto/qml/parserstress/tests/ecma_3/browser.js
new file mode 100755
index 0000000000..2339522cb6
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/browser.js
@@ -0,0 +1,36 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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/qml/parserstress/tests/ecma_3/extensions/10.1.3-2.js b/tests/auto/qml/parserstress/tests/ecma_3/extensions/10.1.3-2.js
new file mode 100755
index 0000000000..f941cb7800
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/extensions/10.1.3-2.js
@@ -0,0 +1,162 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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
+ *
+ * SpiderMonkey was crashing on each case below if the parameters had
+ * the same name. But duplicate parameter names are permitted by ECMA;
+ * see ECMA-262 3rd Edition Final Section 10.1.3
+ *
+ * NOTE: Rhino does not have toSource() and uneval(); they are non-ECMA
+ * extensions to the language. So we include a test for them at the beginning -
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = '10.1.3-2.js';
+var UBound = 0;
+var BUGNUMBER = '(none)';
+var summary = 'Testing functions having duplicate formal parameter names';
+var status = '';
+var statusitems = [];
+var actual = '';
+var actualvalues = [];
+var expect= '';
+var expectedvalues = [];
+var OBJ = new Object();
+var OBJ_TYPE = OBJ.toString();
+
+/*
+ * Exit if the implementation doesn't support toSource() or uneval(),
+ * since these are non-ECMA extensions to the language -
+ */
+try
+{
+ if (!OBJ.toSource || !uneval(OBJ))
+ quit();
+}
+catch(e)
+{
+ quit();
+}
+
+
+/*
+ * OK, now begin the test. Just checking that we don't crash on these -
+ */
+function f1(x,x,x,x)
+{
+ var ret = eval(arguments.toSource());
+ return ret.toString();
+}
+status = inSection(1);
+actual = f1(1,2,3,4);
+expect = OBJ_TYPE;
+addThis();
+
+
+/*
+ * Same thing, but preface |arguments| with the function name
+ */
+function f2(x,x,x,x)
+{
+ var ret = eval(f2.arguments.toSource());
+ return ret.toString();
+}
+status = inSection(2);
+actual = f2(1,2,3,4);
+expect = OBJ_TYPE;
+addThis();
+
+
+function f3(x,x,x,x)
+{
+ var ret = eval(uneval(arguments));
+ return ret.toString();
+}
+status = inSection(3);
+actual = f3(1,2,3,4);
+expect = OBJ_TYPE;
+addThis();
+
+
+/*
+ * Same thing, but preface |arguments| with the function name
+ */
+function f4(x,x,x,x)
+{
+ var ret = eval(uneval(f4.arguments));
+ return ret.toString();
+}
+status = inSection(4);
+actual = f4(1,2,3,4);
+expect = OBJ_TYPE;
+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<UBound; i++)
+ {
+ reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
+ }
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/extensions/7.9.1.js b/tests/auto/qml/parserstress/tests/ecma_3/extensions/7.9.1.js
new file mode 100755
index 0000000000..b69e9d065a
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/extensions/7.9.1.js
@@ -0,0 +1,83 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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 ***** */
+
+var gTestfile = '7.9.1.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 402386;
+var summary = 'Automatic Semicolon insertion in restricted statements';
+var actual = '';
+var expect = '';
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ var code;
+
+ code = '(function() { label1: for (;;) { continue \n label1; }})';
+ expect = '(function() { label1: for (;;) { continue ; label1; }})';
+ actual = uneval(eval(code));
+ compareSource(expect, actual, summary + ': ' + code);
+
+ code = '(function() { label2: for (;;) { break \n label2; }})';
+ expect = '(function() { label2: for (;;) { break ; label2; }})';
+ actual = uneval(eval(code));
+ compareSource(expect, actual, summary + ': ' + code);
+
+ code = '(function() { return \n x++; })';
+ expect = '(function() { return ; x++; })';
+ actual = uneval(eval(code));
+ compareSource(expect, actual, summary + ': ' + code);
+
+ print('see bug 256617');
+ code = '(function() { throw \n x++; })';
+// expect = '(function() { throw ; x++; })';
+ expect = 'SyntaxError: syntax error';
+ try { uneval(eval(code)); } catch(ex) { actual = ex + ''; };
+// compareSource(expect, actual, summary + ': ' + code);
+ reportCompare(expect, actual, summary + ': ' + code);
+
+ exitFunc ('test');
+}
+
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/extensions/browser.js b/tests/auto/qml/parserstress/tests/ecma_3/extensions/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/extensions/browser.js
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/extensions/regress-103087.js b/tests/auto/qml/parserstress/tests/ecma_3/extensions/regress-103087.js
new file mode 100644
index 0000000000..8cef9404e9
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/extensions/regress-103087.js
@@ -0,0 +1,178 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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):
+ * bedney@technicalpursuit.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 October 2001
+ *
+ * SUMMARY: Arose from Bugzilla bug 103087:
+ * "The RegExp MarkupSPE in demo crashes Mozilla"
+ *
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=103087
+ * The SpiderMonkey shell crashed on some of these regexps.
+ *
+ * The reported crash was on i=24 below ('MarkupSPE' regexp)
+ * I crashed on that, and also on i=43 ('XML_SPE' regexp)
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-103087.js';
+var UBound = 0;
+var BUGNUMBER = 103087;
+var summary = "Testing that we don't crash on any of these regexps -";
+var re = '';
+var lm = '';
+var lc = '';
+var rc = '';
+
+
+// the regexps are built in pieces -
+var NameStrt = "[A-Za-z_:]|[^\\x00-\\x7F]";
+var NameChar = "[A-Za-z0-9_:.-]|[^\\x00-\\x7F]";
+var Name = "(" + NameStrt + ")(" + NameChar + ")*";
+var TextSE = "[^<]+";
+var UntilHyphen = "[^-]*-";
+var Until2Hyphens = UntilHyphen + "([^-]" + UntilHyphen + ")*-";
+var CommentCE = Until2Hyphens + ">?";
+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 = "<!--" + Until2Hyphens + ">";
+var CommentSPE = "<!--(" + CommentCE + ")?";
+var PI_RE = "<\\?" + Name + "(" + PI_Tail + ")";
+var Erroneous_PI_SE = "<\\?[^?]*(\\?[^>]+)*\\?>";
+var PI_SPE = "<\\?(" + PI_CE + ")?";
+var CDATA_RE = "<!\\[CDATA\\[" + CDATA_CE;
+var CDATA_SPE = "<!\\[CDATA\\[(" + CDATA_CE + ")?";
+var ElemTagSE = "<(" + NameStrt + ")([^<>\"']+|" + AttValSE + ")*>";
+var ElemTagRE = "<" + Name + "(" + S + Name + "(" + S + ")?=(" + S + ")?(" + AttValSE + "))*(" + S + ")?/?>";
+var ElemTagSPE = "<" + ElemTagCE;
+var EndTagRE = "</" + Name + "(" + S + ")?>";
+var EndTagSPE = "</(" + EndTagCE + ")?";
+var DocTypeSPE = "<!DOCTYPE(" + DocTypeCE + ")?";
+var PERef_APE = "%(" + Name + ";?)?";
+var HexPart = "x([0-9a-fA-F]+;?)?";
+var NumPart = "#([0-9]+;?|" + HexPart + ")?";
+var CGRef_APE = "&(" + Name + ";?|" + NumPart + ")?";
+var Text_PE = CGRef_APE + "|[^&]+";
+var EntityValue_PE = CGRef_APE + "|" + PERef_APE + "|[^%&]+";
+
+
+var rePatterns = new Array(AttValSE, CDATA_CE, CDATA_RE, CDATA_SPE, CGRef_APE, CommentCE, CommentRE, CommentSPE, DT_IdentSE, DT_ItemSE, DeclCE, DocTypeCE, DocTypeSPE, ElemTagCE, ElemTagRE, ElemTagSE, ElemTagSPE, EndTagCE, EndTagRE, EndTagSPE, EntityValue_PE, Erroneous_PI_SE, HexPart, MarkupDeclCE, MarkupSPE, Name, NameChar, NameStrt, NumPart, PERef_APE, PI_CE, PI_RE, PI_SPE, PI_Tail, QuoteSE, S, S1, TextSE, Text_PE, Until2Hyphens, UntilHyphen, UntilQMs, UntilRSBs, XML_SPE);
+
+
+// here's a big string to test the regexps on -
+var str = '';
+str += '<html xmlns="http://www.w3.org/1999/xhtml"' + '\n';
+str += ' xmlns:xlink="http://www.w3.org/XML/XLink/0.9">' + '\n';
+str += ' <head><title>Three Namespaces</title></head>' + '\n';
+str += ' <body>' + '\n';
+str += ' <h1 align="center">An Ellipse and a Rectangle</h1>' + '\n';
+str += ' <svg xmlns="http://www.w3.org/Graphics/SVG/SVG-19991203.dtd" ' + '\n';
+str += ' width="12cm" height="10cm">' + '\n';
+str += ' <ellipse rx="110" ry="130" />' + '\n';
+str += ' <rect x="4cm" y="1cm" width="3cm" height="6cm" />' + '\n';
+str += ' </svg>' + '\n';
+str += ' <p xlink:type="simple" xlink:href="ellipses.html">' + '\n';
+str += ' More about ellipses' + '\n';
+str += ' </p>' + '\n';
+str += ' <p xlink:type="simple" xlink:href="rectangles.html">' + '\n';
+str += ' More about rectangles' + '\n';
+str += ' </p>' + '\n';
+str += ' <hr/>' + '\n';
+str += ' <p>Last Modified February 13, 2000</p> ' + '\n';
+str += ' </body>' + '\n';
+str += '</html>';
+
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ for (var i=0; i<rePatterns.length; i++)
+ {
+ status = inSection(i);
+ re = new RegExp(rePatterns[i]);
+
+ // Test that we don't crash on any of these -
+ re.exec(str);
+ getResults();
+
+ // Just for the heck of it, test the current leftContext
+ re.exec(lc);
+ getResults();
+
+ // Test the current rightContext
+ re.exec(rc);
+ getResults();
+ }
+
+ reportCompare('No Crash', 'No Crash', '');
+
+ exitFunc ('test');
+}
+
+
+function getResults()
+{
+ lm = RegExp.lastMatch;
+ lc = RegExp.leftContext;
+ rc = RegExp.rightContext;
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/extensions/regress-188206-01.js b/tests/auto/qml/parserstress/tests/ecma_3/extensions/regress-188206-01.js
new file mode 100644
index 0000000000..f09963a7b5
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/extensions/regress-188206-01.js
@@ -0,0 +1,108 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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):
+ * scole@planetweb.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 ***** */
+
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-188206-01.js';
+var UBound = 0;
+var BUGNUMBER = 188206;
+var summary = 'Invalid use of regexp quantifiers should generate SyntaxErrors';
+var TEST_PASSED = 'SyntaxError';
+var TEST_FAILED = 'Generated an error, but NOT a SyntaxError!';
+var TEST_FAILED_BADLY = 'Did not generate ANY error!!!';
+var status = '';
+var statusitems = [];
+var actual = '';
+var actualvalues = [];
+var expect= '';
+var expectedvalues = [];
+
+
+/*
+ * Now do some weird things on the left side of the regexps -
+ */
+status = inSection(7);
+testThis(' /*a/ ');
+
+status = inSection(8);
+testThis(' /**a/ ');
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+/*
+ * Invalid syntax should generate a SyntaxError
+ */
+function testThis(sInvalidSyntax)
+{
+ expect = TEST_PASSED;
+ actual = TEST_FAILED_BADLY;
+
+ try
+ {
+ eval(sInvalidSyntax);
+ }
+ catch(e)
+ {
+ if (e instanceof SyntaxError)
+ actual = TEST_PASSED;
+ else
+ actual = TEST_FAILED;
+ }
+
+ statusitems[UBound] = status;
+ expectedvalues[UBound] = expect;
+ actualvalues[UBound] = actual;
+ 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/qml/parserstress/tests/ecma_3/extensions/regress-188206-02.js b/tests/auto/qml/parserstress/tests/ecma_3/extensions/regress-188206-02.js
new file mode 100644
index 0000000000..3bd079fae6
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/extensions/regress-188206-02.js
@@ -0,0 +1,158 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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):
+ * scole@planetweb.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 ***** */
+
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-188206-02.js';
+var UBound = 0;
+var BUGNUMBER = 188206;
+var summary = 'Invalid use of regexp quantifiers should generate SyntaxErrors';
+var CHECK_PASSED = 'Should not generate an error';
+var CHECK_FAILED = 'Generated an error!';
+var status = '';
+var statusitems = [];
+var actual = '';
+var actualvalues = [];
+var expect= '';
+var expectedvalues = [];
+
+
+/*
+ * Misusing the {DecmalDigits} quantifier - according to ECMA,
+ * but not according to Perl.
+ *
+ * ECMA-262 Edition 3 prohibits the use of unescaped braces in
+ * regexp patterns, unless they form part of a quantifier.
+ *
+ * Hovever, Perl does not prohibit this. If not used as part
+ * of a quantifer, Perl treats braces literally.
+ *
+ * We decided to follow Perl on this for backward compatibility.
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=190685.
+ *
+ * Therefore NONE of the following ECMA violations should generate
+ * a SyntaxError. Note we use checkThis() instead of testThis().
+ */
+status = inSection(13);
+checkThis(' /a*{/ ');
+
+status = inSection(14);
+checkThis(' /a{}/ ');
+
+status = inSection(15);
+checkThis(' /{a/ ');
+
+status = inSection(16);
+checkThis(' /}a/ ');
+
+status = inSection(17);
+checkThis(' /x{abc}/ ');
+
+status = inSection(18);
+checkThis(' /{{0}/ ');
+
+status = inSection(19);
+checkThis(' /{{1}/ ');
+
+status = inSection(20);
+checkThis(' /x{{0}/ ');
+
+status = inSection(21);
+checkThis(' /x{{1}/ ');
+
+status = inSection(22);
+checkThis(' /x{{0}}/ ');
+
+status = inSection(23);
+checkThis(' /x{{1}}/ ');
+
+status = inSection(24);
+checkThis(' /x{{0}}/ ');
+
+status = inSection(25);
+checkThis(' /x{{1}}/ ');
+
+status = inSection(26);
+checkThis(' /x{{0}}/ ');
+
+status = inSection(27);
+checkThis(' /x{{1}}/ ');
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+
+
+/*
+ * Allowed syntax shouldn't generate any errors
+ */
+function checkThis(sAllowedSyntax)
+{
+ expect = CHECK_PASSED;
+ actual = CHECK_PASSED;
+
+ try
+ {
+ eval(sAllowedSyntax);
+ }
+ catch(e)
+ {
+ actual = CHECK_FAILED;
+ }
+
+ statusitems[UBound] = status;
+ expectedvalues[UBound] = expect;
+ actualvalues[UBound] = actual;
+ 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/qml/parserstress/tests/ecma_3/extensions/regress-220367-002.js b/tests/auto/qml/parserstress/tests/ecma_3/extensions/regress-220367-002.js
new file mode 100644
index 0000000000..7af2a9d63f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/extensions/regress-220367-002.js
@@ -0,0 +1,112 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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: 26 September 2003
+ * SUMMARY: Regexp conformance test
+ *
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=220367
+ *
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-220367-002.js';
+var UBound = 0;
+var BUGNUMBER = 220367;
+var summary = 'Regexp conformance test';
+var status = '';
+var statusitems = [];
+var actual = '';
+var actualvalues = [];
+var expect= '';
+var expectedvalues = [];
+
+var re = /(a)|(b)/;
+
+re.test('a');
+status = inSection(1);
+actual = RegExp.$1;
+expect = 'a';
+addThis();
+
+status = inSection(2);
+actual = RegExp.$2;
+expect = '';
+addThis();
+
+re.test('b');
+status = inSection(3);
+actual = RegExp.$1;
+expect = '';
+addThis();
+
+status = inSection(4);
+actual = RegExp.$2;
+expect = 'b';
+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<UBound; i++)
+ {
+ reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
+ }
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/extensions/regress-228087.js b/tests/auto/qml/parserstress/tests/ecma_3/extensions/regress-228087.js
new file mode 100644
index 0000000000..6e16126cc0
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/extensions/regress-228087.js
@@ -0,0 +1,352 @@
+/* -*- 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 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):
+* bex@xaotec.com, PhilSchwartau@aol.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 December 2003
+ * SUMMARY: Testing regexps with unescaped braces
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=228087
+ *
+ * Note: unbalanced, unescaped braces are not permitted by ECMA-262 Ed.3,
+ * but we decided to follow Perl and IE and allow this for compatibility.
+ *
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=188206 and its testcase.
+ * See http://bugzilla.mozilla.org/show_bug.cgi?id=223273 and its testcase.
+ */
+//-----------------------------------------------------------------------------
+var gTestfile = 'regress-228087.js';
+var i = 0;
+var BUGNUMBER = 228087;
+var summary = 'Testing regexps with unescaped braces';
+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 e;
+
+
+string = 'foo {1} foo {2} foo';
+
+// try an example with the braces escaped
+status = inSection(1);
+try
+{
+ pattern = new RegExp('\{1.*\}', 'g');
+ actualmatch = string.match(pattern);
+}
+catch (e)
+{
+ pattern = 'error';
+ actualmatch = '';
+}
+expectedmatch = Array('{1} foo {2}');
+addThis();
+
+// just like Section 1, without the braces being escaped
+status = inSection(2);
+try
+{
+ pattern = new RegExp('{1.*}', 'g');
+ actualmatch = string.match(pattern);
+}
+catch (e)
+{
+ pattern = 'error';
+ actualmatch = '';
+}
+expectedmatch = Array('{1} foo {2}');
+addThis();
+
+// try an example with the braces escaped
+status = inSection(3);
+try
+{
+ pattern = new RegExp('\{1[.!\}]*\}', 'g');
+ actualmatch = string.match(pattern);
+}
+catch (e)
+{
+ pattern = 'error';
+ actualmatch = '';
+}
+expectedmatch = Array('{1}');
+addThis();
+
+// just like Section 3, without the braces being escaped
+status = inSection(4);
+try
+{
+ pattern = new RegExp('{1[.!}]*}', 'g');
+ actualmatch = string.match(pattern);
+}
+catch (e)
+{
+ pattern = 'error';
+ actualmatch = '';
+}
+expectedmatch = Array('{1}');
+addThis();
+
+
+string = 'abccccc{3 }c{ 3}c{3, }c{3 ,}c{3 ,4}c{3, 4}c{3,4 }de';
+
+// use braces in a normal quantifier construct
+status = inSection(5);
+try
+{
+ pattern = new RegExp('c{3}');
+ actualmatch = string.match(pattern);
+}
+catch (e)
+{
+ pattern = 'error';
+ actualmatch = '';
+}
+expectedmatch = Array('ccc');
+addThis();
+
+// now disrupt the quantifer - the braces should now be interpreted literally
+status = inSection(6);
+try
+{
+ pattern = new RegExp('c{3 }');
+ actualmatch = string.match(pattern);
+}
+catch (e)
+{
+ pattern = 'error';
+ actualmatch = '';
+}
+expectedmatch = Array('c{3 }');
+addThis();
+
+status = inSection(7);
+try
+{
+ pattern = new RegExp('c{3.}');
+ actualmatch = string.match(pattern);
+}
+catch (e)
+{
+ pattern = 'error';
+ actualmatch = '';
+}
+expectedmatch = Array('c{3 }');
+addThis();
+
+status = inSection(8);
+try
+{
+ // need to escape the \ in \s since
+ // this has been converted to a constructor call
+ // instead of a literal regexp
+ pattern = new RegExp('c{3\\s}');
+ actualmatch = string.match(pattern);
+}
+catch (e)
+{
+ pattern = 'error';
+ actualmatch = '';
+}
+expectedmatch = Array('c{3 }');
+addThis();
+
+status = inSection(9);
+try
+{
+ pattern = new RegExp('c{3[ ]}');
+ actualmatch = string.match(pattern);
+}
+catch (e)
+{
+ pattern = 'error';
+ actualmatch = '';
+}
+expectedmatch = Array('c{3 }');
+addThis();
+
+status = inSection(10);
+try
+{
+ pattern = new RegExp('c{ 3}');
+ actualmatch = string.match(pattern);
+}
+catch (e)
+{
+ pattern = 'error';
+ actualmatch = '';
+}
+expectedmatch = Array('c{ 3}');
+addThis();
+
+// using braces in a normal quantifier construct again
+status = inSection(11);
+try
+{
+ pattern = new RegExp('c{3,}');
+ actualmatch = string.match(pattern);
+}
+catch (e)
+{
+ pattern = 'error';
+ actualmatch = '';
+}
+expectedmatch = Array('ccccc');
+addThis();
+
+// now disrupt it - the braces should now be interpreted literally
+status = inSection(12);
+try
+{
+ pattern = new RegExp('c{3, }');
+ actualmatch = string.match(pattern);
+}
+catch (e)
+{
+ pattern = 'error';
+ actualmatch = '';
+}
+expectedmatch = Array('c{3, }');
+addThis();
+
+status = inSection(13);
+try
+{
+ pattern = new RegExp('c{3 ,}');
+ actualmatch = string.match(pattern);
+}
+catch (e)
+{
+ pattern = 'error';
+ actualmatch = '';
+}
+expectedmatch = Array('c{3 ,}');
+addThis();
+
+// using braces in a normal quantifier construct again
+status = inSection(14);
+try
+{
+ pattern = new RegExp('c{3,4}');
+ actualmatch = string.match(pattern);
+}
+catch (e)
+{
+ pattern = 'error';
+ actualmatch = '';
+}
+expectedmatch = Array('cccc');
+addThis();
+
+// now disrupt it - the braces should now be interpreted literally
+status = inSection(15);
+try
+{
+ pattern = new RegExp('c{3 ,4}');
+ actualmatch = string.match(pattern);
+}
+catch (e)
+{
+ pattern = 'error';
+ actualmatch = '';
+}
+expectedmatch = Array('c{3 ,4}');
+addThis();
+
+status = inSection(16);
+try
+{
+ pattern = new RegExp('c{3, 4}');
+ actualmatch = string.match(pattern);
+}
+catch (e)
+{
+ pattern = 'error';
+ actualmatch = '';
+}
+expectedmatch = Array('c{3, 4}');
+addThis();
+
+status = inSection(17);
+try
+{
+ pattern = new RegExp('c{3,4 }');
+ actualmatch = string.match(pattern);
+}
+catch (e)
+{
+ pattern = 'error';
+ actualmatch = '';
+}
+expectedmatch = Array('c{3,4 }');
+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/qml/parserstress/tests/ecma_3/extensions/regress-274152.js b/tests/auto/qml/parserstress/tests/ecma_3/extensions/regress-274152.js
new file mode 100755
index 0000000000..d7074d9128
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/extensions/regress-274152.js
@@ -0,0 +1,83 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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 = 'regress-274152.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 274152;
+var summary = 'Do not ignore unicode format-control characters';
+var actual = '';
+var expect = '';
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ expect = 'SyntaxError: illegal character';
+
+ var formatcontrolchars = ['\u200C',
+ '\u200D',
+ '\u200E',
+ '\u0600',
+ '\u0601',
+ '\u0602',
+ '\u0603',
+ '\u06DD',
+ '\u070F'];
+
+ for (var i = 0; i < formatcontrolchars.length; i++)
+ {
+ try
+ {
+ eval("hi" + formatcontrolchars[i] + "there = 'howdie';");
+ }
+ catch(ex)
+ {
+ actual = ex + '';
+ }
+
+ reportCompare(expect, actual, summary + ': ' + i);
+ }
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/extensions/regress-320854.js b/tests/auto/qml/parserstress/tests/ecma_3/extensions/regress-320854.js
new file mode 100755
index 0000000000..85e684882f
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/extensions/regress-320854.js
@@ -0,0 +1,53 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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): 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 = 'regress-320854.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 320854;
+var summary = 'o.hasOwnProperty("length") should not lie when o has function in proto chain';
+var actual = '';
+var expect = '';
+
+printBugNumber(BUGNUMBER);
+printStatus (summary);
+
+var o = {__proto__:function(){}};
+
+expect = false;
+actual = o.hasOwnProperty('length')
+
+ reportCompare(expect, actual, summary);
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/extensions/regress-327170.js b/tests/auto/qml/parserstress/tests/ecma_3/extensions/regress-327170.js
new file mode 100755
index 0000000000..5d15ce31a9
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/extensions/regress-327170.js
@@ -0,0 +1,58 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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): Jonas Jonsson
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient 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-327170.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 327170;
+var summary = 'Reuse of RegExp in string.replace(rx.compile(...), function() { rx.compile(...); }) causes a crash';
+var actual = 'No Crash';
+var expect = 'No Crash';
+
+printBugNumber(BUGNUMBER);
+printStatus (summary);
+
+var g_rx = /(?:)/;
+
+"this is a test-string".replace(g_rx.compile("test", "g"),
+ function()
+ {
+ // re-use of the g_rx RegExp object,
+ // that's currently in use by the replace fn.
+ g_rx.compile("string", "g");
+ });
+
+reportCompare(expect, actual, summary);
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/extensions/regress-368516.js b/tests/auto/qml/parserstress/tests/ecma_3/extensions/regress-368516.js
new file mode 100755
index 0000000000..a5f5fb769b
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/extensions/regress-368516.js
@@ -0,0 +1,78 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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 = 'regress-368516.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 368516;
+var summary = 'Treat unicode BOM characters as whitespace';
+var actual = '';
+var expect = '';
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ var bomchars = ['\uFFFE',
+ '\uFEFF'];
+
+ for (var i = 0; i < bomchars.length; i++)
+ {
+ expect = 'howdie';
+ actual = '';
+
+ try
+ {
+ eval("var" + bomchars[i] + "hithere = 'howdie';");
+ actual = hithere;
+ }
+ catch(ex)
+ {
+ actual = ex + '';
+ }
+
+ reportCompare(expect, actual, summary + ': ' + i);
+ }
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/extensions/regress-385393-03.js b/tests/auto/qml/parserstress/tests/ecma_3/extensions/regress-385393-03.js
new file mode 100755
index 0000000000..40c7e8dd81
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/extensions/regress-385393-03.js
@@ -0,0 +1,63 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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-385393-03.js';
+
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 385393;
+var summary = 'Regression test for bug 385393';
+var actual = '';
+var expect = '';
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ f = (function() { new (delete y) });
+ eval(uneval(f))
+
+ reportCompare(expect, actual, summary);
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/extensions/regress-429248.js b/tests/auto/qml/parserstress/tests/ecma_3/extensions/regress-429248.js
new file mode 100755
index 0000000000..9966269115
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/extensions/regress-429248.js
@@ -0,0 +1,67 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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-429248.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 429248;
+var summary = 'Do not assert: 0';
+var actual = 'No Crash';
+var expect = 'No Crash';
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ function c() { do{}while(0) }
+
+ if (typeof trap == 'function')
+ {
+ trap(c, 0, "");
+ }
+ c + '';
+
+ reportCompare(expect, actual, summary);
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/extensions/regress-430740.js b/tests/auto/qml/parserstress/tests/ecma_3/extensions/regress-430740.js
new file mode 100755
index 0000000000..446adb95a6
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/extensions/regress-430740.js
@@ -0,0 +1,72 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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): Dave Reed
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient 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-430740.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 430740;
+var summary = 'Do not strip format-control characters from string literals';
+var actual = '';
+var expect = '';
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ function doevil() {
+ print('evildone');
+ return 'evildone';
+ }
+
+ expect = 'a%E2%80%8D,+doevil()%5D)//';
+ actual += eval("(['a\\\u200d', '+doevil()])//'])");
+ actual = encodeURI(actual);
+ reportCompare(expect, actual, summary);
+
+ expect = 'a%EF%BF%BE,+doevil()%5D)//';
+ actual = eval("(['a\\\ufffe', '+doevil()])//'])");
+ actual = encodeURI(actual);
+ reportCompare(expect, actual, summary);
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/extensions/shell.js b/tests/auto/qml/parserstress/tests/ecma_3/extensions/shell.js
new file mode 100644
index 0000000000..d83e3591af
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/extensions/shell.js
@@ -0,0 +1,266 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY 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: 07 February 2001
+ *
+ * Functionality common to RegExp testing -
+ */
+//-----------------------------------------------------------------------------
+
+gTestsubsuite = 'extensions';
+
+var MSG_PATTERN = '\nregexp = ';
+var MSG_STRING = '\nstring = ';
+var MSG_EXPECT = '\nExpect: ';
+var MSG_ACTUAL = '\nActual: ';
+var ERR_LENGTH = '\nERROR !!! match arrays have different lengths:';
+var ERR_MATCH = '\nERROR !!! regexp failed to give expected match array:';
+var ERR_NO_MATCH = '\nERROR !!! regexp FAILED to match anything !!!';
+var ERR_UNEXP_MATCH = '\nERROR !!! regexp MATCHED when we expected it to fail !!!';
+var CHAR_LBRACKET = '[';
+var CHAR_RBRACKET = ']';
+var CHAR_QT_DBL = '"';
+var CHAR_QT = "'";
+var CHAR_NL = '\n';
+var CHAR_COMMA = ',';
+var CHAR_SPACE = ' ';
+var TYPE_STRING = typeof 'abc';
+
+
+
+function testRegExp(statuses, patterns, strings, actualmatches, expectedmatches)
+{
+ var status = '';
+ var pattern = new RegExp();
+ var string = '';
+ var actualmatch = new Array();
+ var expectedmatch = new Array();
+ var state = '';
+ var lActual = -1;
+ var lExpect = -1;
+
+
+ for (var i=0; i != patterns.length; i++)
+ {
+ status = statuses[i];
+ pattern = patterns[i];
+ string = strings[i];
+ actualmatch=actualmatches[i];
+ expectedmatch=expectedmatches[i];
+ state = getState(status, pattern, string);
+
+ description = status;
+
+ if(actualmatch)
+ {
+ actual = formatArray(actualmatch);
+ if(expectedmatch)
+ {
+ // expectedmatch and actualmatch are arrays -
+ lExpect = expectedmatch.length;
+ lActual = actualmatch.length;
+
+ var expected = formatArray(expectedmatch);
+
+ if (lActual != lExpect)
+ {
+ reportCompare(lExpect, lActual,
+ state + ERR_LENGTH +
+ MSG_EXPECT + expected +
+ MSG_ACTUAL + actual +
+ CHAR_NL
+ );
+ continue;
+ }
+
+ // OK, the arrays have same length -
+ if (expected != actual)
+ {
+ reportCompare(expected, actual,
+ state + ERR_MATCH +
+ MSG_EXPECT + expected +
+ MSG_ACTUAL + actual +
+ CHAR_NL
+ );
+ }
+ else
+ {
+ reportCompare(expected, actual, state)
+ }
+
+ }
+ else //expectedmatch is null - that is, we did not expect a match -
+ {
+ expected = expectedmatch;
+ reportCompare(expected, actual,
+ state + ERR_UNEXP_MATCH +
+ MSG_EXPECT + expectedmatch +
+ MSG_ACTUAL + actual +
+ CHAR_NL
+ );
+ }
+
+ }
+ else // actualmatch is null
+ {
+ if (expectedmatch)
+ {
+ actual = actualmatch;
+ reportCompare(expected, actual,
+ state + ERR_NO_MATCH +
+ MSG_EXPECT + expectedmatch +
+ MSG_ACTUAL + actualmatch +
+ CHAR_NL
+ );
+ }
+ else // we did not expect a match
+ {
+ // Being ultra-cautious. Presumably expectedmatch===actualmatch===null
+ expected = expectedmatch;
+ actual = actualmatch;
+ reportCompare (expectedmatch, actualmatch, state);
+ }
+ }
+ }
+}
+
+
+function getState(status, pattern, string)
+{
+ /*
+ * Escape \n's, etc. to make them LITERAL in the presentation string.
+ * We don't have to worry about this in |pattern|; such escaping is
+ * done automatically by pattern.toString(), invoked implicitly below.
+ *
+ * One would like to simply do: string = string.replace(/(\s)/g, '\$1').
+ * However, the backreference $1 is not a literal string value,
+ * so this method doesn't work.
+ *
+ * Also tried string = string.replace(/(\s)/g, escape('$1'));
+ * but this just inserts the escape of the literal '$1', i.e. '%241'.
+ */
+ string = string.replace(/\n/g, '\\n');
+ string = string.replace(/\r/g, '\\r');
+ string = string.replace(/\t/g, '\\t');
+ string = string.replace(/\v/g, '\\v');
+ string = string.replace(/\f/g, '\\f');
+
+ return (status + MSG_PATTERN + pattern + MSG_STRING + singleQuote(string));
+}
+
+
+/*
+ * If available, arr.toSource() gives more detail than arr.toString()
+ *
+ * var arr = Array(1,2,'3');
+ *
+ * arr.toSource()
+ * [1, 2, "3"]
+ *
+ * arr.toString()
+ * 1,2,3
+ *
+ * But toSource() doesn't exist in Rhino, so use our own imitation, below -
+ *
+ */
+function formatArray(arr)
+{
+ try
+ {
+ return arr.toSource();
+ }
+ catch(e)
+ {
+ return toSource(arr);
+ }
+}
+
+
+/*
+ * Imitate SpiderMonkey's arr.toSource() method:
+ *
+ * a) Double-quote each array element that is of string type
+ * b) Represent |undefined| and |null| by empty strings
+ * c) Delimit elements by a comma + single space
+ * d) Do not add delimiter at the end UNLESS the last element is |undefined|
+ * e) Add square brackets to the beginning and end of the string
+ */
+function toSource(arr)
+{
+ var delim = CHAR_COMMA + CHAR_SPACE;
+ var elt = '';
+ var ret = '';
+ var len = arr.length;
+
+ for (i=0; i<len; i++)
+ {
+ elt = arr[i];
+
+ switch(true)
+ {
+ case (typeof elt === TYPE_STRING) :
+ ret += doubleQuote(elt);
+ break;
+
+ case (elt === undefined || elt === null) :
+ break; // add nothing but the delimiter, below -
+
+ default:
+ ret += elt.toString();
+ }
+
+ if ((i < len-1) || (elt === undefined))
+ ret += delim;
+ }
+
+ return CHAR_LBRACKET + ret + CHAR_RBRACKET;
+}
+
+
+function doubleQuote(text)
+{
+ return CHAR_QT_DBL + text + CHAR_QT_DBL;
+}
+
+
+function singleQuote(text)
+{
+ return CHAR_QT + text + CHAR_QT;
+}
+
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/shell.js b/tests/auto/qml/parserstress/tests/ecma_3/shell.js
new file mode 100644
index 0000000000..ea63a51957
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/shell.js
@@ -0,0 +1,40 @@
+/* -*- 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):
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient 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_3';
diff --git a/tests/auto/qml/parserstress/tests/ecma_3/template.js b/tests/auto/qml/parserstress/tests/ecma_3/template.js
new file mode 100755
index 0000000000..4dedd5a0e3
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/ecma_3/template.js
@@ -0,0 +1,59 @@
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF 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 ***** */
+
+var gTestfile = 'template.js';
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 99999;
+var summary = '';
+var actual = '';
+var expect = '';
+
+
+//-----------------------------------------------------------------------------
+test();
+//-----------------------------------------------------------------------------
+
+function test()
+{
+ enterFunc ('test');
+ printBugNumber(BUGNUMBER);
+ printStatus (summary);
+
+ reportCompare(expect, actual, summary);
+
+ exitFunc ('test');
+}
diff --git a/tests/auto/qml/parserstress/tests/shell.js b/tests/auto/qml/parserstress/tests/shell.js
new file mode 100644
index 0000000000..40af0f3799
--- /dev/null
+++ b/tests/auto/qml/parserstress/tests/shell.js
@@ -0,0 +1,886 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ *
+ * ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released
+ * March 31, 1998.
+ *
+ * The Initial Developer of the 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
+ * Bob Clary bob@bclary.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 ***** */
+
+// Spidermonkey shell now defaults to 1.8, so set the basic version to
+// 1.5 for backwards compatibility.
+
+if (typeof version != 'undefined')
+{
+ version(150);
+}
+
+var STATUS = "STATUS: ";
+var VERBOSE = false;
+var SECT_PREFIX = 'Section ';
+var SECT_SUFFIX = ' of test - ';
+var callStack = new Array();
+
+var gTestfile;
+var gTestPath;
+var gTestsuite;
+var gTestsubsuite;
+var gDelayTestDriverEnd = false;
+
+var gTestcases = new Array();
+var gTc = gTestcases.length;
+var BUGNUMBER = '';
+var summary = '';
+var description = '';
+var expected = '';
+var actual = '';
+var msg = '';
+
+var SECTION = "";
+var VERSION = "";
+var BUGNUMBER = "";
+
+/*
+ * constant strings
+ */
+var GLOBAL = this + '';
+var PASSED = " PASSED! ";
+var FAILED = " FAILED! ";
+
+var DEBUG = false;
+
+var DESCRIPTION;
+var EXPECTED;
+
+/*
+ * wrapper for test case constructor that doesn't require the SECTION
+ * argument.
+ */
+
+function AddTestCase( description, expect, actual ) {
+ new TestCase( SECTION, description, expect, actual );
+}
+
+/*
+ * Set up test environment.
+ *
+ */
+function startTest() {
+ // print out bugnumber
+
+ if ( BUGNUMBER ) {
+ print ("BUGNUMBER: " + BUGNUMBER );
+ }
+ if ( typeof version != 'function') {
+ return;
+ }
+
+ // JavaScript 1.3 is supposed to be compliant ecma version 1.0
+ if ( VERSION == "ECMA_1" ) {
+ version ( "130" );
+ }
+ else if ( VERSION == "JS_1.8" || gTestsuite == 'js1_8') {
+ version ( "180" );
+ }
+ else if ( VERSION == "JS_1.7" || gTestsuite == 'js1_7') {
+ version ( "170" );
+ }
+ else if ( VERSION == "JS_1.6" || gTestsuite == 'js1_6') {
+ version ( "160" );
+ }
+ else if ( VERSION == "JS_1.5" || gTestsuite == 'js1_5') {
+ version ( "150" );
+ }
+ else if ( VERSION == "JS_1.4" || gTestsuite == 'js1_4') {
+ version ( "140" );
+ }
+ else if ( VERSION == "JS_1.3" || gTestsuite == 'js1_3') {
+ version ( "130" );
+ }
+ else if ( VERSION == "JS_1.2" || gTestsuite == 'js1_2') {
+ version ( "120" );
+ }
+ else if ( VERSION == "JS_1.1" || gTestsuite == 'js1_1') {
+ version ( "110" );
+ }
+}
+
+function TestCase(n, d, e, a)
+{
+ this.path = (typeof gTestPath == 'undefined') ?
+ (gTestsuite + '/' + gTestsubsuite + '/' + gTestfile) :
+ gTestPath;
+ this.file = gTestfile;
+ this.name = n;
+ this.description = d;
+ this.expect = e;
+ this.actual = a;
+ this.passed = getTestCaseResult(e, a);
+ this.reason = '';
+ this.bugnumber = typeof(BUGNUMER) != 'undefined' ? BUGNUMBER : '';
+ this.type = (typeof window == 'undefined' ? 'shell' : 'browser');
+ gTestcases[gTc++] = this;
+}
+
+TestCase.prototype.dump = function () {
+ dump('\njstest: ' + this.path + ' ' +
+ 'bug: ' + this.bugnumber + ' ' +
+ 'result: ' + (this.passed ? 'PASSED':'FAILED') + ' ' +
+ 'type: ' + this.type + ' ' +
+ 'description: ' + toPrinted(this.description) + ' ' +
+// 'expected: ' + toPrinted(this.expect) + ' ' +
+// 'actual: ' + toPrinted(this.actual) + ' ' +
+ 'reason: ' + toPrinted(this.reason) + '\n');
+};
+
+/*
+ * The test driver searches for such a phrase in the test output.
+ * If such phrase exists, it will set n as the expected exit code.
+ */
+function expectExitCode(n)
+{
+ print('--- NOTE: IN THIS TESTCASE, WE EXPECT EXIT CODE ' + n + ' ---');
+}
+
+/*
+ * Statuses current section of a test
+ */
+function inSection(x)
+{
+ return SECT_PREFIX + x + SECT_SUFFIX;
+}
+
+/*
+ * Report a failure in the 'accepted' manner
+ */
+function reportFailure (msg)
+{
+ var lines = msg.split ("\n");
+ var l;
+ var funcName = currentFunc();
+ var prefix = (funcName) ? "[reported from " + funcName + "] ": "";
+
+ for (var i=0; i<lines.length; i++)
+ print (FAILED + prefix + lines[i]);
+}
+
+/*
+ * Print a non-failure message.
+ */
+function printStatus (msg)
+{
+/* js1_6 had...
+ msg = String(msg);
+ msg = msg.toString();
+*/
+ msg = msg.toString();
+ var lines = msg.split ("\n");
+ var l;
+
+ for (var i=0; i<lines.length; i++)
+ print (STATUS + lines[i]);
+}
+
+/*
+ * Print a bugnumber message.
+ */
+function printBugNumber (num)
+{
+ BUGNUMBER = num;
+ print ('BUGNUMBER: ' + num);
+}
+
+function toPrinted(value)
+{
+ if (typeof value == "xml")
+ {
+ value = value.toXMLString();
+ }
+ else
+ {
+ value = String(value);
+ }
+ value = value.replace(/\\n/g, 'NL')
+ .replace(/\n/g, 'NL')
+ .replace(/\\r/g, 'CR')
+ .replace(/[^\x20-\x7E]+/g, escapeString);
+ return value;
+}
+
+function escapeString (str)
+{
+ var a, b, c, d;
+ var len = str.length;
+ var result = "";
+ var digits = ["0", "1", "2", "3", "4", "5", "6", "7",
+ "8", "9", "A", "B", "C", "D", "E", "F"];
+
+ for (var i=0; i<len; i++)
+ {
+ var ch = str.charCodeAt(i);
+
+ a = digits[ch & 0xf];
+ ch >>= 4;
+ b = digits[ch & 0xf];
+ ch >>= 4;
+
+ if (ch)
+ {
+ c = digits[ch & 0xf];
+ ch >>= 4;
+ d = digits[ch & 0xf];
+
+ result += "\\u" + d + c + b + a;
+ }
+ else
+ {
+ result += "\\x" + b + a;
+ }
+ }
+
+ return result;
+}
+
+/*
+ * Compare expected result to actual result, if they differ (in value and/or
+ * type) report a failure. If description is provided, include it in the
+ * failure report.
+ */
+function reportCompare (expected, actual, description) {
+ var expected_t = typeof expected;
+ var actual_t = typeof actual;
+ var output = "";
+
+ if (typeof description == "undefined")
+ {
+ description = '';
+ }
+ else if (VERBOSE)
+ {
+ printStatus ("Comparing '" + description + "'");
+ }
+
+ if (expected_t != actual_t)
+ {
+ output += "Type mismatch, expected type " + expected_t +
+ ", actual type " + actual_t + " ";
+ }
+ else if (VERBOSE)
+ {
+ printStatus ("Expected type '" + expected_t + "' matched actual " +
+ "type '" + actual_t + "'");
+ }
+
+ if (expected != actual)
+ {
+ output += "Expected value '" + toPrinted(expected) +
+ "', Actual value '" + toPrinted(actual) + "' ";
+ }
+ else if (VERBOSE)
+ {
+ printStatus ("Expected value '" + toPrinted(expected) +
+ "' matched actual value '" + toPrinted(actual) + "'");
+ }
+
+ var testcase = new TestCase(gTestfile, description, expected, actual);
+ testcase.reason = output;
+
+ if (testcase.passed)
+ {
+ print(PASSED + description);
+ }
+ else
+ {
+ reportFailure (description + " : " + output);
+ }
+
+ return testcase.passed;
+}
+
+/*
+ * Attempt to match a regular expression describing the result to
+ * the actual result, if they differ (in value and/or
+ * type) report a failure. If description is provided, include it in the
+ * failure report.
+ */
+function reportMatch (expectedRegExp, actual, description) {
+ var expected_t = "string";
+ var actual_t = typeof actual;
+ var output = "";
+
+ if (typeof description == "undefined")
+ {
+ description = '';
+ }
+ else if (VERBOSE)
+ {
+ printStatus ("Comparing '" + description + "'");
+ }
+
+ if (expected_t != actual_t)
+ {
+ output += "Type mismatch, expected type " + expected_t +
+ ", actual type " + actual_t + " ";
+ }
+ else if (VERBOSE)
+ {
+ printStatus ("Expected type '" + expected_t + "' matched actual " +
+ "type '" + actual_t + "'");
+ }
+
+ var matches = expectedRegExp.test(actual);
+ if (!matches)
+ {
+ output += "Expected match to '" + toPrinted(expectedRegExp) +
+ "', Actual value '" + toPrinted(actual) + "' ";
+ }
+ else if (VERBOSE)
+ {
+ printStatus ("Expected match to '" + toPrinted(expectedRegExp) +
+ "' matched actual value '" + toPrinted(actual) + "'");
+ }
+
+ var testcase = new TestCase(gTestfile, description, true, matches);
+ testcase.reason = output;
+
+ if (testcase.passed)
+ {
+ print(PASSED + description);
+ }
+ else
+ {
+ reportFailure (description + " : " + output);
+ }
+
+ return testcase.passed;
+}
+
+/*
+ * Puts funcName at the top of the call stack. This stack is used to show
+ * a function-reported-from field when reporting failures.
+ */
+function enterFunc (funcName)
+{
+ if (!funcName.match(/\(\)$/))
+ funcName += "()";
+
+ callStack.push(funcName);
+}
+
+/*
+ * Pops the top funcName off the call stack. funcName is optional, and can be
+ * used to check push-pop balance.
+ */
+function exitFunc (funcName)
+{
+ var lastFunc = callStack.pop();
+
+ if (funcName)
+ {
+ if (!funcName.match(/\(\)$/))
+ funcName += "()";
+
+ if (lastFunc != funcName)
+ reportCompare(funcName, lastFunc, "Test driver failure wrong exit function ");
+ }
+}
+
+/*
+ * Peeks at the top of the call stack.
+ */
+function currentFunc()
+{
+ return callStack[callStack.length - 1];
+}
+
+/*
+ Calculate the "order" of a set of data points {X: [], Y: []}
+ by computing successive "derivatives" of the data until
+ the data is exhausted or the derivative is linear.
+*/
+function BigO(data)
+{
+ var order = 0;
+ var origLength = data.X.length;
+
+ while (data.X.length > 2)
+ {
+ var lr = new LinearRegression(data);
+ if (lr.b > 1e-6)
+ {
+ // only increase the order if the slope
+ // is "great" enough
+ order++;
+ }
+
+ if (lr.r > 0.98 || lr.Syx < 1 || lr.b < 1e-6)
+ {
+ // terminate if close to a line lr.r
+ // small error lr.Syx
+ // small slope lr.b
+ break;
+ }
+ data = dataDeriv(data);
+ }
+
+ if (2 == origLength - order)
+ {
+ order = Number.POSITIVE_INFINITY;
+ }
+ return order;
+
+ function LinearRegression(data)
+ {
+ /*
+ y = a + bx
+ for data points (Xi, Yi); 0 <= i < n
+
+ b = (n*SUM(XiYi) - SUM(Xi)*SUM(Yi))/(n*SUM(Xi*Xi) - SUM(Xi)*SUM(Xi))
+ a = (SUM(Yi) - b*SUM(Xi))/n
+ */
+ var i;
+
+ if (data.X.length != data.Y.length)
+ {
+ throw 'LinearRegression: data point length mismatch';
+ }
+ if (data.X.length < 3)
+ {
+ throw 'LinearRegression: data point length < 2';
+ }
+ var n = data.X.length;
+ var X = data.X;
+ var Y = data.Y;
+
+ this.Xavg = 0;
+ this.Yavg = 0;
+
+ var SUM_X = 0;
+ var SUM_XY = 0;
+ var SUM_XX = 0;
+ var SUM_Y = 0;
+ var SUM_YY = 0;
+
+ for (i = 0; i < n; i++)
+ {
+ SUM_X += X[i];
+ SUM_XY += X[i]*Y[i];
+ SUM_XX += X[i]*X[i];
+ SUM_Y += Y[i];
+ SUM_YY += Y[i]*Y[i];
+ }
+
+ this.b = (n * SUM_XY - SUM_X * SUM_Y)/(n * SUM_XX - SUM_X * SUM_X);
+ this.a = (SUM_Y - this.b * SUM_X)/n;
+
+ this.Xavg = SUM_X/n;
+ this.Yavg = SUM_Y/n;
+
+ var SUM_Ydiff2 = 0;
+ var SUM_Xdiff2 = 0;
+ var SUM_XdiffYdiff = 0;
+
+ for (i = 0; i < n; i++)
+ {
+ var Ydiff = Y[i] - this.Yavg;
+ var Xdiff = X[i] - this.Xavg;
+
+ SUM_Ydiff2 += Ydiff * Ydiff;
+ SUM_Xdiff2 += Xdiff * Xdiff;
+ SUM_XdiffYdiff += Xdiff * Ydiff;
+ }
+
+ var Syx2 = (SUM_Ydiff2 - Math.pow(SUM_XdiffYdiff/SUM_Xdiff2, 2))/(n - 2);
+ var r2 = Math.pow((n*SUM_XY - SUM_X * SUM_Y), 2) /
+ ((n*SUM_XX - SUM_X*SUM_X)*(n*SUM_YY-SUM_Y*SUM_Y));
+
+ this.Syx = Math.sqrt(Syx2);
+ this.r = Math.sqrt(r2);
+
+ }
+
+ function dataDeriv(data)
+ {
+ if (data.X.length != data.Y.length)
+ {
+ throw 'length mismatch';
+ }
+ var length = data.X.length;
+
+ if (length < 2)
+ {
+ throw 'length ' + length + ' must be >= 2';
+ }
+ var X = data.X;
+ var Y = data.Y;
+
+ var deriv = {X: [], Y: [] };
+
+ for (var i = 0; i < length - 1; i++)
+ {
+ deriv.X[i] = (X[i] + X[i+1])/2;
+ deriv.Y[i] = (Y[i+1] - Y[i])/(X[i+1] - X[i]);
+ }
+ return deriv;
+ }
+
+ return 0;
+}
+
+function compareSource(expect, actual, summary)
+{
+ // compare source
+ var expectP = expect.
+ replace(/([(){},.:\[\]])/mg, ' $1 ').
+ replace(/(\w+)/mg, ' $1 ').
+ replace(/<(\/)? (\w+) (\/)?>/mg, '<$1$2$3>').
+ replace(/\s+/mg, ' ').
+ replace(/new (\w+)\s*\(\s*\)/mg, 'new $1');
+
+ var actualP = actual.
+ replace(/([(){},.:\[\]])/mg, ' $1 ').
+ replace(/(\w+)/mg, ' $1 ').
+ replace(/<(\/)? (\w+) (\/)?>/mg, '<$1$2$3>').
+ replace(/\s+/mg, ' ').
+ replace(/new (\w+)\s*\(\s*\)/mg, 'new $1');
+
+ print('expect:\n' + expectP);
+ print('actual:\n' + actualP);
+
+ reportCompare(expectP, actualP, summary);
+
+ // actual must be compilable if expect is?
+ try
+ {
+ var expectCompile = 'No Error';
+ var actualCompile;
+
+ eval(expect);
+ try
+ {
+ eval(actual);
+ actualCompile = 'No Error';
+ }
+ catch(ex1)
+ {
+ actualCompile = ex1 + '';
+ }
+ reportCompare(expectCompile, actualCompile,
+ summary + ': compile actual');
+ }
+ catch(ex)
+ {
+ }
+}
+
+function optionsInit() {
+
+ // record initial values to support resetting
+ // options to their initial values
+ options.initvalues = {};
+
+ // record values in a stack to support pushing
+ // and popping options
+ options.stackvalues = [];
+
+ var optionNames = options().split(',');
+
+ for (var i = 0; i < optionNames.length; i++)
+ {
+ var optionName = optionNames[i];
+ if (optionName)
+ {
+ options.initvalues[optionName] = '';
+ }
+ }
+}
+
+function optionsClear() {
+
+ // turn off current settings
+ var optionNames = options().split(',');
+ for (var i = 0; i < optionNames.length; i++)
+ {
+ var optionName = optionNames[i];
+ if (optionName)
+ {
+ options(optionName);
+ }
+ }
+}
+
+function optionsPush()
+{
+ var optionsframe = {};
+
+ options.stackvalues.push(optionsframe);
+
+ var optionNames = options().split(',');
+
+ for (var i = 0; i < optionNames.length; i++)
+ {
+ var optionName = optionNames[i];
+ if (optionName)
+ {
+ optionsframe[optionName] = '';
+ }
+ }
+
+ optionsClear();
+}
+
+function optionsPop()
+{
+ var optionsframe = options.stackvalues.pop();
+
+ optionsClear();
+
+ for (optionName in optionsframe)
+ {
+ options(optionName);
+ }
+
+}
+
+function optionsReset() {
+
+ optionsClear();
+
+ // turn on initial settings
+ for (optionName in options.initvalues)
+ {
+ options(optionName);
+ }
+}
+
+if (typeof options == 'function')
+{
+ optionsInit();
+ optionsClear();
+}
+
+function getTestCaseResult(expected, actual)
+{
+ var expected_t = typeof expected;
+ var actual_t = typeof actual;
+ var passed = true;
+
+ // because ( NaN == NaN ) always returns false, need to do
+ // a special compare to see if we got the right result.
+ if ( actual != actual )
+ {
+ if ( actual_t == "object" )
+ {
+ actual = "NaN object";
+ }
+ else
+ {
+ actual = "NaN number";
+ }
+ }
+ if ( expected != expected )
+ {
+ if ( expected_t == "object" )
+ {
+ expected = "NaN object";
+ }
+ else
+ {
+ expected = "NaN number";
+ }
+ }
+
+ if (expected_t != actual_t)
+ {
+ passed = false;
+ }
+ else if (expected != actual)
+ {
+ if (expected_t != 'number' || (Math.abs(actual - expected) > 1E-10))
+ {
+ passed = false;
+ }
+ }
+
+ return passed;
+}
+
+if (typeof dump == 'undefined')
+{
+ if (typeof window == 'undefined' &&
+ typeof print == 'function')
+ {
+ dump = print;
+ }
+ else
+ {
+ dump = (function () {});
+ }
+}
+
+function test() {
+ for ( gTc=0; gTc < gTestcases.length; gTc++ ) {
+ // temporary hack to work around some unknown issue in 1.7
+ try
+ {
+ gTestcases[gTc].passed = writeTestCaseResult(
+ gTestcases[gTc].expect,
+ gTestcases[gTc].actual,
+ gTestcases[gTc].description +" = "+ gTestcases[gTc].actual );
+ gTestcases[gTc].reason += ( gTestcases[gTc].passed ) ? "" : "wrong value ";
+ }
+ catch(e)
+ {
+ print('test(): empty testcase for gTc = ' + gTc + ' ' + e);
+ }
+ }
+ stopTest();
+ return ( gTestcases );
+}
+
+/*
+ * Begin printing functions. These functions use the shell's
+ * print function. When running tests in the browser, these
+ * functions, override these functions with functions that use
+ * document.write.
+ */
+
+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 = ( passed ? PASSED : FAILED ) + string + ' expected: ' + expect;
+ print(s);
+ return passed;
+}
+
+function writeHeaderToLog( string ) {
+ print( string );
+}
+/* end of print functions */
+
+
+/*
+ * When running in the shell, run the garbage collector after the
+ * test has completed.
+ */
+
+function stopTest() {
+ var gc;
+ if ( gc != undefined ) {
+ gc();
+ }
+}
+
+/*
+ * Convenience function for displaying failed test cases. Useful
+ * when running tests manually.
+ *
+ */
+function getFailedCases() {
+ for ( var i = 0; i < gTestcases.length; i++ ) {
+ if ( ! gTestcases[i].passed ) {
+ print( gTestcases[i].description + " = " +gTestcases[i].actual +
+ " expected: " + gTestcases[i].expect );
+ }
+ }
+}
+
+function jsTestDriverEnd()
+{
+ // gDelayTestDriverEnd is used to
+ // delay collection of the test result and
+ // signal to Spider so that tests can continue
+ // to run after page load has fired. They are
+ // responsible for setting gDelayTestDriverEnd = true
+ // then when completed, setting gDelayTestDriverEnd = false
+ // then calling jsTestDriverEnd()
+
+ if (gDelayTestDriverEnd)
+ {
+ return;
+ }
+
+ try
+ {
+ optionsReset();
+ }
+ catch(ex)
+ {
+ dump('jsTestDriverEnd ' + ex);
+ }
+
+ for (var i = 0; i < gTestcases.length; i++)
+ {
+ gTestcases[i].dump();
+ }
+
+}
+
+function jit(on)
+{
+ if (on && !options().match(/jit/))
+ {
+ options('jit');
+ }
+ else if (!on && options().match(/jit/))
+ {
+ options('jit');
+ }
+}
+
+/*
+ * Some tests need to know if we are in Rhino as opposed to SpiderMonkey
+ */
+function inRhino()
+{
+ return (typeof defineClass == "function");
+}
+
+/* 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/qml/parserstress/tst_parserstress.cpp b/tests/auto/qml/parserstress/tst_parserstress.cpp
new file mode 100644
index 0000000000..c7f4840a11
--- /dev/null
+++ b/tests/auto/qml/parserstress/tst_parserstress.cpp
@@ -0,0 +1,154 @@
+/****************************************************************************
+**
+** 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 <qtest.h>
+#include <QQmlEngine>
+#include <QQmlComponent>
+#include <QDebug>
+#include <QDir>
+#include <QFile>
+
+class tst_parserstress : public QObject
+{
+ Q_OBJECT
+public:
+ tst_parserstress() {}
+
+private slots:
+ void ecmascript_data();
+ void ecmascript();
+
+private:
+ static QStringList findJSFiles(const QDir &);
+ QQmlEngine engine;
+};
+
+QStringList tst_parserstress::findJSFiles(const QDir &d)
+{
+ QStringList rv;
+
+ QStringList files = d.entryList(QStringList() << QLatin1String("*.js"),
+ QDir::Files);
+ foreach (const QString &file, files) {
+ if (file == "browser.js")
+ continue;
+ 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 << findJSFiles(sub);
+ }
+
+ return rv;
+}
+
+void tst_parserstress::ecmascript_data()
+{
+#ifdef TESTDATADIR
+ QDir dir(TESTDATADIR);
+ QStringList files = findJSFiles(dir);
+
+ QTest::addColumn<QString>("file");
+ foreach (const QString &file, files) {
+ QTest::newRow(qPrintable(file)) << file;
+ }
+#endif
+}
+
+void tst_parserstress::ecmascript()
+{
+ QFETCH(QString, file);
+
+ QFile f(file);
+ QVERIFY(f.open(QIODevice::ReadOnly));
+
+ QByteArray data = f.readAll();
+
+ QVERIFY(!data.isEmpty());
+
+ QString dataStr = QString::fromUtf8(data);
+
+ QString qml = "import QtQuick 2.0\n";
+ qml+= "\n";
+ qml+= "QtObject {\n";
+ qml+= " property int test\n";
+ qml+= " test: {\n";
+ qml+= dataStr + "\n";
+ qml+= " return 1;\n";
+ qml+= " }\n";
+ qml+= " function stress() {\n";
+ qml+= dataStr;
+ qml+= " }\n";
+ qml+= "}\n";
+
+ QByteArray qmlData = qml.toUtf8();
+
+ QQmlComponent component(&engine);
+
+ component.setData(qmlData, QUrl::fromLocalFile(SRCDIR + QString("/dummy.qml")));
+
+ QFileInfo info(file);
+
+ if (info.fileName() == QLatin1String("regress-352044-02-n.js")) {
+ QVERIFY(component.isError());
+
+ QCOMPARE(component.errors().length(), 2);
+
+ QCOMPARE(component.errors().at(0).description(), QString("Expected token `;'"));
+ QCOMPARE(component.errors().at(0).line(), 66);
+
+ QCOMPARE(component.errors().at(1).description(), QString("Expected token `;'"));
+ QCOMPARE(component.errors().at(1).line(), 142);
+
+ } else {
+
+ QVERIFY(!component.isError());
+ }
+}
+
+
+QTEST_MAIN(tst_parserstress)
+
+#include "tst_parserstress.moc"