From 3a0510b7cd6a35a68b2ffd1ec21d266728e6262f Mon Sep 17 00:00:00 2001 From: David Teller Date: Tue, 19 Sep 2017 20:50:21 +0200 Subject: [PATCH] Bug 1377007 - Tests: Parsing ECMA2-level tests with binjs;r=arai,jorendorff MozReview-Commit-ID: 2DysquT2BdD --HG-- extra : rebase_source : 40c1531d2c8cedf7ffc8e87053a4a73068bc86d1 --- .eslintignore | 1 + .../parser/tester/StrictEquality-001.binjs | Bin 0 -> 7935 bytes .../parser/tester/StrictEquality-001.js | 73 +++++ .../binast/parser/tester/apply-001-n.binjs | Bin 0 -> 4825 bytes .../binast/parser/tester/apply-001-n.js | 29 ++ .../binast/parser/tester/boolean-001.binjs | Bin 0 -> 7700 bytes .../binast/parser/tester/boolean-001.js | 47 +++ .../binast/parser/tester/boolean-002.binjs | Bin 0 -> 7749 bytes .../binast/parser/tester/boolean-002.js | 51 +++ .../binast/parser/tester/call-1.binjs | Bin 0 -> 6585 bytes .../binast/parser/tester/call-1.js | 42 +++ .../parser/tester/constructor-001.binjs | Bin 0 -> 7148 bytes .../binast/parser/tester/constructor-001.js | 66 ++++ .../binast/parser/tester/date-002.binjs | Bin 0 -> 8840 bytes .../binast/parser/tester/date-002.js | 54 ++++ .../binast/parser/tester/date-003.binjs | Bin 0 -> 8996 bytes .../binast/parser/tester/date-003.js | 56 ++++ .../binast/parser/tester/date-004.binjs | Bin 0 -> 8655 bytes .../binast/parser/tester/date-004.js | 50 +++ .../binast/parser/tester/dowhile-001.binjs | Bin 0 -> 7058 bytes .../binast/parser/tester/dowhile-001.js | 44 +++ .../binast/parser/tester/dowhile-002.binjs | Bin 0 -> 10101 bytes .../binast/parser/tester/dowhile-002.js | 71 +++++ .../binast/parser/tester/dowhile-003.binjs | Bin 0 -> 11729 bytes .../binast/parser/tester/dowhile-003.js | 63 ++++ .../binast/parser/tester/dowhile-004.binjs | Bin 0 -> 9961 bytes .../binast/parser/tester/dowhile-004.js | 67 ++++ .../binast/parser/tester/dowhile-005.binjs | Bin 0 -> 9175 bytes .../binast/parser/tester/dowhile-005.js | 73 +++++ .../binast/parser/tester/dowhile-006.binjs | Bin 0 -> 15060 bytes .../binast/parser/tester/dowhile-006.js | 89 ++++++ .../binast/parser/tester/dowhile-007.binjs | Bin 0 -> 21270 bytes .../binast/parser/tester/dowhile-007.js | 97 ++++++ .../binast/parser/tester/exception-001.binjs | Bin 0 -> 6518 bytes .../binast/parser/tester/exception-001.js | 45 +++ .../binast/parser/tester/exception-002.binjs | Bin 0 -> 6710 bytes .../binast/parser/tester/exception-002.js | 45 +++ .../binast/parser/tester/exception-003.binjs | Bin 0 -> 8413 bytes .../binast/parser/tester/exception-003.js | 49 +++ .../binast/parser/tester/exception-004.binjs | Bin 0 -> 6792 bytes .../binast/parser/tester/exception-004.js | 45 +++ .../binast/parser/tester/exception-005.binjs | Bin 0 -> 6792 bytes .../binast/parser/tester/exception-005.js | 45 +++ .../binast/parser/tester/exception-006.binjs | Bin 0 -> 8294 bytes .../binast/parser/tester/exception-006.js | 56 ++++ .../binast/parser/tester/exception-007.binjs | Bin 0 -> 8695 bytes .../binast/parser/tester/exception-007.js | 57 ++++ .../binast/parser/tester/exception-008.binjs | Bin 0 -> 6852 bytes .../binast/parser/tester/exception-008.js | 44 +++ .../binast/parser/tester/exception-009.binjs | Bin 0 -> 7026 bytes .../binast/parser/tester/exception-009.js | 53 ++++ .../parser/tester/exception-010-n.binjs | Bin 0 -> 4817 bytes .../binast/parser/tester/exception-010-n.js | 25 ++ .../parser/tester/exception-011-n.binjs | Bin 0 -> 4530 bytes .../binast/parser/tester/exception-011-n.js | 26 ++ .../binast/parser/tester/exec-002.binjs | Bin 0 -> 23367 bytes .../binast/parser/tester/exec-002.js | 188 +++++++++++ .../binast/parser/tester/expression-001.binjs | Bin 0 -> 6002 bytes .../binast/parser/tester/expression-001.js | 50 +++ .../binast/parser/tester/expression-002.binjs | Bin 0 -> 11122 bytes .../binast/parser/tester/expression-002.js | 60 ++++ .../binast/parser/tester/expression-003.binjs | Bin 0 -> 10356 bytes .../binast/parser/tester/expression-003.js | 55 ++++ .../binast/parser/tester/expression-004.binjs | Bin 0 -> 10202 bytes .../binast/parser/tester/expression-004.js | 49 +++ .../binast/parser/tester/expression-005.binjs | Bin 0 -> 6146 bytes .../binast/parser/tester/expression-005.js | 41 +++ .../binast/parser/tester/expression-006.binjs | Bin 0 -> 7177 bytes .../binast/parser/tester/expression-006.js | 46 +++ .../binast/parser/tester/expression-007.binjs | Bin 0 -> 6728 bytes .../binast/parser/tester/expression-007.js | 44 +++ .../binast/parser/tester/expression-008.binjs | Bin 0 -> 6615 bytes .../binast/parser/tester/expression-008.js | 41 +++ .../binast/parser/tester/expression-009.binjs | Bin 0 -> 6652 bytes .../binast/parser/tester/expression-009.js | 42 +++ .../binast/parser/tester/expression-010.binjs | Bin 0 -> 6623 bytes .../binast/parser/tester/expression-010.js | 43 +++ .../binast/parser/tester/expression-011.binjs | Bin 0 -> 6754 bytes .../binast/parser/tester/expression-011.js | 43 +++ .../binast/parser/tester/expression-012.binjs | Bin 0 -> 7215 bytes .../binast/parser/tester/expression-012.js | 44 +++ .../binast/parser/tester/expression-013.binjs | Bin 0 -> 7198 bytes .../binast/parser/tester/expression-013.js | 44 +++ .../binast/parser/tester/expression-014.binjs | Bin 0 -> 7117 bytes .../binast/parser/tester/expression-014.js | 46 +++ .../binast/parser/tester/expression-015.binjs | Bin 0 -> 6274 bytes .../binast/parser/tester/expression-015.js | 40 +++ .../binast/parser/tester/expression-016.binjs | Bin 0 -> 6523 bytes .../binast/parser/tester/expression-016.js | 40 +++ .../binast/parser/tester/expression-017.binjs | Bin 0 -> 6319 bytes .../binast/parser/tester/expression-017.js | 40 +++ .../binast/parser/tester/expression-019.binjs | Bin 0 -> 7291 bytes .../binast/parser/tester/expression-019.js | 44 +++ .../binast/parser/tester/forin-001.binjs | Bin 0 -> 55280 bytes .../binast/parser/tester/forin-001.js | 297 ++++++++++++++++++ .../binast/parser/tester/forin-002.binjs | Bin 0 -> 15210 bytes .../binast/parser/tester/forin-002.js | 77 +++++ .../binast/parser/tester/function-001.binjs | Bin 0 -> 3935 bytes .../binast/parser/tester/function-001.js | 41 +++ .../binast/parser/tester/global-001.binjs | Bin 0 -> 6258 bytes .../binast/parser/tester/global-001.js | 45 +++ .../binast/parser/tester/global-002.binjs | Bin 0 -> 6254 bytes .../binast/parser/tester/global-002.js | 45 +++ .../binast/parser/tester/hex-001.binjs | Bin 0 -> 18562 bytes .../binast/parser/tester/hex-001.js | 68 ++++ .../binast/parser/tester/if-001.binjs | Bin 0 -> 5066 bytes .../binast/parser/tester/if-001.js | 42 +++ .../binast/parser/tester/instanceof-001.binjs | Bin 0 -> 4242 bytes .../binast/parser/tester/instanceof-001.js | 34 ++ .../binast/parser/tester/instanceof-002.binjs | Bin 0 -> 6327 bytes .../binast/parser/tester/instanceof-002.js | 51 +++ .../parser/tester/instanceof-003-n.binjs | Bin 0 -> 21454 bytes .../binast/parser/tester/instanceof-003-n.js | 88 ++++++ .../binast/parser/tester/instanceof-003.binjs | Bin 0 -> 6082 bytes .../binast/parser/tester/instanceof-003.js | 65 ++++ .../parser/tester/instanceof-004-n.binjs | Bin 0 -> 21635 bytes .../binast/parser/tester/instanceof-004-n.js | 88 ++++++ .../parser/tester/instanceof-005-n.binjs | Bin 0 -> 21583 bytes .../binast/parser/tester/instanceof-005-n.js | 89 ++++++ .../binast/parser/tester/instanceof-006.binjs | Bin 0 -> 20918 bytes .../binast/parser/tester/instanceof-006.js | 86 +++++ .../binast/parser/tester/keywords-001.binjs | Bin 0 -> 6811 bytes .../binast/parser/tester/keywords-001.js | 48 +++ .../binast/parser/tester/label-001.binjs | Bin 0 -> 7746 bytes .../binast/parser/tester/label-001.js | 42 +++ .../binast/parser/tester/label-002.binjs | Bin 0 -> 13403 bytes .../binast/parser/tester/label-002.js | 56 ++++ .../binast/parser/tester/label-003.binjs | Bin 0 -> 2239 bytes .../binast/parser/tester/label-003.js | 15 + .../binast/parser/tester/lexical-001.binjs | Bin 0 -> 6153 bytes .../binast/parser/tester/lexical-001.js | 52 +++ .../binast/parser/tester/lexical-002.binjs | Bin 0 -> 6134 bytes .../binast/parser/tester/lexical-002.js | 52 +++ .../binast/parser/tester/lexical-003.binjs | Bin 0 -> 6286 bytes .../binast/parser/tester/lexical-003.js | 43 +++ .../binast/parser/tester/lexical-004.binjs | Bin 0 -> 6264 bytes .../binast/parser/tester/lexical-004.js | 52 +++ .../binast/parser/tester/lexical-005.binjs | Bin 0 -> 6258 bytes .../binast/parser/tester/lexical-005.js | 52 +++ .../binast/parser/tester/lexical-006.binjs | Bin 0 -> 6274 bytes .../binast/parser/tester/lexical-006.js | 58 ++++ .../binast/parser/tester/lexical-007.binjs | Bin 0 -> 6258 bytes .../binast/parser/tester/lexical-007.js | 51 +++ .../binast/parser/tester/lexical-008.binjs | Bin 0 -> 6272 bytes .../binast/parser/tester/lexical-008.js | 53 ++++ .../binast/parser/tester/lexical-009.binjs | Bin 0 -> 6278 bytes .../binast/parser/tester/lexical-009.js | 53 ++++ .../binast/parser/tester/lexical-011.binjs | Bin 0 -> 8799 bytes .../binast/parser/tester/lexical-011.js | 62 ++++ .../binast/parser/tester/lexical-012.binjs | Bin 0 -> 6271 bytes .../binast/parser/tester/lexical-012.js | 53 ++++ .../binast/parser/tester/lexical-013.binjs | Bin 0 -> 6275 bytes .../binast/parser/tester/lexical-013.js | 53 ++++ .../binast/parser/tester/lexical-014.binjs | Bin 0 -> 8806 bytes .../binast/parser/tester/lexical-014.js | 62 ++++ .../binast/parser/tester/lexical-015.binjs | Bin 0 -> 6273 bytes .../binast/parser/tester/lexical-015.js | 53 ++++ .../binast/parser/tester/lexical-016.binjs | Bin 0 -> 8799 bytes .../binast/parser/tester/lexical-016.js | 62 ++++ .../binast/parser/tester/lexical-017.binjs | Bin 0 -> 6265 bytes .../binast/parser/tester/lexical-017.js | 54 ++++ .../binast/parser/tester/lexical-018.binjs | Bin 0 -> 6275 bytes .../binast/parser/tester/lexical-018.js | 53 ++++ .../binast/parser/tester/lexical-019.binjs | Bin 0 -> 6271 bytes .../binast/parser/tester/lexical-019.js | 53 ++++ .../binast/parser/tester/lexical-020.binjs | Bin 0 -> 6271 bytes .../binast/parser/tester/lexical-020.js | 53 ++++ .../binast/parser/tester/lexical-021.binjs | Bin 0 -> 8801 bytes .../binast/parser/tester/lexical-021.js | 62 ++++ .../binast/parser/tester/lexical-023.binjs | Bin 0 -> 6271 bytes .../binast/parser/tester/lexical-023.js | 52 +++ .../binast/parser/tester/lexical-024.binjs | Bin 0 -> 6252 bytes .../binast/parser/tester/lexical-024.js | 59 ++++ .../binast/parser/tester/lexical-025.binjs | Bin 0 -> 6248 bytes .../binast/parser/tester/lexical-025.js | 59 ++++ .../binast/parser/tester/lexical-026.binjs | Bin 0 -> 6248 bytes .../binast/parser/tester/lexical-026.js | 59 ++++ .../binast/parser/tester/lexical-027.binjs | Bin 0 -> 6248 bytes .../binast/parser/tester/lexical-027.js | 61 ++++ .../binast/parser/tester/lexical-028.binjs | Bin 0 -> 6268 bytes .../binast/parser/tester/lexical-028.js | 59 ++++ .../binast/parser/tester/lexical-029.binjs | Bin 0 -> 6272 bytes .../binast/parser/tester/lexical-029.js | 59 ++++ .../binast/parser/tester/lexical-030.binjs | Bin 0 -> 6268 bytes .../binast/parser/tester/lexical-030.js | 59 ++++ .../binast/parser/tester/lexical-031.binjs | Bin 0 -> 6254 bytes .../binast/parser/tester/lexical-031.js | 59 ++++ .../binast/parser/tester/lexical-032.binjs | Bin 0 -> 6260 bytes .../binast/parser/tester/lexical-032.js | 59 ++++ .../binast/parser/tester/lexical-033.binjs | Bin 0 -> 6252 bytes .../binast/parser/tester/lexical-033.js | 59 ++++ .../binast/parser/tester/lexical-034.binjs | Bin 0 -> 6255 bytes .../binast/parser/tester/lexical-034.js | 58 ++++ .../binast/parser/tester/lexical-035.binjs | Bin 0 -> 6251 bytes .../binast/parser/tester/lexical-035.js | 59 ++++ .../binast/parser/tester/lexical-036.binjs | Bin 0 -> 6256 bytes .../binast/parser/tester/lexical-036.js | 59 ++++ .../binast/parser/tester/lexical-037.binjs | Bin 0 -> 6246 bytes .../binast/parser/tester/lexical-037.js | 59 ++++ .../binast/parser/tester/lexical-038.binjs | Bin 0 -> 6260 bytes .../binast/parser/tester/lexical-038.js | 59 ++++ .../binast/parser/tester/lexical-039.binjs | Bin 0 -> 6253 bytes .../binast/parser/tester/lexical-039.js | 46 +++ .../binast/parser/tester/lexical-040.binjs | Bin 0 -> 6253 bytes .../binast/parser/tester/lexical-040.js | 46 +++ .../binast/parser/tester/lexical-041.binjs | Bin 0 -> 7088 bytes .../binast/parser/tester/lexical-041.js | 48 +++ .../binast/parser/tester/lexical-042.binjs | Bin 0 -> 7085 bytes .../binast/parser/tester/lexical-042.js | 49 +++ .../binast/parser/tester/lexical-047.binjs | Bin 0 -> 7567 bytes .../binast/parser/tester/lexical-047.js | 50 +++ .../binast/parser/tester/lexical-048.binjs | Bin 0 -> 6779 bytes .../binast/parser/tester/lexical-048.js | 44 +++ .../binast/parser/tester/lexical-049.binjs | Bin 0 -> 7602 bytes .../binast/parser/tester/lexical-049.js | 49 +++ .../binast/parser/tester/lexical-050.binjs | Bin 0 -> 6284 bytes .../binast/parser/tester/lexical-050.js | 45 +++ .../binast/parser/tester/lexical-051.binjs | Bin 0 -> 6321 bytes .../binast/parser/tester/lexical-051.js | 45 +++ .../binast/parser/tester/lexical-052.binjs | Bin 0 -> 7315 bytes .../binast/parser/tester/lexical-052.js | 47 +++ .../binast/parser/tester/lexical-053.binjs | Bin 0 -> 6943 bytes .../binast/parser/tester/lexical-053.js | 45 +++ .../binast/parser/tester/lexical-054.binjs | Bin 0 -> 7538 bytes .../binast/parser/tester/lexical-054.js | 46 +++ .../binast/parser/tester/match-001.binjs | Bin 0 -> 21482 bytes .../binast/parser/tester/match-001.js | 106 +++++++ .../binast/parser/tester/match-002.binjs | Bin 0 -> 36161 bytes .../binast/parser/tester/match-002.js | 174 ++++++++++ .../binast/parser/tester/match-003.binjs | Bin 0 -> 21251 bytes .../binast/parser/tester/match-003.js | 132 ++++++++ .../binast/parser/tester/match-004.binjs | Bin 0 -> 30346 bytes .../binast/parser/tester/match-004.js | 173 ++++++++++ .../binast/parser/tester/multiline-001.binjs | Bin 0 -> 15866 bytes .../binast/parser/tester/multiline-001.js | 68 ++++ .../binast/parser/tester/number-001.binjs | Bin 0 -> 7566 bytes .../binast/parser/tester/number-001.js | 53 ++++ .../binast/parser/tester/number-002.binjs | Bin 0 -> 7588 bytes .../binast/parser/tester/number-002.js | 48 +++ .../binast/parser/tester/number-003.binjs | Bin 0 -> 8026 bytes .../binast/parser/tester/number-003.js | 50 +++ .../binast/parser/tester/octal-001.binjs | Bin 0 -> 12564 bytes .../binast/parser/tester/octal-001.js | 78 +++++ .../binast/parser/tester/octal-002.binjs | Bin 0 -> 16156 bytes .../binast/parser/tester/octal-002.js | 93 ++++++ .../binast/parser/tester/octal-003.binjs | Bin 0 -> 18706 bytes .../binast/parser/tester/octal-003.js | 87 +++++ .../binast/parser/tester/properties-001.binjs | Bin 0 -> 23094 bytes .../binast/parser/tester/properties-001.js | 91 ++++++ .../binast/parser/tester/properties-002.binjs | Bin 0 -> 37649 bytes .../binast/parser/tester/properties-002.js | 129 ++++++++ .../parser/tester/regexp-enumerate-001.binjs | Bin 0 -> 14141 bytes .../parser/tester/regexp-enumerate-001.js | 88 ++++++ .../parser/tester/regexp-literals-001.binjs | Bin 0 -> 4820 bytes .../parser/tester/regexp-literals-001.js | 44 +++ .../parser/tester/regexp-literals-002.binjs | Bin 0 -> 2735 bytes .../parser/tester/regexp-literals-002.js | 28 ++ .../binast/parser/tester/regress-001.binjs | Bin 0 -> 7756 bytes .../binast/parser/tester/regress-001.js | 45 +++ .../binast/parser/tester/regress-7635.binjs | Bin 0 -> 5244 bytes .../binast/parser/tester/regress-7635.js | 55 ++++ .../binast/parser/tester/split-001.binjs | Bin 0 -> 22400 bytes .../binast/parser/tester/split-001.js | 112 +++++++ .../binast/parser/tester/split-002.binjs | Bin 0 -> 70881 bytes .../binast/parser/tester/split-002.js | 270 ++++++++++++++++ .../binast/parser/tester/split-003.binjs | Bin 0 -> 38042 bytes .../binast/parser/tester/split-003.js | 123 ++++++++ .../binast/parser/tester/statement-001.binjs | Bin 0 -> 6268 bytes .../binast/parser/tester/statement-001.js | 47 +++ .../binast/parser/tester/statement-002.binjs | Bin 0 -> 6326 bytes .../binast/parser/tester/statement-002.js | 69 ++++ .../binast/parser/tester/statement-003.binjs | Bin 0 -> 8692 bytes .../binast/parser/tester/statement-003.js | 80 +++++ .../binast/parser/tester/statement-004.binjs | Bin 0 -> 8367 bytes .../binast/parser/tester/statement-004.js | 52 +++ .../binast/parser/tester/statement-005.binjs | Bin 0 -> 8644 bytes .../binast/parser/tester/statement-005.js | 51 +++ .../binast/parser/tester/statement-006.binjs | Bin 0 -> 9022 bytes .../binast/parser/tester/statement-006.js | 51 +++ .../binast/parser/tester/statement-007.binjs | Bin 0 -> 6300 bytes .../binast/parser/tester/statement-007.js | 42 +++ .../binast/parser/tester/statement-008.binjs | Bin 0 -> 6294 bytes .../binast/parser/tester/statement-008.js | 42 +++ .../binast/parser/tester/statement-009.binjs | Bin 0 -> 6133 bytes .../binast/parser/tester/statement-009.js | 41 +++ .../binast/parser/tester/string-001.binjs | Bin 0 -> 7914 bytes .../binast/parser/tester/string-001.js | 53 ++++ .../binast/parser/tester/string-002.binjs | Bin 0 -> 7976 bytes .../binast/parser/tester/string-002.js | 52 +++ .../binast/parser/tester/switch-001.binjs | Bin 0 -> 11212 bytes .../binast/parser/tester/switch-001.js | 65 ++++ .../binast/parser/tester/switch-002.binjs | Bin 0 -> 10566 bytes .../binast/parser/tester/switch-002.js | 63 ++++ .../binast/parser/tester/switch-003.binjs | Bin 0 -> 11449 bytes .../binast/parser/tester/switch-003.js | 57 ++++ .../binast/parser/tester/switch-004.binjs | Bin 0 -> 26087 bytes .../binast/parser/tester/switch-004.js | 94 ++++++ .../binast/parser/tester/try-001.binjs | Bin 0 -> 12926 bytes .../binast/parser/tester/try-001.js | 83 +++++ .../binast/parser/tester/try-003.binjs | Bin 0 -> 12267 bytes .../binast/parser/tester/try-003.js | 82 +++++ .../binast/parser/tester/try-004.binjs | Bin 0 -> 7554 bytes .../binast/parser/tester/try-004.js | 54 ++++ .../binast/parser/tester/try-005.binjs | Bin 0 -> 8284 bytes .../binast/parser/tester/try-005.js | 57 ++++ .../binast/parser/tester/try-006.binjs | Bin 0 -> 12542 bytes .../binast/parser/tester/try-006.js | 87 +++++ .../binast/parser/tester/try-007.binjs | Bin 0 -> 13660 bytes .../binast/parser/tester/try-007.js | 92 ++++++ .../binast/parser/tester/try-008.binjs | Bin 0 -> 11748 bytes .../binast/parser/tester/try-008.js | 59 ++++ .../binast/parser/tester/try-009.binjs | Bin 0 -> 12910 bytes .../binast/parser/tester/try-009.js | 66 ++++ .../binast/parser/tester/try-010.binjs | Bin 0 -> 15697 bytes .../binast/parser/tester/try-010.js | 73 +++++ .../binast/parser/tester/try-012.binjs | Bin 0 -> 12422 bytes .../binast/parser/tester/try-012.js | 95 ++++++ .../binast/parser/tester/unicode-001.binjs | Bin 0 -> 17042 bytes .../binast/parser/tester/unicode-001.js | 59 ++++ .../binast/parser/tester/while-001.binjs | Bin 0 -> 4573 bytes .../binast/parser/tester/while-001.js | 42 +++ .../binast/parser/tester/while-002.binjs | Bin 0 -> 13384 bytes .../binast/parser/tester/while-002.js | 86 +++++ .../binast/parser/tester/while-003.binjs | Bin 0 -> 13218 bytes .../binast/parser/tester/while-003.js | 87 +++++ .../binast/parser/tester/while-004.binjs | Bin 0 -> 34266 bytes .../binast/parser/tester/while-004.js | 217 +++++++++++++ js/src/jsapi-tests/moz.build | 1 + js/src/jsapi-tests/testBinASTReader.cpp | 60 ++-- 329 files changed, 10509 insertions(+), 21 deletions(-) create mode 100644 js/src/jsapi-tests/binast/parser/tester/StrictEquality-001.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/StrictEquality-001.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/apply-001-n.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/apply-001-n.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/boolean-001.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/boolean-001.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/boolean-002.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/boolean-002.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/call-1.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/call-1.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/constructor-001.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/constructor-001.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/date-002.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/date-002.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/date-003.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/date-003.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/date-004.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/date-004.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/dowhile-001.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/dowhile-001.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/dowhile-002.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/dowhile-002.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/dowhile-003.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/dowhile-003.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/dowhile-004.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/dowhile-004.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/dowhile-005.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/dowhile-005.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/dowhile-006.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/dowhile-006.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/dowhile-007.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/dowhile-007.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/exception-001.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/exception-001.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/exception-002.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/exception-002.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/exception-003.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/exception-003.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/exception-004.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/exception-004.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/exception-005.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/exception-005.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/exception-006.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/exception-006.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/exception-007.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/exception-007.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/exception-008.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/exception-008.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/exception-009.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/exception-009.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/exception-010-n.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/exception-010-n.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/exception-011-n.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/exception-011-n.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/exec-002.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/exec-002.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/expression-001.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/expression-001.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/expression-002.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/expression-002.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/expression-003.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/expression-003.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/expression-004.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/expression-004.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/expression-005.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/expression-005.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/expression-006.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/expression-006.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/expression-007.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/expression-007.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/expression-008.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/expression-008.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/expression-009.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/expression-009.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/expression-010.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/expression-010.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/expression-011.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/expression-011.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/expression-012.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/expression-012.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/expression-013.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/expression-013.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/expression-014.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/expression-014.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/expression-015.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/expression-015.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/expression-016.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/expression-016.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/expression-017.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/expression-017.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/expression-019.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/expression-019.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/forin-001.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/forin-001.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/forin-002.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/forin-002.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/function-001.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/function-001.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/global-001.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/global-001.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/global-002.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/global-002.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/hex-001.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/hex-001.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/if-001.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/if-001.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/instanceof-001.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/instanceof-001.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/instanceof-002.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/instanceof-002.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/instanceof-003-n.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/instanceof-003-n.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/instanceof-003.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/instanceof-003.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/instanceof-004-n.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/instanceof-004-n.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/instanceof-005-n.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/instanceof-005-n.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/instanceof-006.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/instanceof-006.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/keywords-001.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/keywords-001.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/label-001.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/label-001.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/label-002.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/label-002.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/label-003.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/label-003.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-001.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-001.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-002.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-002.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-003.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-003.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-004.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-004.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-005.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-005.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-006.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-006.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-007.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-007.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-008.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-008.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-009.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-009.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-011.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-011.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-012.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-012.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-013.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-013.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-014.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-014.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-015.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-015.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-016.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-016.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-017.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-017.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-018.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-018.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-019.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-019.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-020.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-020.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-021.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-021.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-023.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-023.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-024.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-024.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-025.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-025.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-026.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-026.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-027.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-027.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-028.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-028.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-029.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-029.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-030.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-030.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-031.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-031.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-032.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-032.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-033.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-033.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-034.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-034.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-035.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-035.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-036.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-036.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-037.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-037.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-038.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-038.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-039.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-039.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-040.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-040.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-041.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-041.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-042.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-042.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-047.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-047.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-048.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-048.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-049.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-049.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-050.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-050.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-051.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-051.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-052.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-052.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-053.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-053.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-054.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/lexical-054.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/match-001.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/match-001.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/match-002.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/match-002.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/match-003.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/match-003.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/match-004.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/match-004.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/multiline-001.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/multiline-001.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/number-001.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/number-001.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/number-002.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/number-002.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/number-003.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/number-003.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/octal-001.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/octal-001.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/octal-002.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/octal-002.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/octal-003.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/octal-003.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/properties-001.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/properties-001.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/properties-002.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/properties-002.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/regexp-enumerate-001.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/regexp-enumerate-001.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/regexp-literals-001.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/regexp-literals-001.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/regexp-literals-002.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/regexp-literals-002.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/regress-001.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/regress-001.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/regress-7635.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/regress-7635.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/split-001.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/split-001.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/split-002.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/split-002.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/split-003.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/split-003.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/statement-001.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/statement-001.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/statement-002.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/statement-002.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/statement-003.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/statement-003.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/statement-004.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/statement-004.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/statement-005.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/statement-005.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/statement-006.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/statement-006.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/statement-007.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/statement-007.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/statement-008.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/statement-008.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/statement-009.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/statement-009.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/string-001.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/string-001.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/string-002.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/string-002.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/switch-001.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/switch-001.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/switch-002.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/switch-002.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/switch-003.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/switch-003.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/switch-004.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/switch-004.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/try-001.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/try-001.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/try-003.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/try-003.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/try-004.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/try-004.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/try-005.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/try-005.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/try-006.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/try-006.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/try-007.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/try-007.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/try-008.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/try-008.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/try-009.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/try-009.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/try-010.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/try-010.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/try-012.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/try-012.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/unicode-001.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/unicode-001.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/while-001.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/while-001.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/while-002.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/while-002.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/while-003.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/while-003.js create mode 100644 js/src/jsapi-tests/binast/parser/tester/while-004.binjs create mode 100644 js/src/jsapi-tests/binast/parser/tester/while-004.js diff --git a/.eslintignore b/.eslintignore index d00073b3a7bc..6780d2865700 100644 --- a/.eslintignore +++ b/.eslintignore @@ -307,6 +307,7 @@ js/xpconnect/** js/src/devtools/** js/src/octane/** js/src/jit-test/** +js/src/jsapi-tests/binast/** js/src/tests/** js/src/Y.js diff --git a/js/src/jsapi-tests/binast/parser/tester/StrictEquality-001.binjs b/js/src/jsapi-tests/binast/parser/tester/StrictEquality-001.binjs new file mode 100644 index 0000000000000000000000000000000000000000..925b6d52d433c088dc5154744a079d04e936aeef GIT binary patch literal 7935 zcmeHM%We}f6rJ*B1MFcj3l>GFFBV8tX;B-32r4NeQN<3qiJOd=&IFIs$FHzu$8Yc# zu;c^Sv0}l!9#8Cvoryb1tJ1P*RF8e1=RSO0;e&oi*DF0rI_qy)++}3nyW)A?ZrnNc zHtUVo&DCZ*?o+R_B=%IoAmQs94?OP!Q(D99aQ zND;0AnFGSi?Yc-Mt@|BlpP_YkYVVq}vhEEKy;gm*@!^SSnX@^{9_vYjdAUr1}ul5Tr5l=l!*{HUE*xYziaSj{1xy38a7~C!Fp>XbKq8 z;kq@3t0WB7QE{RTOH@UkZUBdfzYWSKoG{*^2`|u4lGUjzIi^tobE#B;urlSoaX=GzZOQyP3HxESnx6DsA^}LOz8C- z?1|9IbqAYq98waEt*LX?LfoK-$`GOjm{l+#hNMhm)L4ZbW(+y2A!~f*<6P9_i2$Er zO31d4oX(bYD#|eb972AA#s)(2zDCPWm-`DnY%}NxL~U--?eDPtVtetA&5Mp*NorhK zU>rh!dN^P^nF?pddr350Z1?tTX*?gKv+Qn){3FWBH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efn(j~we`&iUjBC^1RsH}2 C(igV? literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/apply-001-n.js b/js/src/jsapi-tests/binast/parser/tester/apply-001-n.js new file mode 100644 index 000000000000..eac0584461e3 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/apply-001-n.js @@ -0,0 +1,29 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 4 -*- + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +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/js/src/jsapi-tests/binast/parser/tester/boolean-001.binjs b/js/src/jsapi-tests/binast/parser/tester/boolean-001.binjs new file mode 100644 index 0000000000000000000000000000000000000000..a724010a7b3799aefaa8ad782dab6ceca9bd139e GIT binary patch literal 7700 zcmds6&2AGh5MKU4h#!d?a0oXLqAd~!ghC~n76_^WA`u5Jm76umw%c{&b=rnU;URbq zUV$q&E{I29?Dejvv9ocOB!Zr*)b?l3=b3NDvvn~X#B{yhrzBi|$61e)gWzls1iLI8 z1sl!QoA$GImknr8UsZGJag>VnZ+C*=D$J_m_dx?a8*m~cd7oiv6=x^GOcb?e9ET6|;%i~en-D!5Vw`{wyLwLI7T|nE&+;U~W znP6fxpeur9%kMw1H~9;4w~hy#rYQt_TM$7HAPANB(c=HkXl;-a4$&|)6l-7<@5L(oO6l(*?GIu?!0fdUfH%| zDmR%xvM4p1?e5X82p~~{K8lf3va7A~P!OqaI#rjS+XG8RX_4-2wA=$Q8y={a0W~ij zCWGeS6{_40ADOhPo*psl?gxF6gfZ0e`MU!jdqd6`TU7d9`F%c6DR3U|mCwubYZ*R{ zCk3XWMUTe(d0sV$RFh22?Q2(J{1GNt0q&{)*I;dni5jU*^nUG1g=cB2D|nb8$oPyr zI4v(xUqDscOJp5q0A?wqo*UlqjV(+|JiKLY@s17h0F}~IBGBV^jL{AEGhN^BsRSb^)!^~LgY4rTcr|1oMPf^SjOEd&Nr(2`8shCltFdc4< z%1?oJujs3bE5qcS$d*=vq}U>TW@Q)!wSofoq*{4gw|8@80llC91JbjaeG24fG7n!F z@`~2cdaVft6>kPw%if)iW)yZu&jZMtybmoDdgQ=!xw(gTOc6mBs^@8C#x7|>SG0d( zYQlIPc9&(%32zd-Lq!3ZEsuDZAq7ErwZf<9wr`#I6(-(*P4iD&&eld+@*z%-x!#?6 z$kA`rBNHANdep6 literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/boolean-001.js b/js/src/jsapi-tests/binast/parser/tester/boolean-001.js new file mode 100644 index 000000000000..d2cea72b2913 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/boolean-001.js @@ -0,0 +1,47 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/boolean-002.binjs b/js/src/jsapi-tests/binast/parser/tester/boolean-002.binjs new file mode 100644 index 0000000000000000000000000000000000000000..a52b8a39dfdd3439994c3e4fee0861d161194ac1 GIT binary patch literal 7749 zcmds6&2AGh5MKU42n6B=mvAdWv;`p{p-_p2AX-H!BB2K^m78^wh3z`>I+XAzybX`R zl>-t7cm~E^?|K@0Q)fvc=qcKG{n_(*=9}?sU5th?-KY;J2{&GI*5~9fI2#1PJ`2ae z=2m;V^R&}rLmJfA)I0S!O2x+4J3(+2-m2s2yM#w%Kc+8eFD9Ibh$RXtG|y@9AxgsI zSlv$Ix z3H=7xOC)r+`KB{3LNCD9w>uB_9^1q$pT}Rz<5Ak(-RicQw%ynvJlzt4GuX`Ba&^d= zU}8L^tIC6S4p#2jYy1Vb%}+y4(-dO8BZ#1f5QED3Xz{-@SQ{jc%~Um`2Y*o$V%Tnv z(7pmTr-E?NrKy-=p@zliW*>iJf)q_{0^$9UBqDX1?qSRgz&hffKCeKQDetlt>)SRd zLHPoaZUy^hln_2Pb_G&yK*T|mK}chIAOars2S!J=DoLRGW+6<{0w6tzn73d{18c^> z!tWhk;jz0ZQClEqs$V=h7OJT7Kfx61;3u)>lQv~+(N8@(lqub254(w{LfrzyHmen& zH8J4q$bnrDcN(+jMPLEMa}+xSs{*MK?j?z08ro;Hd>(&;b1un0FN5K`&s%Ssdpj>} z(=n4Tm_Vv1C7bQPr#%rsngn?iW2a(Qo8=)OQr>i;p1yAnEE%LlvbWK42f%E2pvoQU z!l4{9$F5M~cKO&OU3Kq>S?@zIAW0ZQA)jA5@UA!I8xxbJURHjc4^#r2$7SX7^1NCG zkK;apsc6%q33r}X1tPU1({lURl@z~&7p(C1RR3!*x6MS2)JmOSyHep<+Ug1(W(YDq zBR5W`7pTvnrtK%PiZcMSlu^$NZ}`L(CM6!;GOuvQ_IO|#bzXO<^W+I*aKrpeM>pHu z;xwGdB#AmqFqgQMBYh=%hI%pU*3hsG{StFwQ89iyk8yN8z>0KoZQCHCH)zCUlu{Ku zL+A?~miLzMhCMt>g|UgVoCSHqJDo8hYS56KL*PX(WXhr>vb7OX7e=SN%mn<)Wa6YC9N7nR&3MA;mpQ7tNF z)F@1cTch$_;MFVo>f&lJc_y-()gURhNbgx07J^zqb$eW`JdWGDud;x)&;J4GS;{^E z@-vx-?+bZ3Yd2kMfq*-zw!7EhMkJ-|QhZ#~2gjW-MPG#Z`IM$o6X#Q2TJ?xqB++2j7{XT%YY=yh^q{oC`mm+PO5y{JI{Gkr)a7G(NCpS0t`S^n df7j5X_F3xzcRtsH(m1QBqsLD8^x#aVe*kq6)J6aR literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/boolean-002.js b/js/src/jsapi-tests/binast/parser/tester/boolean-002.js new file mode 100644 index 000000000000..8dd55ed6b432 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/boolean-002.js @@ -0,0 +1,51 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/call-1.binjs b/js/src/jsapi-tests/binast/parser/tester/call-1.binjs new file mode 100644 index 0000000000000000000000000000000000000000..c695c8be4ef547bd7005592da25172bb4ad5f837 GIT binary patch literal 6585 zcmeHL%We}f6gBV10@$(5vK6HPBsSG3Qj-P<3Mp!$ZjqBXsoTjo@;EK|0X_hU4WGsr zz+Z6famLPgk~(QpO4Uu(jO}CJ$2q>fffx-#QVNa;?v_4t*5`PDZX<-+tUE^KTH|AL zr`cgcf`X!&6NEGtrEkv>dJMAyd-);e6t_dNM>-+qSWp%zsIK`PqZ1l+r?Gwk&aLyX z7*|lVi)che3Se(v>yk*&9wl7CMR;Hi9ScsQe(3>h)2vonwf#m=)Zc=l2C=c4YJQyx z!f~kJPH{ML@a_X%2Z!Oy*Dl-ywx}Ey=-uwXic`$p>Gtmbha(TG2hCMFvRe7H`{j-6 znag+N9|+PVW#m2Bs#R;%tFGO4MtJ5UuoAr+MIA}K?ICA^iSdwZ%M^9-FW}ee*C8iy z47)T17Gwa#Qw}5P_gscn;2dVDS|N`{46kgPJ^1_x?2QHHqD5jc$3hKjqnmSF#0067 z+62t|Bk71Z*K`kKo&nYw2g&&WT1 z(i4c&{*e(+ElCpSh1tk<(i$K=9Ixyc!I{WjQuKy?=djPSn2|!;!(pBr*$Hz)K=puA1l)kD&LN-&zokO!D7qB4oxL{I z@;-rwHL@y9i(l8CS-NpOFYULWAy+|0b{3bBZT05f?`>?}2uenQ-K@4*>cJ7u8~yjX z1tp{2vQ(Fa#*8Q7a`Lm>Di0_A1JPPA%<_bqMQ+NZLa0Hrh1A*vaj~F#1VU!BShxi+ z>6F<0N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ester/constructor-001.js new file mode 100644 index 000000000000..b268ae5ed099 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/constructor-001.js @@ -0,0 +1,66 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + * 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/js/src/jsapi-tests/binast/parser/tester/date-002.binjs b/js/src/jsapi-tests/binast/parser/tester/date-002.binjs new file mode 100644 index 0000000000000000000000000000000000000000..f79e4756def10a0baceafd9b732d10b198773592 GIT binary patch literal 8840 zcmds6&2Aev5Z?ZzZHgXR^imWEqN9VLvHNps6$7#CAPyWgjTQlND(GEC+Ge#YaH%+Y zmA*`oLmr|)Z#^|nkr^&`IbKo{wO$L2FE+F!KXQgM-+Uzdaz0D>et*JQy#H9_W5K4u zhd~gW=J6spI37M6{XB~D84voqs!u;n3c3I0W)OS<3k!10CtbYLKgLPQBP*6!6Bv~SB06P6~%rluhPqhzFW^^*wBNb!+``KFM1D)M;!-I=2UmZoN?8WF)K zZZeA+?UB*f!QetNAwyos6&7k(if-0%5fhLrwFyj&=je#SX}X6oUjo*d0MdB?Y|KTN zpX6iPCdDRyLYiBdevo8LER0C8sanZu8U+W~qcLcu9RCZ59-+IC-iW)BNVxmFKyFi^}XJef)dP7<;l3A!=a)I5rdLBe~!1<+W=-usQ{H*s#X~CUazx2w_^_|(CdCKhGk(K%lQHhy+g}N}Ls)sWT-RmmH52gAHL?#oyGs9){z^nR-WYB!QzE zZF&lR4er1j&vV4ua?>yAFxE~{gp;H&c7TO;Y3^_*G*tJ99p>Z}-yW~SDBYlTan){= zN1`Jyxvy8~qCJ4H$kk6-4%TQFt6uJ{qP6-@SN?>{xoEt6Rj)s_YNi7`GPs&Y7cx4U zYHU~XS3}#3Su-7K<0aP)<>vvLfiIj_5&uGs_zK2XGT)AhqI{ND1*dTjNShk9NH;n4 zux@ia(dZV`Vzxjhkk+HNZd;qVX~~<>hBGhSxE!3k_Ho$y{nkj|K9=H12G{0 literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/date-002.js b/js/src/jsapi-tests/binast/parser/tester/date-002.js new file mode 100644 index 000000000000..0f379b541276 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/date-002.js @@ -0,0 +1,54 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/date-003.binjs b/js/src/jsapi-tests/binast/parser/tester/date-003.binjs new file mode 100644 index 0000000000000000000000000000000000000000..206cfa318f41de9cc31b42acb195b2a1bb5ff0f6 GIT binary patch literal 8996 zcmds7PjA~c6xaT5zz!P*>@aMAjtPp@8M@Qv23VXFO^`W7Z4|u?jKtV#70ICJrv57X zHv0y<4%n%u_P!6W_b5_&HfftyWuwg{f<^I1zQ^Bt??*CSIh~~Zush}~K71tdkzm)s zhd~fr=J6~zI_;kgei=mhga_S@`lg#Eg*?0rgWyZ}s!O{+VIpCdDL>{>$^?^1o++rf z{#^vmlPsRc`WJ9MScjDh1(n1>k|nYNpu?ZWJd?>)!i9p%*mXVWLW(3C9exJG3{HB( z(~Ew$qu+Hq8iZmE)c5C!f8_Yw4Y!G!%e z9lxO~{{ieBy7I}%<3U@l`~;?cHu&j}pKZtN-jA<$=SQ@Acse{kvF)aW@Fe87fOZUo zygL!O%;jvt?<(S6T-oq%;ntIv6TyoD0(>B0v}*`F#XDZTcSdNBrD@$&^@!jVuj7iE z>=DmjfVqWaLJoN$S6HZFDSADRw=n@Tr8a?y(G(p~I8FC3<}1Lu5s-2oLN4ZFn4jk( z+a{Gu{)8a6;`}Jdn3&ae1(<0db3-PE?3wZ_8Hi*wu9K%uNCa;Xgf=z zfnjZ6#d`-UJZ85dU@PP@;a5K$1HJnR{!{Q81o<>|1Qz9pXJ$gU2P{c>ynH2gS18}W zY^(rUT$6S*2j(dLGU5}|L$>V=T=@+k_Vcg;4dqzmHxBHIfVWYAAfce%@Tfh0K4L}D zGCzl6R@WD$tJ6Gs9*kKQryx{~sHQA9!Y>v&trX)=KMs^QZbOX!2T`%3z`*i!adfsi zB>Mb@RJ1nBEo%4QXBU^xoD5PC^EZ5AIb(Y>f@M_V&Gv|z%{}LAKy!#BGCLLcq~g>< z^e_9Vsn;O))(ca!72O3y3QM!Fg+GaZSIH!gn zMRP@}05mwLFFA91!DG5!0pfv!dTRYH!0=%4S=J8fX?iMv>s|ha>RE35dEAGscP)bz z!1wT-3MH}&o)7+VoQkD-Kss)Z$!Oe5*|gw_FB3RqxL$rxLA!c*NinykmYE1e**G)b zfh9yj%w^`9^|vf+Je<6$Xd924C-wY$=d%q|-#e0RJoxXiz*tpfUhWC(U@}X)^tn3O z0Cts27a=HH+zINO%M}UgJHVz1YSA6;^kim1M{mg0?db|!6Fea4v4Y!cq6~Wqi3;V% zT%z(=Ztt!77ETi04@l4LaR;0a^)S32X8a~Jx^z$d!UMg%gZ=$qL-@j+=k4v=OG#Pi zIWBS|+=C4yjA{eA=N#DEN{8VtM2~r{sz%h8o>0q9OSH5$lQd5{Lc^S~ zS?TaF19O1f_$>9oG>hnQGHkaq zo8tnB3}p*-0%={i>$W9=OSigY4(aHiFzL7`YDmYzzIoNH=*)Q;p&QVd_V!RWIx4Vk camIvhTXSt%mTvX;2N+x_1KrbJa<@|ZA1|O|`~Uy| literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/date-003.js b/js/src/jsapi-tests/binast/parser/tester/date-003.js new file mode 100644 index 000000000000..f8f48c6992f2 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/date-003.js @@ -0,0 +1,56 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/date-004.binjs b/js/src/jsapi-tests/binast/parser/tester/date-004.binjs new file mode 100644 index 0000000000000000000000000000000000000000..75e32116f50ba886aaca695cd325485fd07f71c1 GIT binary patch literal 8655 zcmds6PjA~c6xY`M>4qLQ4CtXiQQwxLSknPJZEk?ZNwE~E7tBV1o(9HZZLPB8QFK#( zm3^}TyX~@li@irt;*0rg(~1(Lxmd6${>bDEA<$)ZfLJ6JZnSqMk{~~&u zWbt{dzX9i?O<1`yP)QsmS)ywIy8KZrGo8Fiq%v@sn7U0DS|!-%2dsd1jmo-qy<0HnolySgbp3{^ z{0p$JP?fI^e;u@?%1>eIF9zTLb}jVy@73uMs&8p z^6^;eVKS9I`~}?e@cm55qJRJ&Xjp9ufoJ?q*6-N}?TIvXQ_YMKypk@iXbc3z^A{j) zp@q^zS?DzqG7;|faS;(PQ(6&(8qZM?1uJ@hFkb=InSzw_Gvs2ahWT+m_GL1;AM#~ypvrFmv7dKp(2ky{{EWe_9q=X+5OgT0H*(aTf1ZeW6RttgK4RM2c)>%g-{YQf1S28BJdP zhq6+3#4_$fPwM!g0f0uj3^>ci*r?ddCwfAUCcRY53u(M&1`YUhbrVl_9iS-Vzs|v` zD4{4@XRSwE)^fgo!-6M3$!K{<5^O=MG+sTa=07-{ZNZ4HNzMuI{{REyX_3xLzU&86 zW!ja`_4x*{>x{Y#LA`~~QO8oR$x-(J8&yypVJ)kJPfyh@=;{r9^*jY=v*|{g;Nd|} z6bv0Of}KF3`UIt?f&`d5xQ)GpF8jlP3~U|01?86&zw@+{$+ON&!`^lt{?sX7S7%&1 z5B;#BMhjdIeWJ4iO%*KV19EO1;0+s+9)}vZU5rLXa1JqGpX;g+)ny>mDq?Agb+yUr zNmpo?E4C{c0b*e6>#ffhpU<-qcKq}*1d-qd!*H{rHF9PcZh+u; z(q*nam>^(^(Y9^tYfy*Rwl*~SC3R2Dnwa4vDV!XjM87h(XbB6|K4Ob8dBe>U)JIYS zHS?=xvjPGg^Adj^LN^@%ghj5td1A6gGhYo-Z{@A^lgUuzHk%8|YAO|)(&cq?Y&}~w z74zJR(}41IPt5dOu_pxoK<@q;=2z_7w^mW!ZgWQmbZDtY*ddmt+A-#?!;bL0nLv7X z!**;153-{i`yim+VGRLg{EmPw^AIwz@GlVUC~EqA<+lTTCuawlvS~*)-0+niYku#; S%BEzKoh(IY`E}*9_W3^r`1AAt literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/date-004.js b/js/src/jsapi-tests/binast/parser/tester/date-004.js new file mode 100644 index 000000000000..fd8733cbddcc --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/date-004.js @@ -0,0 +1,50 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/dowhile-001.binjs b/js/src/jsapi-tests/binast/parser/tester/dowhile-001.binjs new file mode 100644 index 0000000000000000000000000000000000000000..c606d8345fbfeb7256a42cccf4d6285fda744ecb GIT binary patch literal 7058 zcmeHM-EPw`6wdfZAi)JU+(qIBG`3D$qEOhnA_k)%+6{4qyvA*vqF?z!UKd zT)->v1c+nDv7N?E-JeZE?50)Y`13j6`FFi!I0$gn>tWVx}^a|_<`^zHkI5_AyYZQKqJMG1*Q4&|%gv2#d5Kaceb za8{;aMU+Dk-ytDMB!GVWj*r8HbO@##E<}ALbevEUcB|Lnm}b4!+IiRTD&m<}5gFR;f_!+EZ{K;{Ako80bbkKcv8g7uq&K3PaJs}wjCi_d|ek|PBwo4_8GFd zU;oft7Ms^V^m^^>=I3)k&F9%;}}A}nc;JH#PYc@c55gI)K6c884U*r>XNGIs%ML?Icyf-H?`E82~^MXT`? z^9^FZ5dK>vMD#@I<*)< z((eskVIf^f7)#`|4#=N|gOr)hi~HRHmUh$hQ4`st$Qf5`0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xu28@M(re4k#%J6Y(gaqZ1w1S0A*0y%q#K>#6yWbB42fke5$V zo{4IJbyC4Ql}oG5#)EIJS)zM;xHRZcc~$lL*I_oP@dah|5Mr=MFMkYcS@VghPBkVA&V1s=>%1+%$$&inQ&*apma*9 zy^AK)+Fs-XP@9!Q-lyO2!c~0{qU^_mgVS8r9{6{Vr8V$5ZS_GGL&ZXO7Qodhc3CdQ zN58S;5bLoeOFUPTO?Ah0N(GxxcFFOhIrv^Dv72U_?^J@RXPcWG)1wM=2kzd3`i3Cg zME}|v{Tue!(&!Px$OzP22Bm%Pz_itBOcU2K*J666;#mtAA0v_+gqR=y!SZ8WvJBA} zD)UBFbI7+#>s2vo{g&kylW6mb1BR@u)9NZaxsp2LmZS-yHY}wHMyV=_@U5*?Irgek ziJFMn`zcn(cEa|@z!z5sjt|0c$mj_U>AVQ(I7}$bZiYknC#CQ}K9t4pAy2STlM7EfIVIpZ=)RBYzQ0q4NAm3rCitbdsk>TiA+nv`7;aYnd_Ffm0@`; z^nPgXyeV3b0L`72<5cHzSe`TF_Yz^`n3)UHV}>3ngt=zVS@L8dyl&HX&Pg_v5X{+m ztasUtlwnWJPyL$U+S9C+Z(OR68o+XQ>Z3gM@Gj^aN6j!j)*mzK~^N}psLUrEo$&qYxTo}t1cZOy_ zTHoEsHdio_O=p6GeCi01#xPce(rPnwAlsIFdLdi62diH`$Oc#OOE#_e{-KO+;_nZD c&R3*%$eE5x)JBfoWI4U2gwt&XC2o`W4}KfYM*si- literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/dowhile-002.js b/js/src/jsapi-tests/binast/parser/tester/dowhile-002.js new file mode 100644 index 000000000000..e25557e70bcc --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/dowhile-002.js @@ -0,0 +1,71 @@ +/* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + * 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/js/src/jsapi-tests/binast/parser/tester/dowhile-003.binjs b/js/src/jsapi-tests/binast/parser/tester/dowhile-003.binjs new file mode 100644 index 0000000000000000000000000000000000000000..57436770bd007f90b3e4420eb03ed8e7257e2be7 GIT binary patch literal 11729 zcmeHNOLHSN5T5W_-t3tws?0eg*@7Eo!fqT>YbqpL*t>9}WRKzuJDD+>@n%!}2+r^y zxN+mo58y%-7w#OWV;u(EXfBL%B-I{tn9K?LLe!^L}`#_|9 z!A^r0f*|Oo;d!vvI{du-al4lecu?Pw@6_Wc%Xi<~41%}dtvVh4h>3`GW4_OOF%vA0 z(nLaq=I<o36Bn1+=K2^EDwltj4(pwqWPp5)PS#D#=Q*r{1`mWwFq@7{uG z+Ra9%b#z$YQNPu96bQv?%l8kWoC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O%Efqs$cD_Q%ptyR+v2cxxohc zP&jG$5mx>->PgYyYzC-j6TW>=Z@A=3fUVDE)icM(PU?yK>?V-bH=|^r-4Rz0t4<{K y*j19KM-`s}s;3yB%l9Mdfuo93Po{j1H&UVe_iF%`9e6czPOjaIj=SC{-2D$jFVlYj literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/dowhile-003.js b/js/src/jsapi-tests/binast/parser/tester/dowhile-003.js new file mode 100644 index 000000000000..b482823e12f9 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/dowhile-003.js @@ -0,0 +1,63 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + * 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/js/src/jsapi-tests/binast/parser/tester/dowhile-004.binjs b/js/src/jsapi-tests/binast/parser/tester/dowhile-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tL3UWiZB!fNz&59Q9sj8wQWk%i1SYyO>tT9px>9Lw?M?H$3UA>La18Xk$mUX}S Y{0&6l#tW-9*`*QvdW83YmOJ?V1!Ux?9{>OV literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/dowhile-005.js b/js/src/jsapi-tests/binast/parser/tester/dowhile-005.js new file mode 100644 index 000000000000..3c339f493a0b --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/dowhile-005.js @@ -0,0 +1,73 @@ +/* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + * 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/js/src/jsapi-tests/binast/parser/tester/dowhile-006.binjs b/js/src/jsapi-tests/binast/parser/tester/dowhile-006.binjs new file mode 100644 index 0000000000000000000000000000000000000000..7ab5fde070571e7caa03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SI{lrpEDf?pnnU-B+M|EK7&XBjW$yo0j3p7Rwn!T@SEWL1<;`3h7&Ho$ zwabQU;y^2E!~boF4Sx;1wDh!g8cf2C35PFD<99@-q-mcS!{MPdB?aGbOW!bI&Jlc$F5K1Mxn1gQh};x8U+9aWJJ# z9ZL37N0V(teK^g6&!+KKWElgdGTOo$W_+M5t*cGZ3nWme6unAVm{XmJvZY8yZ&3aR DTALMt literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/dowhile-007.js b/js/src/jsapi-tests/binast/parser/tester/dowhile-007.js new file mode 100644 index 000000000000..44adbcafd988 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/dowhile-007.js @@ -0,0 +1,97 @@ +/* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + * 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/js/src/jsapi-tests/binast/parser/tester/exception-001.binjs b/js/src/jsapi-tests/binast/parser/tester/exception-001.binjs new file mode 100644 index 0000000000000000000000000000000000000000..8ab757348fe2a72cf382c4fdf4aaffb7d1fbe7af GIT binary patch literal 6518 zcmds5&2Ah;5FQAGAc4dQp>UaFP=uUFIa!M(yjg@Jvx(T1C4^Aap6T7~q&+iq_t-Iy zkPCMnfrsD#N1lKqZ<4Csp6S}1@otYjHa{1yXL|bUs;{fQs_ua)3(5Be3(nHLXDXj7 zb`rfEMbUAdo=5u!<0q5dNs<>l8tm9_22yCV_vgn^bO*i~(CJ4^33e>`W1dK+m=Sqq zp;G^>qn9E}SF!#EoVT`N<;p^dG!mIGH2_`yAmy16Gr^UG%h-uGS{o&@`QCf5%w#m2 z9y}cncHFzcjsu}s6Z`$4FkCTd;ZB(>8+acA9)Fea0)74b!GniQ)Czsa@-}db-hzpz zOf^5JMqHB5zX1CN`8*nZJL!whcfs@*`r-3OO=51I$J;>S4e^M6PYJ|JkrltD(C^wu6aSc=|{3n-?}1*YaD5}{jN z4{+uqz&cZ)N?(Iqb2ZHm^Lf)Jt2Do~Men}Im^$}DgvzAkj^#ovK-Wp*A{+P&!F4D4W{MuP1WsRZ2vo8 zzv-O(UzJ&cRh>37m@UwOT-X}Xya))BO~g{DeVHdOy^3z{&VKtKvYEZoo%yWyP#7Fr z1o=zQ@Og%+ji)>SVzW^BS?0}L z&&leUuIah>kC2IFuy(oWEA?$$N?CQjFsrUr6%XsbbnaB0dqOZ>jxlzl1@s*f`tljn zA1Qu<|Ekjjo!mLje}@Gyg!_o|-Wv~;oo|>~G|65k&>am{s2~R~z^Un4pGxNpnMoEy z$x6*_f);QFJLyfVtW-38p$2r`zaxl{zV>gze=K>HaG#lL?WS+KZ0Y?2WE7QjC3gNd zV)qGnRxqtm>`>tNnHRj~CRR~JH}jvPqJva*OWMadtzo$N`SA;$n5aD($ zhuRIMly?@A*F6f!n4b|1!6@nL^oARZr_dqOln>{*rR7&x4-3bNDh0$&@OkJOj%(Kd z8Q9XnC8RB}_dbii_xctK9g}c#^wRhWAasieRoO>T1C7RrihpPtcm>FAYENwrU;W8=s;l3&Q=e1HX3OXXTGQK&wOls1k#@Zykd3QbH+DhryV16QAQN@-vdxV)58`g1 gz4E!iEq7kajkAA$29}YHis?(yxskN)#I$F~8xpiaoB#j- literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/exception-001.js b/js/src/jsapi-tests/binast/parser/tester/exception-001.js new file mode 100644 index 000000000000..987ba0af888b --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/exception-001.js @@ -0,0 +1,45 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + * 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/js/src/jsapi-tests/binast/parser/tester/exception-002.binjs b/js/src/jsapi-tests/binast/parser/tester/exception-002.binjs new file mode 100644 index 0000000000000000000000000000000000000000..2a03114aa34971b4bab34be4985c222a69e171fa GIT binary patch literal 6710 zcmd^D-EQPG6b>w~%b&y@E4axe2%+vGE>Ja8+RhH5t1=*F)EfjVH}TAPn&Eumuj zTLot#jhC_h1)SHmVP&#}5^*3>p&I}?{87wPEoOqt5-w%ucG5~qky4mJ|-&`+&z^MLfq?KY#S-3m3IU-z#|=m_hGB#|tLi z&*>zt$>%?SeT#gajDDQ-#pjza^%v^#^DkXuZlA|@fW%wk5#yd7O^-)z+*A;rs{9Jk zxY8<|WioumF4!cJBG=(WvovNh4o9_S)qXh4QV?Yk>5-IKiz0U*e)KArTq(#67+Ldk z$j_2d-n?&3IJ7SeFu<>07XDE~nXXHg{tx-R93W1s{r($txRIfL;U!4~7jUoA8+qq?j+P z#~RDRRQSveL`k{O+iSHm zs8VpkOSRfH*W?Mf`8-AcvH)ESLonvwG&;5F;I+LiVhG94|32`dyYog{~&<9Tn^TBe~J6P-Y3p`Cz~`x4rO zzbtqf@s+i-&SC4slJ393@6qy?M1FTh(z7c+gvfHH6uL4xF~79V>@H%hD!Q0=M@0uu z?RLOof&o^M|&-44wzOaG0dK_;6h*yLo`aL=xo%C(L zDIpwL`6XK8xy=1>D*Pwxf(-)^Wzru?mV``%e!t>ue&~;wm~hz_B5k1K7O3}MW`gHA z1O^N%`8foqf|J+3H%4)f#j)wCdIazjH?c<%aftc10gYTTArTTA-`YcMmRdLS*v17^ zQ|$skT_6y7qw5aNya%=}1<2Ajpx0cC(vx&z`=q4imnQliMF|r#C#tRf7ORFR5y#rBJLraYv#cA-u zpt!z7`}uuOMfY5Zw&8+&1v)-SP`QkO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gWS&$`J+^-TLt<+URO zB{)Ov21_VGQYg{qun(ol@9yd1@R&yb`mEoCbX5HJ)IhA4>zvZU5q6KmYg{jqH-Rw&H44ICW!;}?@8;8o_JbKZa zW1IBu=4WdGp8-{U33$SPD|i-hXH5p$Ig+bB4c%`*Jt&}+e=nTgvfHH6uLb+ zJil^|-(18>Ra8xPN5vLiz1^|tvDlM)c;tqM2jSh47NyCoU!!WR>fiQ?+FrfT6{Qzj zFqD_4&^{Pt`FzTCSsU_r3^z_UGV3e&&SW(?MR5{P`-E3!x^2bxxG@?j%4wEPLzrJ{a!d+`0!y&z%;P2D|pN`!go*KM$Wdj|&qO z63JPLsm44=-C#sj22xbdiKD8*=gkT30J)vx(>Z%E(X~5Sr>Ul1|CVV^2cl*I1gtfn z9w2TtZ1;?D&B_Sij(XMp%GX1d>q53#;;-O`pJK$;5?j;Nwzb@%*p_zxu#M|Z)MUiQ zt+j1iqjTHZD2?s=Hcb#f)x3PPt<6gb+t9uN+QtocfaThmzpsI4B+-ZLPD=aZr9DUf E1-=}goB#j- literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/exception-004.js b/js/src/jsapi-tests/binast/parser/tester/exception-004.js new file mode 100644 index 000000000000..41b7ac3aa4ec --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/exception-004.js @@ -0,0 +1,45 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + * 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/js/src/jsapi-tests/binast/parser/tester/exception-005.binjs b/js/src/jsapi-tests/binast/parser/tester/exception-005.binjs new file mode 100644 index 0000000000000000000000000000000000000000..7bb22fc467a9c75fc8dcdcef3e7ce6f17305f212 GIT binary patch literal 6792 zcmd^D-EP}96xP=Lw8IAMZo_&b^mZ810viSdUVz4Ru@r$j%tmgyqM#+(R-=d-NhQr5 zq7TrA=u7k|hF$GVb`C{}$B}H)v7B7&CXPh$BhSb0d^}`N7kSDLdUMX=gWsf>Np==| z90b8c#FxS0(eT-5e-w$F2faP>O)pK9KKSRGAh-)(^=S7KCKEPE`4b+cOfsE_%s|EN zSp}y_7B6D`3pgLG!xGX!C2^2siLL?Y@JBJvbTUo2G;kR^bCXtDCfV%Za~Nhc=#P({ z4|{v|U2o5VP^^*p{y5QGvedwxv$Sa7eFb>@O~iAI^@oQKe`=yu=zE5@o*ncKbUbIW z`8l1$HTnD-uy2shlfmz!uK4^Erv6$zdi7(In49PE9*}rLJYwAAqw(>e88;P#rz(F& zG_JG?r$UC$*f|?TGRbu~(kzRajKe{tS+yUI#q-H)9_fLUqD7Ef@IH8xORf~81`MqE z8KkEnl-KWD^SIB_)O9sIB6!7J_EAnevi=_Mp)`{kNog`%M`&Rwx|_!~A)uey5SW}5 zNQ7z)-6NQ<0qa77G5rdT&E;4ei&--!V>a*F1bmoeOkTRU0<kG9H zP@>>`7Yem&F3Dr?@>z!N7nIxfg1 zZs+>4l~|8t!?l_Uv053PnP%3#?VM97rtw>DiVIpGhftVW9oE&Zv`?SuXx>j*p}29V z9L}R>ojJBi@74TlEZ`HMsw)AH_@4#OBJQloKs!fr)u*BR1E>cDw2(ZvXHXrx{kITV z&Xhv8M~CMZ&heXzSgDGt>Gr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)Pnb$t*KN#!}f+Xc$YbSrE6^Tq8{PDi$y$(;c=iXDahYiS!?^3pNO(NR>ZOEDo6r{cge8Y~S~Xvy^wGOe}2Ne$fBg9(iAbsoE!B z_fHLa3x`Q)s1J;cs1s5IMK5o2udwL) zm0D;bWJrU8z?T={|M*H{@yK^Z$D=a*<%X&VCkEWPJNF3;@p%Pb#OT**1=Xwv|ModIJ z-1pT%F@ODe0X5x?tkYpme$FEA_2EjiNeQOy3>KnPC@F@C>=@O<-3W z!Ku#(TJlKz2>%slRrKZB1-}Oc6czse!SfAlKAP70<;`7@P;||ojRl1zm1{F~r^8e* z=|pUr@mz;fIBPv`tb@*bn&l~6JCjZ!SDVVD0smpj0?Y2P;^AbTDSH5xj`XW ztPLm;O&u-b0^<>Bhh;P#+VfJCaNoMnTR3pX`LJ#S<$ME>j?MKBL@EYpD^7Mk_|U)S zU%T<05k6mJKH;H`J0+e&q*tg@k(LzI(Ho?i|9#cKH6ZJi0cx{DB$n-zwEPsNm)Cjj z(}`SFsR4*vO}pG;T(h|c@KJVA6X&-(ELBr!)yZE$B;UeZ*E)&JvV3>aqszAM`Vo5{ ztOsoeB6`Rw9(v4j&Q4~lsu_W-d;r#CH)N0=wXur4m{q?s>Cx)hvmUV5RXu1usM2FA eJ_XI0k^lV#mJSUsmU0s-VXq$A)cP^CXXrn%cnu{0 literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/exception-007.js b/js/src/jsapi-tests/binast/parser/tester/exception-007.js new file mode 100644 index 000000000000..bae0027b5ce7 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/exception-007.js @@ -0,0 +1,57 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + * 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/js/src/jsapi-tests/binast/parser/tester/exception-008.binjs b/js/src/jsapi-tests/binast/parser/tester/exception-008.binjs new file mode 100644 index 0000000000000000000000000000000000000000..9e6209ca559176801ced6461aa9b9f0e425e4bce GIT binary patch literal 6852 zcmd^EL2nyH6y8#xAcVvb!DZDG2%)r6kx(#^8pl;rMFwFj7lf+G?%1Aov%8&{P2&EJ zp7;5!dANFTlPha4bJ~6k?;{zb^mUzUt$H(K7fgd*&L`zkE zhiF`B6;3i4zF-$@6iJcmaHLrpGZ}}2O0#M|9L-bBt_D(O4RYLq^}$sxxl)iAFs

h#eJ3}Zm1a%!B5=f9%ZCO&VLMSD9xlsN_>9n2rVo{ck9?D1awmy0+Z7M ziBOH9w+QAlz`B%ROV7ctxg2LF+0>88Sk3QE@;wwOlXDkWfJOxF4sHz&oA8Maq?pc} z!CJq)L(g}!u&mycId zR7FCy;e@tL0&O3``w)Tdoc_;>G{VA8`x(p^XhK$YM>P5tLRn8O1v^Z#=(S^UbBp#b zG$**)g%<6a8}bxOy!=V$bX>T7L9O!j74GiH#8Oy??8i!D8x~1YwZAZ`u2;)^RNv{? zv79?XP=aTu-CzdIM*_|H1Zq$s-opQ?BLyAYS?7NP<;eQ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*i!!aMkc^N)3qI; literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/exception-010-n.js b/js/src/jsapi-tests/binast/parser/tester/exception-010-n.js new file mode 100644 index 000000000000..46fe72fddb23 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/exception-010-n.js @@ -0,0 +1,25 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 4 -*- + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +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/js/src/jsapi-tests/binast/parser/tester/exception-011-n.binjs b/js/src/jsapi-tests/binast/parser/tester/exception-011-n.binjs new file mode 100644 index 0000000000000000000000000000000000000000..8397356dc8f41ffc250635ba4bddcfc1ea417b31 GIT binary patch literal 4530 zcmc&&%Wl&^6m@w&#ACx2nGFviNQ+oiCQ_RiH7JCt4iyp$G>vcL5w0DLCrP{HH~2Hy zv1Y?3aAz|1OfzolHg3C$JdZPT&zyVaPCPyy#nAL3AYpTpr9(#coGXsw?4;p=v)<`_ z2v&nZIs(UQ$T40_Gv565z;W*4D9@a}O&BFRF|=V26Gk{q6A2aS@67p5lkhOsAH-QY z2`gn1iiQqNC@%oaUTc%yoPG?8Vbb33gq}M z<-kZR;U**=TX^>n5B3Kz60yEoURkkGbM%Jf%~OkB#fcNb?BV7n&dBF)#J)g2xBac4 zEjQ-ybo^GCZSz6ApW*6Uh)1?WKZhkvP^<<%|I~ftG=JS{3AX z8^g;uVZ09+KPJKwL7q_y|1M4o*Kw(Sr{DGMz)YGdX4Y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6zmFmL9&+0E@dzjyF-|sa)OhE7j|jN39sxb e4llk4id~q3)!@)A|Nr~&DDrt|zNxkm1Nnbm8;j=v literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/exec-002.js b/js/src/jsapi-tests/binast/parser/tester/exec-002.js new file mode 100644 index 000000000000..86d8ccb9a59b --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/exec-002.js @@ -0,0 +1,188 @@ +/* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + * 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/js/src/jsapi-tests/binast/parser/tester/expression-001.binjs b/js/src/jsapi-tests/binast/parser/tester/expression-001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L0JNbxN{gQPrKz_K(Lv6-jMPwNgj!dnt~vhG6*i0; z&C-X1MKBJ?#+~J-i#WhjEWL|GB)C9Tby~W!Ld~J)wFey8B%I+6W*%qqi*A*J6>CcH zhDaz>s;-B(77C%_#q5Gx?tnEzsc?sw~zN|qeW2%yThK0Kg` zSGuhZB&-QiYZ8`C^Vj^bz4}udYxO?S?Yd?Dz$J<`?7!yEq`T6dxhwI*n0B97fX&3NFW1Px0B$JvNsMVLjQugvpmKyp0oc2;s+si literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/expression-002.js b/js/src/jsapi-tests/binast/parser/tester/expression-002.js new file mode 100644 index 000000000000..0110f23b774d --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/expression-002.js @@ -0,0 +1,60 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/expression-003.binjs b/js/src/jsapi-tests/binast/parser/tester/expression-003.binjs new file mode 100644 index 0000000000000000000000000000000000000000..dc2656b14bf3bc14b01d1945d35c943063c2e4d6 GIT binary patch literal 10356 zcmeHN&5qkP5LWu%LxH00DJNYDv;myYOig0Yx*hTWX$`%S!-Q>w6sbPY@|k@HMhesyeAxoI2vp=O4D#R<2jHXj3m zR7|J=muk6<3RNijhAKRT<7Sj%q*MUG8dQB!NlB&g@Z1NW>+_QfI6^B3mts9WC!%3J zv8xdO2(XI0X3L;i^Bef|J(#vooOq^9bmlA_^6NO|LmQu(>*uCi0X4yOd|PI;GNGA- zf#Tg{akay}1z~%T21Ohd^#@EY0SapupH!mV>*zrVM2v~6oS@2so=+7xRvPMH#o|984d%fG4%U6Ln+hD`i{D0kirqnTe0iGkb3p86 zVF?5Q?8DpjfJHbGir-Fov^##jU{dawp967Moz=R_OtR>8FlOm6fws+c0H5HD z+M>qR^jE;O$Xp#p6%XtGFma91G1}Ez?oobIt8Z{ zHe2O!bof>i9#B|P>K5J3DMj4VH0^d(SPN&#|2F(QjNFu&n_U0K*=&uY z{SaBp!!;iK_dq#{L_w1as+E7gEmc{sPYkF1*`PhoYA7T;-> z*pRFH?Gmva?=s2l1g90_kf^LK(Zk)|S1WtC`FS%SJq!0IK)oNhf_j~Y#X%eDGd#?$ zLzaelZ4%DMndD|5mSNeQhqhxWCq1P=cYXye1D`waTwM2{$cjwpLiLmuL-cD~Zx^D6 zoJ~g)HKixivU+vNMF8Dl!vwP4IpU!PCIq$iHQw1Qjj*4k555oyo>u9CP428>^SJ$L z0Y^5;YeTye((H^WdW+}efjACO5byKl(r zJ@uWNHFAS-EGs?0igxQl4d=m+CaP_b%9gRWfGj?#w3TAVa4~R94q6s=E-TjZF!q1u z7Gmp1ddQXhaI`akuH$+zL07TVtsW$7NK#7nLqG2#hLcs z@@LdpxTiUm{L>Vh4*F~v?FO+3Z&xuu-h+a4<8^gMJMyMAE4IU2nnS?@nZ;&4|GCSi zY9^cw{v%lY1&W*J@{aYW&iszyT8|MjRDa-WhTOHN8FY5Z1hZc&>dX*2zV;4`8NuD` zj@}I7Zq_SEW^73_W=2tUUVCmrhUx_)8LC$sWT@TOM&S1yF)3%>V!Z literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/expression-003.js b/js/src/jsapi-tests/binast/parser/tester/expression-003.js new file mode 100644 index 000000000000..ba5f9c076970 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/expression-003.js @@ -0,0 +1,55 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/expression-004.binjs b/js/src/jsapi-tests/binast/parser/tester/expression-004.binjs new file mode 100644 index 0000000000000000000000000000000000000000..2a5ba62ca9bb7bbb0d238ede3f9f18bfde38c89b GIT binary patch literal 10202 zcmeHNORwWJ6b^4#fDo);l?4mX2z8KHpi!wbw{r*X)m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EN%m$O6_hs|N`?f>cYwa!LM%Kdx^%bjDg`C(~R9=Fg}l z?7!j9WUz8Yb1Lzt%QqeL+0ok-V&&ehV!-$o5`-JCTRXEE?^?5FJB+0z6ue?x?c>Xj zhh#1m%-P$20gLg?NY&e;TQ+^64D$mVYTm-CA$QHG2Az$tff+T5H#LL?ZhYHBjo@x} z)2;?_H|xtjYOJN{QllszZM+&WhMI+;G1ROojG<=3qlWM#+z-G>@* k-!7>^hqI`WHD5?6uXg0`2XJJ0VXIcIVM^4nsyku+56!Xl!TWCLaec=-|K5j~FCKI_DkQxT zO1XlHLJ}pBC;;&G^^heZI*Axpa0%@jqcg#yq+59e+q7!ccKu5;DC_@%vIfCeEj7Op z3C3xx;Ld0~wD6t*9y=d!mSy1V>z$o(~$$aDCFf^xHcb~^F{U5aoRa0J(`3uG^&%P8e6|7XUr^G z*o>b-2CO8QbHG5!NkB#2t~xjW0G(_%k>{8JSmq$vHJQOadFZOI-Za?=nI>JjTn}*{ z5I$4UGlm!G)*e{jISsIX_@V@OMQCT2;x$z&I=yO4hZ$259>ATcKmXo^mwJR#<=XZM zqbyCdZRjW@ho^3RCK|&ZtvGu(kp}^uI-O9fkOymzOENsG4hq-pBO<%!0Id}5j zFdL5CGRt5cWE|@ixjHS=>%1q)oXGoLm1fM&iE`{G>?d`7N~k>2?S1pOf{W1=Kzg?3 zk}G+qzpI`Mwcu{BK()R>MxV;M&GPqJyEoGV&O+5= wjtjaTaVrOcw4O5c*c=M$Q5SL0&@2%UW@f)#=}|lMdcb`m>A?%0kes6b54IY~O#lD@ literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/expression-005.js b/js/src/jsapi-tests/binast/parser/tester/expression-005.js new file mode 100644 index 000000000000..c1e76b7c63fa --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/expression-005.js @@ -0,0 +1,41 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/expression-006.binjs b/js/src/jsapi-tests/binast/parser/tester/expression-006.binjs new file mode 100644 index 0000000000000000000000000000000000000000..d19dd551a8d26becf3efb5d3867e9dc4cc9e56c6 GIT binary patch literal 7177 zcmds6OK%e~5MJI7Aq3(C7ji6A(DG^}NGp*vK&p^dP1-ARvu?8Ob~o}mef$qj{4s>Y z2?-?r1v8F!?Z!^xq-jKZiW2XB_RM_q&5V=hopwl<^DRpJ<#iS}8QJ$Pd!Dx)`^R3P zTwSfbtu^8{_40G#nS2-|eEIuB&$|Op<@MLM2n)z|NLOehB#iJNjs%piz9-&Z5cwyu zegn>>VOTK}P=W6SQNS|*efzRcBOdGolnJ=w5-|4J{QSc6-NZyrcbF5t%gc?gz{>}OnUCuS z8Plgf0DFo)-70O=Cgsy>aP-yMi!ZND$4uXkzozF$w7XueS4yVcIw2gHc@NQAG#Ams z9AqzKV{BpC^d0(hdJeq>TNO4xRyRKvN*fb#>UBVT^>T4>;f)D*3Rjjg1*vhu=|0Gq zNM5BZR=q2dFjTLKHyZF0RVtM2 z8d9MMcflCz;AD(EWTulC=$=1!J{zG88Es5kiFL(7a>YViy*9()gCASv&LK1o{C7aP z2?yeFw@EdVDNU-rpIs5qBd_ZXU}x6#LiBq_X;g*s0UGrPuyu{Cbez|og7drGS#C+($*qa3 zewXXE3h9rce$PBHqo~KtaZ98{ZU%-KxB)Z)ZOnEc#1P%Hp*kKH6VhV14bkD8g9?%E zOGl`F4V`Rg(?h18`VM2t#b{N-!3<1)?sTswjna+KRazR7I0 zlkPt=ww_U6>X|U)l2xDNn&oCmuGj@rgEaomkZXO|FIR1x)0TQUq+urJrK?;uqb3*Z Ng;*{Qx%;%%x_?Y`5W@ff literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/expression-006.js b/js/src/jsapi-tests/binast/parser/tester/expression-006.js new file mode 100644 index 000000000000..2ab13479a1f0 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/expression-006.js @@ -0,0 +1,46 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/expression-007.binjs b/js/src/jsapi-tests/binast/parser/tester/expression-007.binjs new file mode 100644 index 0000000000000000000000000000000000000000..39c1bbdedc646eceaf3a19d9e7b7ec56770932c7 GIT binary patch literal 6728 zcmds6O>fgM7|!@cAcVvPamsOMpbiNM39?G8?L?<4Otjk(s1#4#gh1k(&IMtv!C$|#Au)%$QwyHV>jKl@%q{N_~zh>F$D_O}Sb z6h#@_1&W3m-V?yXmjjB^6qJ3vyZcUu&EYGV;XHBcZ8&*>sJ>m5Vnu`g1ne6$=t<*C zdtC;-3!)#k-+X(k8|LQic!R{`dUu+gRzufYC4?m{pK`Pwc4ItpA#@=W69dz(V9-Xv z`8Gog_aX2y#>rSPMraL1kvy862;e6y<4RT5BAy?DqA5d^b#Tgb(-j&DSQTB$aTOJK zrW7h5+8uI3q(;>(l;K_*QAjzTAQxlWNm@x)*D1>)KOnrd2;V0$qGPF-!*fjTeka0b z%%P;)lgU%0A`Y}8FH((k4UiUwSa+7@3c6CkGFDhfR}!iP@+8$4p9cE<`>FjNSPcr> zFfs&|$`Q+)#NiGQiEudI6E{~Pe}gny0L}VjJv|4{QTQ^z1Ktnmy02i$XMpG@ZUO4D z9!*9D?1F&*W9z{Q1@#68>*MDUO4Bv-vqQ(SzGQuMlmzEa55-{wjcVRht1Q^(J7x}* zHsgN)mqSlA`%isCPy#oxB_uT8e6S2d=qDh|EG;Q)cs_hEo#coj+_Y0CGv@{Z%ED#@i6< z+h%(okECvE>flPeKF`*oQm7_ZXVo&dsb^}41-)8?hAGZSK7g^cKY#R9k6JJ~3%7D6 zFCFVU(9~^ytlP59!pLQ1V3s|q|0IhyBtnWP}`Ik}S4?@(5q0p-&J8y6W+ zwV#D+EckDM@&E*4$)wBFgK5^q+V`aOQ6*m`QK)CQT9fY`|6x*`Q#i W`U|L7)$K19%tci!E_jGE)~&ze)rS87 literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/expression-007.js b/js/src/jsapi-tests/binast/parser/tester/expression-007.js new file mode 100644 index 000000000000..3e01e0d8c90a --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/expression-007.js @@ -0,0 +1,44 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/expression-008.binjs b/js/src/jsapi-tests/binast/parser/tester/expression-008.binjs new file mode 100644 index 0000000000000000000000000000000000000000..f09c68a792ac9181f4be0977fd7a753f1c417fe0 GIT binary patch literal 6615 zcmds6&2AGh5H|lHA%w&MiPIj7DwHB|K(LKO(;!ksp(3FYC*)?`WT~?od7Y+t6`q5a z;fA>J7L2{#wG%t3lctf{Q?#}HdFJ!XHy$_Sqah{LuupJQJ!EN*;Q_jh5IRny3EFG4 z4%+Y9-E>G$Sdnu=8fU!v=Q%=;VOD4^Kf)}=$CT`oF2xME&xFO@60@F$}4%5>HvpC5sv8OMxwNXBjIN)HvRiLULq zj0-|3l?#~lMuLdU>AHtA;?%|rBB86^tLj5FHSIm zB_|xQxYyU>sia5%ZR?FplCA*KgNSvjv~V!c4larc59=1BYKfdnefjAKzZIqZ7r0^_ z{4CabYUN$ns`a(mw23n#q&1?nD3h?DjQv^PZ)Ekm4-P}^A5n+)m?U}1wt)MHV@e{M z^ODbv-6H;hH5&>wA>-t{ONQdgX#2hbmCpdNl?Ekf!22v6JFqv;>jrOUBA}oolkWQB z^AKm*n&Y#>Cb|U6)`OpOix&1Prx3|jFzZsOp~NJhOx@_6 zn}2}IelHQFUIQ#sYj<^on?8Az9$&p_k+ET#aOrZ_tofy&OdsV*`JKy@>7Ut4f<+~@ zU~Rx6zD;0{Ft|YNT&SMriZpaM?n3mib5Z$O(&a_B zFV)@_Mi#&34l9bpa<#&P5s~!V>$yxhWjf*3S$Ke0ptIlLMCJbqviuR=zD=qDr?jXs x$E%APaci9cX}wRYu{j~EMqPnp49&Lv24-eINUBkrdNts#p=$7gcR^>F`VYHpU&;Ug literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/expression-008.js b/js/src/jsapi-tests/binast/parser/tester/expression-008.js new file mode 100644 index 000000000000..caf310195bc1 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/expression-008.js @@ -0,0 +1,41 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/expression-009.binjs b/js/src/jsapi-tests/binast/parser/tester/expression-009.binjs new file mode 100644 index 0000000000000000000000000000000000000000..392209cb016b9160ae3878ab88d350a07f9f1307 GIT binary patch literal 6652 zcmds6&u`N(6b_7^5<*B^5T}UCh9=Y@aRIVQtSit_m1&7~;efoxYs1o{a@=+OSNOL$ zaplH;!L#GUUhQUX*Hvt%Dzp9hz0co!&(HJdXc*(V*T*QV?~}Ag(7?IvIL=WTPMn=q zXU~7DBMUHh!}aw7zz{n)sVn6Cf&< z&*!%ziV2E2+$oAj8s1~T!)HT+vkaVlwYBwDhb`c1oH$SHx&|vx5z(isRxC*9Z@^w5 zp@+=_e_4dy1=IKZ*Wcgh#H^mj6$+F29khaWQ}Ftk2)6FhbybRiT|gVHWR zXtUJ3PZ7lf2t2Mh84Jb;ZJ;=oOZkc}{0YmrQk}Jk=ZD~EMiHR_&ZtgZ>7jsC(WM=i zae-w@;Q}JP5hEfqx^CeNJGC)^l=B&KF(yIUPJ6mfJd6B<@YW)HCrS{RNWUDGV~XQ< zVth;;67~8rd5ToTfHvhuDoIxWX+gxYvov$il@3;^!os?WP%V-3R9}7?tqY)DNDFv#FOqA14U z|G?v4ux3R{WLX}cb@7nhD0SZ#pz3_i@;C}ZRFt`;wh6Z~rs8v*vpkL)CN&F^nR+0kj9I8) zy!cg_zjmC>QO4$Lly*}!)i80TM?Zj1XGqxfpH9k9Qu(tu8VmhfpgaJBXqsOW^WIa0TX%0)&|F>*NXw4t1(2UNVD7fNzW(0LdkOep?>hO& z#!LP5)bq03ipjywtyARbUGtT#)ZfsFvokKr}dRLbR~6ssPRDa@7q?y#E$P z7QgBa3#N(rs)Yq3EbOV(i<)psb;6u!;fg0<7a~&0f7d##sOVvLZV`>Hf literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/expression-009.js b/js/src/jsapi-tests/binast/parser/tester/expression-009.js new file mode 100644 index 000000000000..9a997d7fbb25 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/expression-009.js @@ -0,0 +1,42 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/expression-010.binjs b/js/src/jsapi-tests/binast/parser/tester/expression-010.binjs new file mode 100644 index 0000000000000000000000000000000000000000..988918403d223d43870d24304b8f5479ef43e1c4 GIT binary patch literal 6623 zcmds6%We}f6g6*<5JF;s#D-ZG6_i$Dg{F~68q`!FR88oH1#)NHWawlj@;FWNEBpzc z!j=URf5ElKGj?Mqb<#9ayNVLq$G*qsz8s&8hB2x7eS*X40Zn@p571qN&~X}0P_5bC z?|kS4>5w45BIfvUl(FjHmk2$DS-!sf2-653$7GiTF{YSBX(FIP^*uwUQ4(In`U5z3 zF2hQxfQmvCB@rtD^zEA=Nmz6e5h~ykJWz+u7>$x%^$~2-Y1F&TFKxdffAcF6M91og z`K^c%iemwHhU1Ze_YCmJ`H+$<17qK9ZEu;d1$;#i=gVF1!OAmC&FT6nmL&8yV6TzT zqsC!pRfIl(qwjaNzrQz$SwD|!6ehR3+w8U)rro+A9A){OqxFfGkg*4@3$B=2ly(I| z8>Qwu3^OtS#}kTEzF_sxI*wztRICW#C!+jHH`c+QpMaqm!<2PN#!Tu;3ni?MuFi24 z6L_SQCSckdaUwFS=?=#5TN_gdIeQR`3GJq>v}f8RqR3BhZ^OfDQG)42*@bwFDXt&I zXFN+{zTld4d996k7t2&XZ&8=5U{I z6qC@Tz2tLkrNlot&6@PaV>vkw$dK2KrtM2m`2rBzsaJw}tWVRi1$+IxuCYYpf`YtE zg4OBs0B6~X_1UEpm4`+D5vRc^>f}9K2o--X;rU(xERt|{l)`nJ9P*EAylIoMb~J9%)oLxi@2q@KI*_!b{GJCY-9o*k z1jLfua*3R*uc>1e^y@JmWkhg1gzj=MyF=BNIuI&uTU|$S5FKS%-=Z97D!`@wL`n99%{I_(&HZx)zOghBA-o4SJL@&xEcrjJD@y< z1Fq6Z-g z;q8d0oBZdEH|Evpm*uz**MheJ6)?OBnSh17bzlb-ToUYTsE)_wUT87ghUjq4dD&+{ zljoIRvcD}3S$yg{EEyvfOBD``aGz&Rk7m*+-3WV_g=dI4VfGu`sQAYq%b((H<)j?4 z#uhndd3}*1_F$($8t>F{Y=(&Cs7*TB&~)doVP@vTq#QNLmjm`BDhDrlAGGGF|NZb` A`Tzg` literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/expression-010.js b/js/src/jsapi-tests/binast/parser/tester/expression-010.js new file mode 100644 index 000000000000..f8ad983cc480 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/expression-010.js @@ -0,0 +1,43 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/expression-011.binjs b/js/src/jsapi-tests/binast/parser/tester/expression-011.binjs new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kkKRoV;^oj+B9J^__83bB6qz6E58$FPS;PdB%!|m zdxeDVH+I`a5qbrV{=WU_^AnSp)$_PQ$3(k3&CYhiv|D!wN4LC}hp?Y(X7eW*2d3nBF?AU@uF{`}cf6Yd05HgfrBbHeEWG)z2RB`a33 ztCKKPOT~&V{6v*R>3-uNjYwF+3F94_@HrMrSRGxR<0K|v(2*t()*B%aiPdxmWAFit z8L0O=2y2ve;_bL++9U+|Cn%*MmbD-vY@+P)P_DC=n)z4DMoUIXZoBwttYXp*l#X_1x7m7YQm6Y! zi;gv)EAl~z6NsF~Jb_?%2aaew1IKWK2ki$Yu*`U-@9tbCLP#*Afuqo(o%$6!Qi^bI zNDxxrLaW4E9glx)&T%?V1;Y?M?9w4t52o!)Pnd# z$>Pqs`75aVdJ(273Sg03VM}?qZj(dkbk&=qAq7o3S(=FZ&I)Du1Ih#{`%E8{ZlT^- z0K}Z!X$XByo$zkI9+FW)1;<0^F$`w+DfFcdgo@i%*O47WM_Jg_9zfcNUVNlWqCDlC zxtasX^HeBfJp0s{KXaTd5XKg(+hoL4XdRs(Y8z1 zt*`ZiwfiqiX=RZOiAr+)zIm7W?Ky6Y&QV&2lo(otCSd08IcO?5xykfjABN9?jG2T}Np|2^c`4DXktHlNdmrh5n)W@2_{<*0dU Qa=;#r<=`<*QftKf4>7DBk^lez literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/expression-012.js b/js/src/jsapi-tests/binast/parser/tester/expression-012.js new file mode 100644 index 000000000000..69e39ba47c53 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/expression-012.js @@ -0,0 +1,44 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/expression-013.binjs b/js/src/jsapi-tests/binast/parser/tester/expression-013.binjs new file mode 100644 index 0000000000000000000000000000000000000000..2c33b5a9c52282454cac85de0787e40eaa58d4d7 GIT binary patch literal 7198 zcmds6%We}f6dm5M03or0RhC5vl~NuOq(Myx(5i&0NxMZ(#!ZG!W+IQ%$A7Tm&yZNL zLt?=vaIeQRc48-W(rKi&n<}w=?0bBD?jvPB9E7w|?or}bwprX|r0-qzJg*)5Cth`< zvDtjn?8F1=m6yewau_7M^7omfb!Mn#5)Kge-!IC z;9NNkD`o;J@Vy`kcn+X%zv0t}2m1kK0xlwbb?Ah%AnI0b!8Xl$t+nx`QC^ncm6s)m zj@1;)3KSKnzCMd%GU`et+G>kE^Z#q+p8$3(kZ8?CLnX}9hWj&6A$(R#EL(W4SPU3iMI z#nTo~=&!{&<{j9oy8E%Q`?*@*DTLIUfVlen_3KwJO}H~qSr5|(In2iZKRWQ z4v-E+6dmx;z>+dB_j`+1IGk>Z>gC93)XYCxHkva^?%OVY9IKeL1Es@7i5m1s^SL4) zggC*l-=>y0AQ)bUBjV+bByB=kqu)@X+H99bmm++CB%B4*;`*AsN#&VMN^B_zD?9(b4#Cn@Z$^U%nsm0r5ci!Fyz&PmZOK2U z4@$RCZzTX?PHw(LPS)4d2=DZ2AsHrAa6EvnLVt2+LSO1YsJLx)9oa#2l$l-a2_%Z> z#Uo)85=Vl$baXQkI zO***F^_;#sD%3@0`*?SW8TN9%P%9Io5Bpgf0q_hLXg=KD{9{4}hV z)0bQolOKUC}d2OOOvkXV3)9oLvWY@QG8T&xY!F zTzr!j!)=HT=bRRcW;A(PGB%+I)_0gwF=h)K4ve4zaHoEsG)gzZF1k=8P7&SjaHII6 zNhZ4JI+iwVlKxy{OFi|Wv4(~mvPzU3vvi!~h+Q)^NaJS?IX1!j<*3c)w4w0^f`*xx W%~&~V-kKb+$6`5nN>9`p?*0RB1s8Jw literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/expression-013.js b/js/src/jsapi-tests/binast/parser/tester/expression-013.js new file mode 100644 index 000000000000..f4986a5c02b5 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/expression-013.js @@ -0,0 +1,44 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/expression-014.binjs b/js/src/jsapi-tests/binast/parser/tester/expression-014.binjs new file mode 100644 index 0000000000000000000000000000000000000000..80dbbd50cb112fdf4c2be739841958a57df43fc4 GIT binary patch literal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o(0o Ir7`9G0~Z4RqyPW_ literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/expression-014.js b/js/src/jsapi-tests/binast/parser/tester/expression-014.js new file mode 100644 index 000000000000..ac2dadaec5cf --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/expression-014.js @@ -0,0 +1,46 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/expression-015.binjs b/js/src/jsapi-tests/binast/parser/tester/expression-015.binjs new file mode 100644 index 0000000000000000000000000000000000000000..87a6c892fbb55b76dcf2f4d93e8f614801940a1d GIT binary patch literal 6274 zcmds5&u`N(6wdgKkPs4r1E(A}O;9G_0$G7|oz|)9CR*)^+{SCe(xh_Sb^R;2^Ph1; z-1skecAVIa)7I&-^5aycwmxN}n-O!y{dyUpn z`)#`yjiB}4&Q9*lz?%Rsw^d_U4*ui(yl z%J?=#6b~WoINxL@5Y_>kp)K3L#=Z+j1k-N!I{r;E1v{ni*(I15@7Tu)^SU3lcR&j)gw`%-QJg7xp{g zH7ILiKPRzNjuxVJ9Fd$IlZKMJ4mIL#DF6@UGeqd*{{w1+EWmYSL1xEZAc+ zGK&_r;_rdU8kuDskWg$AxJ)#wxtnK7beZ+-7TX<~XgvowJ-aZhSz#zHPhf4VRrap^ z>ILuAkIy!@-syV@jY(5OcwYQH69?t$!wwc-g$_})?-5{K9d=1vxRG8V5?mFihG=h4 z^U*lMye5y}YBZdGy;7GN)FU2L-A)yyFr&7ibzq^Nx!kSDsE=?n>IbYdk^n_olU-?> zYLkIyOe>fn6l6}W*d!rOe$`V-lM7|xpYvIPYL$@+#=`~O{C=p$pOGuh3FYwS^~gC0C8IE<`LQ>|$3#5!PeE4SNkj#p+5? z(imScuHgpsZ$KJWUiJj26kI(_D#HvhS={YSXln7q)&cXVYmneege?!%@VG4Fwn{sv zXRuNE`IS-(E_uV^nyod< FzX4OU@EZUC literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/expression-015.js b/js/src/jsapi-tests/binast/parser/tester/expression-015.js new file mode 100644 index 000000000000..4febd4c3c935 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/expression-015.js @@ -0,0 +1,40 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/expression-016.binjs b/js/src/jsapi-tests/binast/parser/tester/expression-016.binjs new file mode 100644 index 0000000000000000000000000000000000000000..0632656da96188c756632a945ea6330a1f3d6f31 GIT binary patch literal 6523 zcmds5O>Yx15Z&^PKnTGBiBpcPDoBwK2Uvn=nu=6WT9MEb5^{H)#B{S8d7Y*?@;CTr z+z>bZ1!Kp%c48;>wrNCrsREP<^M~F^R)ztUrLW zb{1Ab1r!NA5)+mK=*QPX95d1(mk1gj{py!4k%7jF!sgPt2ZWW245DA^W~{G;g=_fn%nhToYSGd0DFZF zJ*<6hEz6;|;p%&>SKnTnj#<4Qf3MDu-0pV0-Kd#%>x3vk%iUod@C+;>Fe z%NgHdh~Yk@o#30w1Z#fsi>RN9Uj*geho7cqhB zq%;B1?vOhowVLi=%wxbBQ4pL@pv0KAlSa}tZ4w&t6O!A=?`;wzI#zahTwy@BL5D#* zBivygCEcEqPANnjXj2`eJLwW29UQT2jphcHlz}<#Ev#_3-GW5Tktaf*e_9Uu|AqYy zcn!+hFtQ|;&JjmN;&8i&L^zxuiPaUzzi=BPfo5Z}oQ{KQ6g~~`fNQa7`#D_s6cC$9 zDF-dF9!*9T?3{qtvGL%9f_j64 zj+q}VY{fqSu0dv12NV?F1TK@!s`c=X(8qRTUdI$bkwWrbFfivEK^3ur0Rxf;6R7t^q9dhbr^*#rX<@6Suagq=vb8Ay0QWKg4N`h>#fXz8T zp03h!1s%xCrkGLoJ1PjXm~+1;5}_ZdkAAM#tRfclsu3EdSg>XQQ(%AoB&i?gKoP-T z(>5KYaPn+Im&9o?6(q&|YnD6?PF|#|v+U75f8~5upfImOa~wkBz<&pnd%$*fTc(7{A>7W>)FljiR|C>;)9HDvmOY6|a<59^3%owc$I|Tj=eY2rDUY94H#c&&LKNDnO!pb ztDm5fyHMFLRvjEX!qc2Ny=Y0JbR+D_3bXA3W&H{feF%qU%4*e&bn=33dH;|rb`g_{ u9MX6vmTPmEDpzg%(3WQ3C^XE}d>WLiribN%y*SE6Ylkh@&Un4E)~0{K{zfJM literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/expression-016.js b/js/src/jsapi-tests/binast/parser/tester/expression-016.js new file mode 100644 index 000000000000..9d0bfcef4e3b --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/expression-016.js @@ -0,0 +1,40 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/expression-017.binjs b/js/src/jsapi-tests/binast/parser/tester/expression-017.binjs new file mode 100644 index 0000000000000000000000000000000000000000..afd2dc722533a71d2c89709da600c796a7ff2e15 GIT binary patch literal 6319 zcmds5%We}f6dm3m5JEy?!79t53Q8rUN@$2g(^RC2(uzdgf;;0T1I|ojJ5BQ|`~{!G z4zc4exOSYe8#_}^JB?^p(Zu$#&wZSG?U0X01lPj>MsfXsW_^l=!R;Ujj5LT1r7QOuvci% z!{+C1RR+BWN8jsietBmbX7zUby*fJz-n~|@-L!d|0Z}3>cgJZYGO*S_gfJWS66S2? z5#QyA;~}J-j5nPL&ioVy(M#ou2>!x4t4yjM+58BM#yFz9hZ!$ms9;TWeU8ge5IU(S zAle@bLog?G4>HdHYeGSAK7kTr+RNHm-{vGWt9pMN?w`u~OfK3EOP z+L$;J%Zw3EMG|nkC?Pmr?upeE$iHwJD}fe$QccGpGzy&6*B9AUlPvlk3{V;qXjA7cwHXE5V#dOv z!d9F?BwN9(>wtz5lfY!ES#@sy5&GDED(aX9C{sv2=m z18yBU3lYm_?tVI6Zdky17`aG`id=u~Y*wO}mCMte%oH3ET-nh#(Dq){%Y`1e402nXWXtktoTY0<^jcQry`ii@B%`)*@Cdv3vT2Od21^+Rs@66T4y^H+yO zbIeX=9atIJwDkpJwSy;mrBsco?n}Za;@;Ol4BI}D#I``F?h5uM5f68J-$1V5f^#o^IvlZo!F&He!0rvVG)ty-0KBMkupiRRTb`n1*-ZLJo*GSovW%- zFWBtG+3{YWM%)6X1_h+`uByhCM5-Ef#fKVN+Ugoh7w`PWp3Ht~Q=_&A)PTEis=;$! IyqvY^9~dtKl>h($ literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/expression-017.js b/js/src/jsapi-tests/binast/parser/tester/expression-017.js new file mode 100644 index 000000000000..1e357ead7670 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/expression-017.js @@ -0,0 +1,40 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/expression-019.binjs b/js/src/jsapi-tests/binast/parser/tester/expression-019.binjs new file mode 100644 index 0000000000000000000000000000000000000000..ffa699e488bb803d2ad72111d117148a4f1de846 GIT binary patch literal 7291 zcmds6%We}f6dm3mA%w(^4Wq7FRj9lxAgx5wP*Rn&Y644;n{ktY=}hEt`uGo4{23A} zcKikRI-ao;J5wheBIqhgJac>>=bn4*RQRAD(e+A?l3;z8C0#}iz002G?I*#hS8X)6 zTCZB2q))xdig>0Hg(+We-1ofO@Ki;A{Uc!^*^lT3?L>qT9wxDX3e@-1`x?f9x?idhA2#LMbK| zrp-T~Kj%lxTd-C2!)Eit`)Yl!l%QS*#HUYIS6@6g;m#4tdM+O=PB=XT4HLzyWW_3W zH4;VYRq;j#exgdEblx~fBL*zxgz+{_d4Y!#R!3KMoW})hI?@Hgx&sVEYIWVg87zQf z2I~C|+8Sl;WIO4aJ_$ko4oYc=Wi^ZmJ5_#pDA!pfc@aI}9t*oY)rX|2Bha$iNDtCq zfOH5%*$odJ^p%4-?=7rwu&zM$a^zvx%)eST`uDpeN(amcgUC`?I!7Gk9pT=RFrvZa zOw4cE_zl(=1vH+Ma>h5*D0G%K zaZq{=!9OC*AI^gQnz#WRzPq^43m2AN`@^9jTM{$l;?ip~p?V4(cSnZ!i*SO1Yey5% zMsf#koFRcWR7Z2MHkV4Xv#2NOv2<`5p(f3C6GmQrhZ&V)x(4Fl1}Xt}x=fT#=}zc^ zt;Dx@K>P*|;y*Ike=JBH%N=l9@L!NzvyGPe(%3;qE?KU#wZB!gyWqn(dS6fN%VnjSMAyJfp~ zGyD;pBQ7~|;0Q>F3n#>p1LDGmggC)1XCx%vv#adqcDY^tYbUMiC1dZ8$5Y*>yJ!~*E& z_s7f$tTT&wp*Y99ObYD>p5;uoKM$Wd+S@(ee{#6B$^W*s$%Rl^N8$4aR=_;d4#hn; z?O8_N4Ul){g6LQ8-1%NsqL929>THXD@YC?pbJNQ{P76>`mwyG>9qRIQ@99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21EQ6Q4pY6k8TlJNf{H5k4#mIvD5#H}Gb@jaHuR0MBNmSY@nyMx{mpvIu0&1yI z)i==sNQ^G}8Zv!!q;*YIune;Ehbu;Q{_1OnflGT+aCDV8JTk37hT+P)mvyD43c#*b zlvvi=c)(g$i)tKvcAzLtc51TIg5+J9V-=%8d>P~H0okcn78=IwoIQ^kNbK+-3?0cR zNNtV5!_yb8Cxf@^I)UZPShC<5M?0FtV_wK+%64t-Gl?g|@T-`2(rcP6JlFXpw{X`h=EwJb#=ZDk8IeJ++-?{Ccp zRo#!Gk?3==WEs{n-ll4L3?s2V7fW#v$=#nAGtFPAckE`X!j{hTQ|PsM8~F>JP+c6U z%_T<^t%=}>2^d;Nig`~4S7Yp;w)FKu1T4dlnbtLRvTv!L zdt@F-<{p_ep1DWZ`^-JEIbP--Sxb_+M<^$L?%_cc_rRS<-@an0t@9$J7ykbv V5P|wHw&Hqiys#znT1!4!`aceRGC2SM literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/forin-001.js b/js/src/jsapi-tests/binast/parser/tester/forin-001.js new file mode 100644 index 000000000000..215de6c4c8e6 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/forin-001.js @@ -0,0 +1,297 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + * 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/js/src/jsapi-tests/binast/parser/tester/forin-002.binjs b/js/src/jsapi-tests/binast/parser/tester/forin-002.binjs new file mode 100644 index 0000000000000000000000000000000000000000..3c83f781854050e9d1bac3b4068ee9f62065e5de GIT binary patch literal 15210 zcmeHO-EQMV6!x;PEFd930&ci4d)3v7wk$WON+X&yt1arLK%zwg!OBUdsi|v6V`odn zJrb|L9TMW9Ks*2!yaVTq$C=a2*qQveX&3jRQ8M=D^FQZjTua8IfYoa!%p26d;L(tK zXUY^rI1TYFpx(THwb?{o$vM^CnzXqqjfxxbO7>w$J*3$Gyal zLIE{U-(%<04+odA{sx>|v#=sAp!|X3hkh~vppQQourTqDeZ~b`=$$E|LAM zrqgP6502WkE%{q*OM+0Wj=28NPZ;+C0r%Vs#v0yhfOi}L^hev<4|T*0c}vKwCLeek zZhG!<{c=jcg0lP*u&+>-Pg`GgRwc_jKzghBWbfIv5ad5sC&*XeQQd>?VXN38EKTx# zL_1+FnC0f?rXRX)oOlU41K-f`moU)Qk0Z|F7<{~w;S0-Sli!U_+Vp}z-74h_=V!j!B_*q8-g(e(10B$4)=#ADt^k4gg_6}gQyBhfV2?AsslAL z=qd&$c5ko>3+f6yc7mLS{K;3tgC32;KJJlpyL=hwggtHq+vi!FzXwwVSL2Y)fBq@^LRqZku4zl2*(;~d~d$>dk2bLMg z+i)*u$(V<30#?3R93C>(r$4DElpHFHQWk}3OrlgNx*9WiQaP^Gr20#k)O#kAav!+& z?im<2@4O~?RCZ-5l2f~CkI#C{P^6mVxK_LBEn!#h=GfJCWmYTCPq0u+qDB-2%nJ?j zm4WKo#4CRZyZS)cm1KB>?1k=q1N+5MOLmZ`aA0&j)@`} zIdYrOwSUPQ6yO8N2P}QG{_XcmEVRFV~J^_V#`R9B7fiqD6)yrnEVy=MAO| zYu;|*5AZY8iTmD9<6#xxEq$Z>l6X1%GkY; zmP8H8zI?lM*Mbv#q--~5LfPP6|CB8TBkyB8{ETHDM+!C8ixHY0(>c%d1&o5zF zO9PhY(OhCp*Y{Gcrj(T&*hBKthTmf^-uF2S|69ON)+i+H1Bpk~MLUIPTj_T=m6qoJ zY|w_|b#W1XdQkAgOipon0xw6$f^VIo862*WFgq2jkHG7vOG?o?ipjj@=yfe7e>WAA zRV9Y!l+)1i8%&h65PY+$?W&lB?V&0r>uAO|x=bsf@+$$-vLtaq8&xqWUYN*9*Rt$K ze$uVoQpQy=S;yqCDkjsHiezNF9^Y0e zY&0~z5u7WwZa&{b(lglF09}S2b}s7x literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/forin-002.js b/js/src/jsapi-tests/binast/parser/tester/forin-002.js new file mode 100644 index 000000000000..7d898d6bcf40 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/forin-002.js @@ -0,0 +1,77 @@ +// |reftest| skip-if(Android) -- bug - nsIDOMWindow.crypto throws NS_ERROR_NOT_IMPLEMENTED on Android +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + * 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/js/src/jsapi-tests/binast/parser/tester/function-001.binjs b/js/src/jsapi-tests/binast/parser/tester/function-001.binjs new file mode 100644 index 0000000000000000000000000000000000000000..775b94c1a520c4b87f50ea78f0428594596bf7e6 GIT binary patch literal 3935 zcmd5Yx15H()~geoB+A&xmx2}t3HmPjGZA*iIN8}%AFS!Zi-c2~C3Hh+~rfW)t0 z>~&%{-UN5k22Rn&_Vdh}c{Afk&I(3a(K*3M>l@Egj;H88LTHpHbM(2_{}O+U$9X|e z)YN+-Mulwk_7QplyCV1a8Ris^7&#(ihB=lr&ooqGzXke1v*bF~FTlC?H>{j%D4HOe zQMm+gukR%!lXOA}*Kir0TBC*JG)r5L;hMPH8T3y2QPcbvH4TW173=-SR1%JvhP%LQ z=Ha~nyi<~PuZremmW`FiZx0XO``C*+nwq`HT>Su!UtsQUcTK6u>QBJlA**NI)A+Vn z-2>CRov-cT2cMbU6Zw00L_UJ62ED;?*Z14ah`{801!!e*zHSs)LMmr(8WV<7(Kzrg z*n(I{e@=veu(sZ)yscDdMT~J1^K_=lo~W!u0h#^`u-ZwYDs=~o3bys2v=3LRa(Zpd z3~YZd;ao;88>R&wyc-U6Km zUvTa5jNRCoI%yhFR?)=v@qM0qud94Kit$c$fKjw_NYg$=!{BBR1l=^6278UxhxY4s zFCF2aT9JFIF=2e?+p{2e1iPx{@gqbD>c)5<_hLj5Cut&~BK^&R6Ou&dv3>#0jf=2S zDxpXekc998z`VW@;e?Z8f~kZ{&`=A_I3-Dc=N??suGcz^gI2Yo{;O6Lh>6vf`Q$+3UrUXkG^Cw`h(U?c|&+Szi z^Dc;9uYKJ8@=qA@_xcQZ2d?TgI?Z}{M0m#J6M;6s;X4_Z;X(H+?r|IW5}{c?8&S*{ zq<5Pmj)#zTGUjmczcW8;D30|}d7=k@VVzZG{Ci~c1JIOlM0p3ZG7TO1t>w6k3W6t< z3W)Z{!Vt`$9WaD16q#Bhd}nx-VhMr-0Z> z!vZwq1DZ}8*hK)Yt@&7Ud_ui(mbN8~D&q4HF}C9P?9i#MFS4tS)80uiKuHuso0_-O zroek*$IPM9R{Rq%f<+3t4rnN`2~4I+xAXE{sOtSh)G-aPNFmwQ5pL?_!K=P})4~%& zG@(*S578MAX6%N|h1NxKC^@a~ENM(F%webu$~;p;yf>)DXw0y*;|S)W;r!XkJnCUI z=}~R+Tn7_n;c(i7zClFlxyeo&@jnYE4SS!Dunsg$9 zE0se@FruPC<W+e~DYR&N^pjO;0WBi!W4nRL?AJ22YFk(>xT~XDyx`Hw HS%CfmU>fbk literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/global-001.js b/js/src/jsapi-tests/binast/parser/tester/global-001.js new file mode 100644 index 000000000000..228b110c8954 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/global-001.js @@ -0,0 +1,45 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/global-002.binjs b/js/src/jsapi-tests/binast/parser/tester/global-002.binjs new file mode 100644 index 0000000000000000000000000000000000000000..6e10384cbdb2a51a1f96e60c2a50f32c191c152d GIT binary patch literal 6254 zcmds5O>fgM7!KcG2S7+1IORArp$^0Wp{#;+1v*vTv{t(!xA9uDG^reSUH=7V{uvi8 zocI^KcAeO(-OTB_3U;be+mGM(dA}X7@hHO8V1Q9rJ)lXSqM>)w^So{nPQ9H*Yp?yj z-AhK;3o2qy5RsHszd!f9N3bi~9i= zDT)N#DT>Ah-b29aM@bh&ueP?{n2;HCMUWQA8*jm>Q$)?}x&%v-`4h0$Naj)fu)QiW z?||rg?bl!5n#8Q1$KUJYk?Y-QbeeTjZ`~mrUGgbM8({yla7%x``wjP)iF^r0>t`d1 z(-fk+%@D&wh&thNIRD=oo;4Ij>Zmx;gTJr}DqUNLV159arVLTm!D*3(5>`i7a$H6Q zo+hOVi1x>vh}5dOgECJ5YeFI4e1SxaX(wqWebZ_pjr@T4HbQ)d#E4FnULH>}khUQW zL+Xt1G4m+t4^-xqxrhU8s*7}zt^m@3h*hU(uAr|J%>CZt6%NuB#A=Q_%k}xE<)VK- zx8DWUAjrp&C9rfKaZE}a?h_&r4i{TueKqnANMi)hyiHcqaPS<3&w6;on;}#8C8&G` zh^@rWL47u$$;5)4JK%NfJ-9RM?3hf+ri!tm=S*;+udnS-P#4e}t;uk9i$a0A&ivw(@XYCx^W1ns3TA z5uE`^HBEqkTqdOqRKm58at8&Te& zvS}WbI)4tPaqxc!l=~nMOJ<#n8BCdJ7yhm$QRvBqt2O&>Vm5nB!C?!YGt_h;E`0&} z_}=VYVV;heWQzpXxn9y&TX>>Qimb7!afsW5k99SaV$&uf&AHw;BP}0O45y&rm1w}IO1~K`y0^K;)!npX6~#5J6QdKIbl> zc-u}39*yOiI*fW?0X*`|EwFRCkS8e{GEzQsD8fI!fmC03;VYy(hjB@dU7b|P= F`3uh!>|6i< literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/global-002.js b/js/src/jsapi-tests/binast/parser/tester/global-002.js new file mode 100644 index 000000000000..1639a34bb783 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/global-002.js @@ -0,0 +1,45 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/hex-001.binjs b/js/src/jsapi-tests/binast/parser/tester/hex-001.binjs new file mode 100644 index 0000000000000000000000000000000000000000..f210c40d6b2cccf3877e488290f3b2568060c45a GIT binary patch literal 18562 zcmeHPUys{F5I6s!K>7Ct0s^(Cio3Sr0ipCzE=|RuBdsn+U!XnhIeR&CjuY%nn-l#Y z2)+c*d=y?lm3ZQXkHE}&H(uLoXYDv47x^A8N^Fm3X6N^t@r>;zn~Yt$+dQMBzx%)+ z4SX`RUbHOhWYoW~_V&A9_rB=aqcOFbJA9v}>jZ4~w~l4K1$#Bs!ygj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)k4KwIomA801Dq$KOEN+y#)@s#+GFs~*ECQc#Mlj6jY%(KVmd z`~-_z&uZlJ>5FhiM#wHfqyY-*h9}a<)^`z)OX$l_l>!VLT9{T0n*+!ZkIb~(^ND>< zmvpB>^;x5^$I9DRcZ%1sQ*0Cf8HKa>Sp}*3st^FptZa~gmY-S2Aksn^Q1*s51k!#N z-rcwv C5O*;E literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/hex-001.js b/js/src/jsapi-tests/binast/parser/tester/hex-001.js new file mode 100644 index 000000000000..04c3a97b9450 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/hex-001.js @@ -0,0 +1,68 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + * 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("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/js/src/jsapi-tests/binast/parser/tester/if-001.binjs b/js/src/jsapi-tests/binast/parser/tester/if-001.binjs new file mode 100644 index 0000000000000000000000000000000000000000..da9cb6cb563fde67bd6e9a6a0d84b8e797b46de4 GIT binary patch literal 5066 zcmdT|-EPw`7&ZSOxPTWxz61g4Htk}XLZ!7-P_z}aX1hghc(E3by*2PT($AfvA^S!^Lk&c^U{v5vKO};Y0jIC%kP|@^OX3VFvdje$d7Bmcqi`CD@?=nRN z;ThZs;b|e>C=oB#*4BNzIc_6kEHKO6fGwO5;SYD0Uy;dg^)h+b+3#1yu2;weT?3NrCJBC zdk1^1&b}Y}3an~zu5WH_ZB#4H&ZnuMQi4tP=SP)U4b9sNeXdP7w^OqjLujJbo!k&h zxS}Qu#3EEkv}) zw~zu=l-S)8+slz>c{6`3SZKvO`2|Ap4t^1U&)Mq0LegK-espE75DWUhOtBMBf0WK>~ z%uzmlj!!34Pfi7GLN|p)SB$p4Ymop<*9BKA)9X`iIxe}y%m9-vH-e6IRX@ z6ipFjRFnYr_U)7~L5GxZ1;_B%1YHPD*{FUGwn*?FD_5yQvxxMd}6#fA0JyLkq`jAvb;UR?HYQB5@@wv;) z{)zm#KO*nKR=sww({l5+6%nY!CxAv-Aut<|d>BE&LILI;we7%Z>&t|bqJXka1Quir z<)&0e%5iU9HgT4jU)3K27$T;c?0f^NSQ-yx%0-V9!ey__P{Z2jCXQWFkp8Gsz-bcrWkdBR41IBwwM#oholohWVw*3rU|@96!p)P#{i6=f*O% z9Z8^Lvyn~G4L}AEQMEVA1S6B+b*c!6?wV>Xk>_?_etP7$rM(~e4t^D@nj2EG)^}O6 z<rRm8|F(&u#a>?I6Y_s!b#vxTDuulE#H`AEAJYm zor<7_QQt93GO!-P(h=qlW4MCnZ(Wjh;k9XcK*h>aSSU?s@c{ICfbPb8Tz;yy5iRir?wcH7&QEb*a@88=70Mczy%!u3ozU literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/instanceof-001.js b/js/src/jsapi-tests/binast/parser/tester/instanceof-001.js new file mode 100644 index 000000000000..9bdc7bfe3f8b --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/instanceof-001.js @@ -0,0 +1,34 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/instanceof-002.binjs b/js/src/jsapi-tests/binast/parser/tester/instanceof-002.binjs new file mode 100644 index 0000000000000000000000000000000000000000..293e9645539ddb3fdb5b4264e834523ea11d3b48 GIT binary patch literal 6327 zcmeHLOOMkq5YF;go(BX7#4ShA9x8F*0HM;hRHCSK5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jXtaDJ6*sGI#Ra=_$oJRO5$pI2EjMq7Ib~ z%@B-`9J3(s16A4ze6gNBRtevNDC%GdtfJ06Jmz<}NO|S@*!Nv#dzo*d?j){6=Qm%k z0<1FGh_-s;6tkf>GCJ;RPDK#?WU_M(j+mRgR>b-(cx5T%f7k61y!$Es6R%>%GxZ;I z{t)_$ca<|iiDS7w!bqd2Ovr%Yjl2d!3RUR_@*ptXK=vM`8_0nM=>}5gNjH$x$s4lb zf;VdqP2p{b4O54_@fMsU^%NH(QaNOgw_#$|yu8O-bw_3JrmTk~yjd+<@dngXJ@!d$ zRBe#KA$V8aaYVccJBI2}Z@d*XO$P;0MtxhGH)?7ayk*W=Y!kGIKgV!qyt{}5oSIB$ Rp5+%at*@IH9^O-!^*>m|T~Yu5 literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/instanceof-003-n.js b/js/src/jsapi-tests/binast/parser/tester/instanceof-003-n.js new file mode 100644 index 000000000000..1b3937ac8ab2 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/instanceof-003-n.js @@ -0,0 +1,88 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + * 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/js/src/jsapi-tests/binast/parser/tester/instanceof-003.binjs b/js/src/jsapi-tests/binast/parser/tester/instanceof-003.binjs new file mode 100644 index 0000000000000000000000000000000000000000..7c92d661ec149be7ee8db05d540e1534c00b3580 GIT binary patch literal 6082 zcmdT|OK;Oa5H|0Z;DP{&Q;r}6sVEPLx{;bRML}(fnzUE6i8qO<8KqGeev=8UXz zt^Tg@rqN~tYS~3K#`fGml>XeatlKck#?y}ocS*~m+qCTwPK3*R1?8CMz&dt)Cyw& zTRo>MOwJp?LizA*{cx{bJy;5_mjUthtM!*jumy;$ej0EZ1fZ4;K?LoCimCFY(fd@n zs}RpKQ`L+%yrM>=aN^_;M@bh*85d0&hzTBQSd6|i^xIPIvGPlW1G&!JNAUa{)=9V> z#*%hnoU+H-$8i?Zwy@X~w8g;^5!F#Z_25P4RQm%lGNz?1g_kgqHFKnoBWqb}CS=TBoVl<#8z9F;W?~K+>j&}$e z{$lVs!*@#WB+**$2=5MM$_Mi@eG9O*97pP2g#;-asn*ShC1p%vJ#X3d2_G4kW+}EO zCK#BXoO^r;OzCLdEr2pUdR*8neEzag2&+&(!l!3Z_~Bjnd81&KPYY8{Gai5$A!Gsd z9I0BJwoaKbj}kxZwE->)W9slZ3BL)r#ysOXW&I6OY7SVMu~eBMdWb zRcEes-@ucE*5y=$`!e2Id>EF5DM^qMUY?XF=V_;zSp3dbCvqfx4z 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/js/src/jsapi-tests/binast/parser/tester/instanceof-004-n.binjs b/js/src/jsapi-tests/binast/parser/tester/instanceof-004-n.binjs new file mode 100644 index 0000000000000000000000000000000000000000..1d16ce0406f3c64d759a004b04af2cb0b8bdde05 GIT binary patch literal 21635 zcmeHP&2r;J5LWnIps3=)jVfF@?Gi$Ef#Q%dfy6OjDtJ@tuy9K$_Sg}tNG?fEHarRs zz$5T56h|)HIC7+WJfmrOM)p{iU5=wmRL*ExJ=5J^f72RGJsAysc2K`$ZtvhU3I~yU z<-FoJ&PCX}b&gu??>qaQZa8F4eUIN$_q{kd_~O)YK7hOGwEJ^6^4trb9kZ_QMsDJT z0TZ`fG{bB;6{THPDE@Ry2W4+Np2#*o9_UK zS#%bjgads{96)}9$ku}U$P3))R*lO+cmdc37zXI{SwC?iZ*ZxQQ=kw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jUqgcLe zV;}C&3U#7O?x(R^%D2b6(xj!R{U?OLb2QMQx0m29SzSyz6-2NJufh3Re5Y|@bq?2z zQYAX@cuOCgeK-EziS^p>EmbW3-EfESQL6l({6>_|)cfFw{8U1bM2yZN+H#Rpw3}gp zG|F;{igM8?3P+^6mTe$!FS89~!&J6`oWhW8AjPR{1IhQIAupIkv+<-C(T0FFaWb7~ z!Aa7Oo*^Q&lL18=vI)Z%hoaSVzK3Yad$S{&^;(-~Kuz_ts`N(P206q>bTyr!B$}{e zte;OOT2a$%zz}8hPs~N5q3|MFW*i_lMiTya1W(4N%cBNxYI2=K$S%R literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/instanceof-004-n.js b/js/src/jsapi-tests/binast/parser/tester/instanceof-004-n.js new file mode 100644 index 000000000000..18de1c8da079 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/instanceof-004-n.js @@ -0,0 +1,88 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + * 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/js/src/jsapi-tests/binast/parser/tester/instanceof-005-n.binjs b/js/src/jsapi-tests/binast/parser/tester/instanceof-005-n.binjs new file mode 100644 index 0000000000000000000000000000000000000000..170b78ef4b53fa652b295173d353fe2dc986b9cb GIT binary patch literal 21583 zcmeHP&2r;J5Z3a$KvBh&f&y1gyJSPMP+Yc5AaM+s3f|P(Y;kib_Sg}tNG?fEHarRs zz$5T56h|)HIKqu?c}COnjO4K_yBtTCsGQNXdZxR-{-!mWdNdik?67{p?7`t#;Ew|P z(t5?RtaE>GV;#5J-*=vL`u><%_5Jvsy6c3|;YVkd^ o1UVZ=Nhah($RA%ki8j5kMc`8Za+%h7Jp2ah`oCl@6o8@kWPl z!ectkMz{5}UEk;btM79mR8}Xx|I~?CV7sxnE8CqY^4)Z z9y$O6Z-DB}#t%om&(xV&|3v<|zKMJt z9@TAiPn+tvsYe)k=G!1mdZsFJiK%S990x26A-X$}9kEM@y4cxR@_%i3Hf-0GUE>~o z_!pBwMTcn+%x}REA@qW%%fcvUgj_6@F7;Su2ndsW2zD@<;6#Mlp&JYak>ol6y!j4* zm<3(`)E}v1iUH(Th-@Xej~&krZsfQugcpEqfMI}6mklE;a7GsrIXMcUpk4VOI!P-K zX)qCGLo^PsCI^`Ky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0ujs^?Crjj9bYNDS|)I}eFBVaHHCYmT>~rs<#{ v%BY`<^F~b(g}2N(3~q`R@!ttN8J{j90jDO@ne+T2*ZR7N;o&W?ieLW+b`ysO literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/instanceof-005-n.js b/js/src/jsapi-tests/binast/parser/tester/instanceof-005-n.js new file mode 100644 index 000000000000..8f02162cabd9 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/instanceof-005-n.js @@ -0,0 +1,89 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + * 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/js/src/jsapi-tests/binast/parser/tester/instanceof-006.binjs b/js/src/jsapi-tests/binast/parser/tester/instanceof-006.binjs new file mode 100644 index 0000000000000000000000000000000000000000..36ed72efb86a8407430d1f7ad53bb86ad9e5f2db GIT binary patch literal 20918 zcmeHP&2r;J5LWnIsDk3mg;Y+vge6(_wq*>7H$bSYm%`q?x)gith*cz)Bqtjlg$LM2 z;8`e&6E|)gInq6z(X>1xc`VB=$I&G!XEd#z>F%$;X^p0lOvXNIHZGVuX#Nz1qsYB< z-f|r0JRICO$EWQdJ5M_OaLk;>0l%l=dvVfy^UQHRg}WNG`%5?S+;g8jWqsd`+{6n5 zE^45D$IdG+7-VJr4RUto$qFMb${RRd;3cU5`uNiU3leYWv51Qc+)Jf&oJ3wQYQ7JT z>72B>r_bAs1M$Dcfe=Dvb@=^fUcw^R=i;thf1=6z802|DoVY=sg~Nx3hmUlzQv3m* zxQ2M@+tBmMjr7~879}V2PmsOF34M9;bEm2aeGgPWX+1mYeWlOL`X}dau8ksv;l+xIDIxuoX8tpDBKh%go5_fgXko!K%~V) zR1MHLz+E-K)b9;mVWC|?kfxHSD4+f`Jm|Yg(8t_J)8sp#C*-y2)s0c!x2E~C_wN~0v3thuhkIgm@Mpvvjmz= ze8VhJQDuQ3F9%WC7HSgDShbtY2Ce)}HC9$y$johat$K3jsVa5g{9p=fxiM3|AXVoP z{s_Vw0Vd=otZry-22EKVLhdwT0j}R*pgN@p-1dY6Y zZq16jjdSnYwB9AnA+NPr=9LdIoh9Kkt6CamrMyoj1YH*n)7PM`2Gf?D;B)93v1Aej zyLv_V&-V{@fL!xlG^J50ZGDM&(6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|<|ep%Wa2sH;qJ=d?J+FQ z#Ku-KtV>r|C&`kQc>zOksOh?QCH?HbQAytb?HP>detU6{c#&)90H68b`;}2F=uKJu zhRSp3&NDRu*;|Jl+14mfQ^(lHjSIS#Ot;K6ytJ%_Uu#^pMsy@7+O4mri*j!Y{SDOg zdYFA$gEPKsWGL8N5y2NrJ8qZ)^ByS0OQ~p?v1)F$bG15*Z6Z+c)hykVir!APt6`Ue z15V$wbv=c-eNp11Y5}(AtYM>}$G+a%RikH&&Kkf^>EU)0ch(`*ge+`u9ySP~#6ryWUKE$cYJ~=QPjp4QNbd zz%N?4Pe5gSPS|=Eh^*CL!nw7C$KpgSSz>3yYVEme{U zDg)!S>&r+1?o1FaW(0?Kh2lW{a&NGi!}c1;C~KLvZf#k+#{oR?umK1|5ucSJLUDKK zAsw4Ag5GgEjCK^|=5LRmK#vdLeEX(9NJkTT!T%e~+Mu7!df(aJ0hJk^@jfFrfTytd~bpkJc* literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/keywords-001.js b/js/src/jsapi-tests/binast/parser/tester/keywords-001.js new file mode 100644 index 000000000000..411386100bfe --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/keywords-001.js @@ -0,0 +1,48 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + * 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/js/src/jsapi-tests/binast/parser/tester/label-001.binjs b/js/src/jsapi-tests/binast/parser/tester/label-001.binjs new file mode 100644 index 0000000000000000000000000000000000000000..92fc9e5e0842af0be46299acc7457e01809cb8e7 GIT binary patch literal 7746 zcmeHMO^@3)5asqWX?rMoE>QOz1RJ!sg?5|Rbx;ReC#aoV3)-R`A+o4aQg-)Jpg`|E zxBnu?{*?mlsXri>+%rQ_BxO-H{jo+G^s)=YlTC zJA{x453fjfFnlmN8BKZ0NN_CQ3F0Wr&u)B9$S3etU{8NSMMNht`<6{(Drg?@L_&q; zcSfE?Nm$4F8*q-+VR0d$qL4&MlxqNc`9a8%JeoyJNVtS9jL}&xqGW#dAuKcM_r`;V z!{Asw3yu|tjWv?*pGP?pG?sABXjyPL|W0Eg&nhCiD)J_AgVxvJBFDR4pKbj_K#l{Or**OVnT*H3i@Yp_N#svCEWA9Z)J5Y{YKNr_anK2PJxSXW_+1L|$EMf~yLeI*u&7OSGyt zVXy4L3SN;fIM*ugOo{tkn01jy*?_=6B1IZPfz|GiZO)bj{hzQPhJKBXWvu-)M{sAM zt}9~4&f1U+)BiVbeC$$m1ZF2~gFPZ)OWzx+ie!-5p{)$D?RhN2#@u1$ z#YLBDZ5I+uom(xH+KwJp+hrTMapImpHZ>x3Ff+M>*(TFw%9D)!R6t*X&=@*w2_}&% zg}03br0Vqa+JnJ^^%c6i7t((LPaC9n1*4Yc;&`c*E{;8%XqCyz1()tyonu&EZ?B%> z$cv3b?pK%hJq}&qq+llS-e>|eA*EE-Qg9m%tvTp-*};bcqrAVca0qSjOmBx=^oxo{ zRr)x^uryCwtL&_P+h+F{X?|tc2XMWd^L5=dG;`2$xMZjWBGGrG^3c9aO+znV9 zyC6N9F{2@s>5_+6U?5%sYp1eDCVBU^wpBhPuH}sI>>qy#2on^L4lnW!pLJ+QiU+il zXIyk*&eM}llNNhxJc!s(7d;SH-Agw#&Kds-qov+iqkyL!C`gYb*BPro>rk5JSh+F!~qDI{LZb3G_a;Y&_$XTl`)mv($ m<)eifZPuu2pm7GP=W9M2l&UTNo&o{56&01M$Z}KSj{VnJ*1JLg literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/label-001.js b/js/src/jsapi-tests/binast/parser/tester/label-001.js new file mode 100644 index 000000000000..391732a2d3dd --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/label-001.js @@ -0,0 +1,42 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + * 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/js/src/jsapi-tests/binast/parser/tester/label-002.binjs b/js/src/jsapi-tests/binast/parser/tester/label-002.binjs new file mode 100644 index 0000000000000000000000000000000000000000..be279c14ee9375841b79828fffde80c8524098d2 GIT binary patch literal 13403 zcmeHO+m72r7)6rQX&c&o1g?>| z;$67m8IZU`;+99?|Hos`?|7Vy<0MU2xmhV5`bCOp>n`Img)Gr?jn3?$T0 z|Bjq1FBs;r{sx>|%dkQrp}e8v1zwy1(Ctr$Jczvuj|&MGu(2jOiiH=9ns353-S$cE z^kJuQsGcju1l700O{?MuaAG+2|@m|Jwd(>TlG$RXYIunVQG>d0NNRv zBpFh zs9WHy8FCWsv!8~Iw3>Fs{Lq(V*f9H&Wa(G1ceJWp(tp_hi4S7UkhIK+K+B6g9%b$z z5q<|{pwk!-p!UE|W^(0Fwic)BKzbA2AT5bO z9hqy_u$0#T=4UR#4SClb(U=NyVFkHxoc}(r(*wvn8}M=tRP|p&O6ayIrO>p^3eJRh zfK?*+m(i0jJY?z15Gy55ztnc6eg1+eK`wdQ=3;|RRy5qwtdcrdeSa%W`D-Wn#`+qs z?Q8qAmFC))HEoqA_Z9r8Jk4&)hfodm1{Nrgxbm#x{xlfiER~K`5ea6Y6Bx6Oqw-lT zm9s^pwrK+Yg`H6sRkHw&_d?k#7AvKSWMcWkpH86dT+-oLu&l8R8A@dmN?ywk2Uogj z$3AoMr2P0@$3bo7_KAAA>>IR=1Otx3 zlGMkC9XQjQ8!6s~_oN-EXi~y}MUgO`#4{aVOf=_c6`YYofFva0XakWbli6Z1Z$)G& zEmRimYNFH0ON$$6Uy}Vg{E7Zjj)~WG_JTHpbMF%t8Rj@r=mQAmg*0yAPgq~9^ThcZ zz)KR=J@+CM?uTv~>Rm5zlX&8OY=*kzJX7e#|-w`&G zD|5G@d_a-s)V}Ws@!nw~pa+npF;V9Pr0a)DwPKw~3DU6d2%G73#gc|ac2yck?^K{*H8n=U~dUJHmWFxNiuT+#|OghwmH0vRn8` z54>*(WktBk=yFM-z#^t(e40EyVUu_&j3d=QfGE6itD(F^@yZM)Ulchc^EM9UAXO literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/label-002.js b/js/src/jsapi-tests/binast/parser/tester/label-002.js new file mode 100644 index 000000000000..1e2b63adca7f --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/label-002.js @@ -0,0 +1,56 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + * 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/js/src/jsapi-tests/binast/parser/tester/label-003.binjs b/js/src/jsapi-tests/binast/parser/tester/label-003.binjs new file mode 100644 index 0000000000000000000000000000000000000000..e0250521e717805f8eea014beb05fdead098fddb GIT binary patch literal 2239 zcmd^AOHRWu5H&x+hO=~!LV=bpKvjiQiM^XlQ>#uKY!{UsJ5B?);65CIv17;Xmx5qL zHdd0EH#6_ecoIFUIJA=q(5!tYMJ{PU_6Z>)kv);l&ER%;HcUkYBxzZjgfpevZ^wij zqE!;R-&4uxh{H9coJy*hC@oYL-W8d$GF!xYMx4E`u!OWWEcnKeZ!#z~8#Ab_N?L?` zm6oi`+a|(1X}Pzg<=mUomX)~Q2Wb3A<*Iocv`2xvncFEpRRa4i3WW9MMK`B%!KpCc>`QB(1mvMzId1;Cc02Uk@1%*ek zIE*!sET8BGAQIv{)E2|;z|IC4W0b+H0Ljum)0hjlZSzR^tmz0W51)^V)gEvtF<3_e zjc7LEYl(kfUEhjv_(1P}(}!Gc)TdR?YRpr7Q5ki;I-b+zGxq%<$6d;KaJ9pq;wJz? zWsWUaYSp9>hufjaPp|^26iD5B2$SM#u+_hyiMgg1rg;bGKbfCe51*euc43|v>R*V{pFXGkzY(#({|(G6KT%v wQ)3#Vo+4c1^#+G*fQvMAu?0|QXE(pQ&e!*<`?+S9xj$RzcNWW?y0*za0juoL)&Kwi literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/label-003.js b/js/src/jsapi-tests/binast/parser/tester/label-003.js new file mode 100644 index 000000000000..934732949857 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/label-003.js @@ -0,0 +1,15 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +// The colon for a labeled statement may be on a separate line. +var x; +label +: { + x = 1; + break label; + x = 2; +} +assertEq(x, 1); +reportCompare(0, 0, 'ok'); diff --git a/js/src/jsapi-tests/binast/parser/tester/lexical-001.binjs b/js/src/jsapi-tests/binast/parser/tester/lexical-001.binjs new file mode 100644 index 0000000000000000000000000000000000000000..3b0f7fec00d51c7baadcbf3f817400234fbfa6ed GIT binary patch literal 6153 zcmds5O>Yx15Z&_qAtWTE9ysl>fKXbA6QmI&4Qi_>t=P~jag+~dr)mBQ{|pHU zi5tIwD`T&B?ZlhZX}1yO6m4ujduHC78N13yLyBwFK1N~fki|WQ2Hq{t^N!hHumB~dty^%HQ` zF2ahLgd(9wBEoY3bNjszN1U7x%p_cd2KvwmXC&&??!z`gv(ec*Xjd!hziLH+m{@_F z-y$3{L?zrAq9Y4WxPanw(na+3=H`}-nPFF?*Q#pE+pz2mF?+gsgiCt!J7BNSn@7!0 zL0R6s3rF7%w!XZv9kY5r{#u|Vk|6eH22BK6il`B9t6l+nL#yW`kAsCu)#CQiMe1U}u)y3mXl0wrRj1f^AGsri)kccts#I3kz+a$BdH;}ib@H#}AO|)H}$T5(% zAq_+7r1*q;jP&|CbE;G%fL`g1Oeb9fq=O^MPSL_ZUmKY7zJL`Dr&}P^963$(`DejK z|9)z}2VMh_k7$9gOpZ9_Bmwsk5sJh4kyu@c{0*nE1T-6yavBbiqwskb4@EO%+kOdG zJ_E#d?B}39@3VMZfSnWYe{4Mjp`hO2Zh8DXL`hOIKRaxq>x*ovY1}>a`X~x1bg5ZK zZL**)X3Q*F*oprDCR=3IbwERjN#HV7x(he|09Cygi8`hMmMJ9Ln&GBR4tdoz-^?@- zWme!j!avaEYa22JNdbL^Vav~s>F)uoee!4?UsdAEcC&s{{hAInuVvy)>Gv*5b_fGW zG{K52zH9mQCc`y>8i;rM4T?qymT?}!wQVr}>Sr!>2&!b9?M@SAX}bRbP%8|Ytv7`3 zOO%Bf#tYjQw9PxQDP19t`1mVO!W%Nt4Dw0Fi>ZryIk9v=5klZ`sv4UZ8AIp(E>;3y z=hn?aOmWV5)DZ4W)ziW}eYe128(t1{BQH074)Y}KjJ6pY7NjSe-8K6*cfTZ8+jy*3 z%BPUBZXO~g;s(_~iD{8KvotJ#%Y;ae%aX>qm%oOq#?63qEFdqz`3LoVc)9Yo{Rof! z1F7nFe%hmFf65sfFAQF)D4GOx+)~iO-+<;4cC!JCnC+nd3-VqOs^f8mI13CfLUcH% zYkTPkHSZ=hr}CT8(xP9gv@KUP9Lx~%=T7e|$|%zavtJQ4DgA~U*L22R(8i>%&hH`0 z^3_>o;lli)#tLrgYNR;f8IabSrW%{WUNu_88DnUc0|sVdKVqp-+v{qexR9#B3*M4s IO1JvLzmr7AiU0rr literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/lexical-001.js b/js/src/jsapi-tests/binast/parser/tester/lexical-001.js new file mode 100644 index 000000000000..3dbd61d997c0 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/lexical-001.js @@ -0,0 +1,52 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + File Name: lexical-001.js + CorrespondsTo: ecma/LexicalConventions/7.2.js + ECMA Section: 7.2 Line Terminators + Description: - readability + - separate tokens + - may occur between any two tokens + - cannot occur within any token, not even a string + - affect the process of automatic semicolon insertion. + + white space characters are: + unicode name formal name string representation + \u000A line feed \n + \u000D carriage return \r + + this test uses onerror to capture line numbers. because + we use on error, we can only have one test case per file. + + Author: christine@netscape.com + Date: 11 september 1997 +*/ +var SECTION = "lexical-001"; +var VERSION = "JS1_4"; +var TITLE = "Line Terminators"; + +startTest(); +writeHeaderToLog( SECTION + " "+ TITLE); + +var result = "Failed"; +var exception = "No exception thrown"; +var expect = "Passed"; + +try { + result = eval("\r\n\expect"); +} catch ( e ) { + exception = e.toString(); +} + +new TestCase( + SECTION, + "OBJECT = new Object; result = new OBJECT()" + + " (threw " + exception +")", + expect, + result ); + +test(); diff --git a/js/src/jsapi-tests/binast/parser/tester/lexical-002.binjs b/js/src/jsapi-tests/binast/parser/tester/lexical-002.binjs new file mode 100644 index 0000000000000000000000000000000000000000..a35cb02ca93d0ee66155349dd2938b502f697d9f GIT binary patch literal 6134 zcmds5O>Yx15ZzL~5fTy-NSvaciV#XcoKPB-ra?^=g^Gk;k(+fBQ)f5wI!*Ie_-9B+ zNZj}ZTp4@4YbSP6r`<-tDcab6_RPFDGj@fKh7?yTeT>5DA&Ywq4T2j%5FE$hB-m}V z4%%?*K3`|hgPMm{;QM~h>6vf z^P7ZYhNy%)Lv&=}2^Ua&PP&M`+}e6=V`kW8>9va5avhePA!biEk8nwEego_kdh@9M zv0aomZ^6+I+OIypu^qE|KmJ^uABEkWMyFY~?KTPF$;n56)+7-wbub%{2=SODHt-c3 zT0b8$oFt&`Hb)!}Ky{LFIRD=%&l;jsFO@4mHWX`7nZ|mE`5qXWaKv~ACwzg03f4r| z=eUXqB26k25bKSEBNC_S9>$2MjTz*deMrQZb>e2+vu%=DZJID2aNRkI&-R2B!FJ%jZ7z91Ehx|icZnOz>+pF=e>g!9;aI%)f_oZ_4%h` zqrX43-v+ON$Vb#6ER!RiIZ431M}*>Vek4{`B7ebYECJ2Nq?m?7HDf>2OzaJM*q9-<^En4cXs(e*_()imy&27MHT6uQ)` zqc&NvD`w0rTG)wy2PRu&)^$KbiAmrxRl1#k}dXwRrKsCg>{TfB11j{%N;o3HsfAuq$dIVK6&UUAXvNYX)1E>`S&DMW} z?n{(~8O96S7qrcLu_;|4kNEftP$C#I(G2oQ#*3+odoi)}KoLUVajF`d7#Tz7{w`Jm zVCUA&LQHYac+?Q?Ox4rGJbkyoVGCXkbR#b}eFpO+?Toe=8y2J|o82}0Hg~@yS6g_j zSIVc5qHZ1{CgKKFLy2jTI)l6YLQ0bMlq5c>s5&V}lET%kmV;VwjvbNcp@o>23yO>@e; z87-~wrRvynCBnlDp>^){sG^KAjWC-NQGn8KxL!@C*9ARG`oz2gQI=24D&;zpi5hcU x%hiZGyBUzy1Ew0A!(KJ&;*2pg%K-y3v0tpzsO@z%;I5i#@PdaUnZK \n + \u000D carriage return \r + + this test uses onerror to capture line numbers. because + we use on error, we can only have one test case per file. + + Author: christine@netscape.com + Date: 11 september 1997 +*/ +var SECTION = "lexical-002"; +var VERSION = "JS1_4"; +var TITLE = "Line Terminators"; + +startTest(); +writeHeaderToLog( SECTION + " "+ TITLE); + +var result = "Failed"; +var exception = "No exception thrown"; +var expect = "Passed"; + +try { + result = eval("\r\n\expect"); +} catch ( e ) { + exception = e.toString(); +} + +new TestCase( + SECTION, + "result=eval(\"\r\nexpect\")" + + " (threw " + exception +")", + expect, + result ); + +test(); diff --git a/js/src/jsapi-tests/binast/parser/tester/lexical-003.binjs b/js/src/jsapi-tests/binast/parser/tester/lexical-003.binjs new file mode 100644 index 0000000000000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*^{_W?7#MNHcn?Rs#KMBKR_C~g2|^wd6A&9r zgd?It(=Cj71XxoBI`eHWtStg1>_p!7bKJ76YelF z7%Ig~BuD^ls*UszTmqzpBdV5WVW6uF%y?hG3X9W~q-cg5OMLcOu+jCG^gG}+Nb(6S zNGzQrmRcm>-XlV>zc>hd8A zrv=y<0sqIALl6q;4enRR&qEYN74x&lW~#o(W}1fmQ)h?*pF($JAn-Jy3jb3oGbGYlJ6Sc;1%ozO+Q!GuzG$K`B- z-?i*I+KPx{nbyYOkODg|DMlQC{#I>5IihtrBsco?m{9a;!f8<5jJBY4SNkjB}&Swq_MtTT*Bq& z-+;6%x(~tmxuR=^N@tlRu86(+40>8Tbxpt``dTFU5^*a+wLGrKy62Uh)3&R%FuAM- zE@*}HXsOIzseY|i8Z68ZInJ$~ca}7AqVUAh3>Uq5SuN@B;z#bc5M}wu9hJNuCu0Q< y1j$ITs%enM6KXQHfW66R5offa{3Tw)jLf&QWYqL}GEiJClfflVSW>r*hWQU8EbS=( literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/lexical-004.js b/js/src/jsapi-tests/binast/parser/tester/lexical-004.js new file mode 100644 index 000000000000..853887db3ef5 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/lexical-004.js @@ -0,0 +1,52 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/lexical-005.binjs b/js/src/jsapi-tests/binast/parser/tester/lexical-005.binjs new file mode 100644 index 0000000000000000000000000000000000000000..880e4d9736188b7a93f1ba122d14c82bf32ae595 GIT binary patch literal 6258 zcmds5O>Yx15Z&^P00{|+1E(B86-tpnNU)8dX;4$5P?4wyF38Qg$x>%GvYn*~L4?XV=%<|3Uhlqygh~Qn^BZwj%#*u^y^f&WP!YG)<`UyB2 z%dlc9p~AomqmX9+=Jw41M?5?ZF_mx;8tOwcPQ$2Qy9wKL8uf1TL))*a|NN=~F|j&w zekyb8-s5w)kAM_ALF-vRp)y?NO9 z*eT1K*Wu{KmNEpKMK3M&2Fn<+ieoUk(0Lo?LD4OVj3_T@Ene8oQ)`E z46?ez5ywNwHpw)c{a=`tbwr3>Dpx?d5Ui8QG}0l7Z-ar1Bg(s&@dXwtSQA~J<2)t^ zc~mAK+8+x?utL)vjJXe36AC)B2Lg;~H*Up!+a{?V-yp56%-#tjM5o#=PiPCsHOMbW zCc($tqhWub6;nx&0NT_WnNGR@NC!uhEzQEfiZ(FgeE};RPPZUMGvq|#v(JK!{(ecn z0bYY7ACrQ_GCAU?MFQ>}3JDJ8N8<8I<1aXkl|cEJl+$PkjlyR=JQ7WiZTlLod;o~; zxRQZZ_<+Wf0_=={|6|J`2nF>9_sZkv0b;CVes<|p*B9ALlel-{4Nw#i=uXp4+GN3w zn2}qwumgVyOt#3Z>wtz5lfY%FbQf-(E74`vw`*c|=$-8xko5cn!5Zu9P5Cs< zr5VmSgvNpY4k+S^#N$L}G~v>aF8xgks~LIoodmEm>+(?Z)@a3PVV*pn;Ghi;82Vlz zH+=-yVs847katINviz>;x4HY8Ty5itUMW?htc#F{iMY_!5yN&&q+u^Ws6;(kl{C&* ziwn5<{2P#t756SU->kTHoJ@*2f{MUb9z!>aClwp8h`SCMzC_uIP#upeQtnA<=XC97 z9ZX(S0O#~UX0&u#uT;ENs|yZhhy>?O4?9b`I8k*HU4|>(tfnq#?vm&2HxOm{yv-K8 z8>_K`rvWumENKR$^?0hr=CD_d7IDTH%3t3NOlH5DsZrbOYM{7Os=+0XS5maCZuvK! CaO&d# literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/lexical-005.js b/js/src/jsapi-tests/binast/parser/tester/lexical-005.js new file mode 100644 index 000000000000..2f3d3bdd8226 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/lexical-005.js @@ -0,0 +1,52 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/lexical-006.binjs b/js/src/jsapi-tests/binast/parser/tester/lexical-006.binjs new file mode 100644 index 0000000000000000000000000000000000000000..2d07274734b8b6123e3a9f62d8973e7280ee23ec GIT binary patch literal 6274 zcmds5OK%e~5Z>}eT#$GiIOW)?LMamB0BL}xK~0I$ibTC4C+j9lo!!WGn&ww<=byoa zGyj6I*SmJso5V@C<#CEOwm*AjzWHYC3LlRMu2u#Z`PE|@^(h*9H$2blM*h^>YqSpA zuiL$7guO~x&Z&@q@#@#7p7#J|Rm|llhz6)j@ILMlL=g|7P(u0on|WtJ=+9#P1e}d! zSP_*_f$s%jz*7Ko`-YE09-Ic4O1KaW^`RN3LD;X}g>BmPTBmW;s+84#m9hdcvD$Ke zGvJsaBH_*v8C!V51q5FNJw%@G?7Xru6YR3|T19Pn6PBGLYEL(hu%NXopc3|4vr{VnuUQSZD7j#99B4-Zb6Es$g#wypE(=-{gQqM zyaq`=COL^^a>P-K1l$J{5bV#7#PyZNUvL^LfwD0vrqK`@g)e$|B$^=G_BCAj2oPIQ zDFrR@0gWa(*eL=3$Cg773hE8+701tG#8|=n?9i#MFS3~?QSZzfpwK7KohF^M$$~vG zBeQ5>2mThAY>`>l0SzT4fy-3s&fPpyqKm9=x5VzyJKH%R>Dh&0%L+$vc>-&@6r;1! zZYji*(oy#d@M3f8jlGxBm^3w%=hfdcaWHN?;$ZO&=m4?(fC73QOi5h0k=`5sg%%u+XNCwrm(?nUBQQOcuh|tg6>DFY_d*~DUq3Db>z$&fD zuC~pz$-y(O70eL|GACDTl8`6A<|(zwD`nxI^Vtg3DkBwwhYPy-{m6{JAXg-l)EiOJ zqw;BzOEa8v2#o{(9Z5SUHTgrSTpkGdkJ8t)@7mQtFO1cf0$6<#|U!rh%sE)@Kskc?w zIbHi(2a^{S!a4nr87-aOD;2TT>VtzBBGI|iL(h_KPE?;*pW(_ktE~%~y!g5M9Yk3^ zce4fW$Z9O-sX&e7OPc{{J*KL$IqX%Vd7LqZve$V7li9CmYSi|+8pto1YH-P8mK1NR GYyJ(pr|+}? literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/lexical-006.js b/js/src/jsapi-tests/binast/parser/tester/lexical-006.js new file mode 100644 index 000000000000..b37fe0d529a9 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/lexical-006.js @@ -0,0 +1,58 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/lexical-007.binjs b/js/src/jsapi-tests/binast/parser/tester/lexical-007.binjs new file mode 100644 index 0000000000000000000000000000000000000000..a4f7be41d0ad81167a683f7eb09ff0c1be45fce2 GIT binary patch literal 6258 zcmds5O>Yx15Z&^P00{|+1E(B86-tpnNU)8dX;4$5P?4wyF38Qg$x>%GvYn*~L4?XV=%<|3Uhlqygh~Qn^BZwj%#*u^y^f&WP!YG)<`UyB2 z%dlc9p~AomqmX9+=Jw41M?5?ZF_mx;8tOwcPQ$2Qy9wKL8uf1TL))*a|NN=~F|j&w zekyb8-s5w)kAM_ALF-vRp)y?NO9 z*eT1K*Wu{KmNEpKMK3M&2Fn<+ieoUk(0Lo?LD4OVj3_T@Ene8oQ)`E z46?ez5ywNwHpw)c{a=`tbwr3>Dpx?d5Ui8QG}0l7Z-ar1Bg(s&@dXwtSQA~J<2)t^ zc~mAK+8+x?utL)vjJXe36AC)B2Lg;~H*Up!+a{?V-yp56%-#tjM5o#=PiPCsHOMbW zCc($tqhWub6;nx&0NT_WnNGR@NC!uhEzQEfiZ(FgeE};RPPZUMGvq|#v(JK!{(ecn z0bYY7ACrQ_GCAU?MFQ>}3JDJ8N8<8I<1aXkl|cEJl+$PkjlyR=JQ7WiZTlLod;o~; zxRQZZ_<+Wf0_=={|6|J`2nF>9_sZkv0b;CVes<|p*B9ALlel-{4Nw#i=uXp4+GN3w zn2}qwumgVyOt#3Z>wtz5lfY%FbQf-(E74`vw`*c|=$-8xko5cn!5Zu9P5Cs< zr5VmSgvNpY4k+S^#N$L}G~v>aF8xgks~LIoodmEm>+(?Z)@a3PVV*pn;Ghi;82Vlz zH+=-yVs847katINviz>;x4HY8Ty5itUMW?htc#F{iMY_!5yN&&q+u^Ws6;(kl{C&* ziwn5<{2P#t756SU->kTHoJ@*2f{MUb9z!>aClwp8h`SCMzC_uIP#upeQtnA<=XC97 z9ZX(S0O#~UX0&u#uT;ENs|yZhhy>?O4?9b`I8k*HU4|>(tfnq#?vm&2HxOm{yv-K8 z8>_K`rvWumENKR$^?0hr=CD_d7IDTH%3t3NOlH5DsZrbOYM{7Os=+0XS5maCZuvK! C5bEOq literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/lexical-007.js b/js/src/jsapi-tests/binast/parser/tester/lexical-007.js new file mode 100644 index 000000000000..255a8b859fb1 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/lexical-007.js @@ -0,0 +1,51 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/lexical-008.binjs b/js/src/jsapi-tests/binast/parser/tester/lexical-008.binjs new file mode 100644 index 0000000000000000000000000000000000000000..ac103a3ae5603a82d77f9e95301a3f3687c9ab72 GIT binary patch literal 6272 zcmds5&2AGh5Z>~SKnMxJfzuvA6{JWNLa>dXX{x4*Le)e?oRFI}$+pgJWIIjs5WE0y z#+3`=Ef_oAwG(d=Cv3~lDcacn?3wxIo3R5v=o4HHx)_D!1DbRw>Umc@&pS@Sk+)rI z>^EOG+esgLK}pUDNW^&g%OlUb1G55i`4OTKIwp7rw+W(%M@cN9LjBFW(^u81?j_8K+U)Dc^)`n$=3H_P!C6)PF%qftXlL zIlmrpOc9ZAXNU|eynBF0@Ojim^(w49L)4ybo?=CZego`F zbm&p_uvwHtufx&zn=d|X+K#z=KmNEpKMK2BwN|}q+ieoUk(LhuZFj&26#IvmVS0u` z|3gB z#fXlyU7ipckZ+J8KiOZ{#KjAc10!_!Hn8rhB6h3d` zzG#YU+gEVq13+vfeg^9EE=`6x*ck!;$NobQ3hE7R7st;7#8|=nY|)XfFS5BNN&D36 zqBtbbt)`u|$%1V$V`|adj{GGs*&?&90~$(90+*@MoxAx|i7v9fT@$-QFKy?5q~}K% zwybazm%FgGjTrW~d`<`WjlG4EmMkNb!`0st?l&$z;ymMv&>mtt5e2eU!GhFtYuN=N z#WjH{h_|~Hf(8uBQrw4&QE&F;%3SJDhGZ;lJ57|OiL?$KgNXRV)ow*1y@U3!6N`pO z11!^#Y-!s}n;bmjTDTmcAYpPfCJlM|Yo1b@yj1f2IiD?2q^1-?@NiBOzmu5p7vxHg zPr#pEpNiI$kJ4P4;G9Ef9Qf~matjW`ld;NZ!lfZy_&ctvX5`Ih6Tr@_n}(XTMk`Jo z^YLp64jb^Ep|2Hk)5m}<=BAGd)9x6bYXje={3$z+%#rii=$1bSIK^liXA>N+I&0%6NT zbv&-fxTl4k)3uv*FnM16o6!cD(b8GHRP9=>EI61U@|!z7>nv#EM9~?`GFC3x;$?P{XHEMfZ4dho! OHMrpEN@}*%EdK&c74Pl< literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/lexical-008.js b/js/src/jsapi-tests/binast/parser/tester/lexical-008.js new file mode 100644 index 000000000000..b24b85875856 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/lexical-008.js @@ -0,0 +1,53 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/lexical-009.binjs b/js/src/jsapi-tests/binast/parser/tester/lexical-009.bin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8 ztqRrix-#n?uI!$&a80W=wkc>97Gv1Q*TEzo_Ua4j^3(|Q|)oW9tSFcvZjI~rA;w?<>zMbh+ U*Xnwqx?1YRIZs%Mx1EOh59WySkpKVy literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/lexical-009.js b/js/src/jsapi-tests/binast/parser/tester/lexical-009.js new file mode 100644 index 000000000000..d5dc0ed44303 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/lexical-009.js @@ -0,0 +1,53 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/lexical-011.binjs b/js/src/jsapi-tests/binast/parser/tester/lexical-011.binjs new file mode 100644 index 0000000000000000000000000000000000000000..717f1822c139d32948285e3eb11cf43730c64219 GIT binary patch literal 8799 zcmeHNO>f&a7*_T@>;nUeU4|XB+lFGzf^8Vkx&ao)MO_455qll5%fLvq%~qB?l8Tdm z&|}a0XFKgU>|gACDN3Y8$)+7QYlj?ViVyjIJ$(4e9huJ)df1s#5+6S1*@Tl>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UE&pEjq|{swwM@4zJD5 z1rIZ@z_E+o?&30dYcA&~X$oG3E8a4vt`K*{e-BJV_$_rG7QDF*-m literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/lexical-011.js b/js/src/jsapi-tests/binast/parser/tester/lexical-011.js new file mode 100644 index 000000000000..b6703284269d --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/lexical-011.js @@ -0,0 +1,62 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/lexical-012.binjs b/js/src/jsapi-tests/binast/parser/tester/lexical-012.binjs new file mode 100644 index 0000000000000000000000000000000000000000..7f55206ac98ead7d1b534cc3b8097ba0cc857150 GIT binary patch literal 6271 zcmds5&2AGh5Z>~S00{}ffzuvA6$(WlBuFD@nyRUyP&HAJxF9#{CQF^&$ab3M9e4uX zj1x!1TQK%|*G{}ioOD}$PSM8pXV1(x-;7=6!vVpSau1`RvQOhKMSbsz=XpnQF!r|U z&Arx}Rwo`{uUwLI$|PjG^7WDD-GNzUbNL~nAvz*>8+Qnzh=*|`p#uHQypu2rCb511 z&e|fZm`bQH@WLqM8GyNcJ-`tUk3&o)T!i}i(2UbC>Q-*THmzE`V0K zVeOz*lsB)#(f3*#pI_RJxqLtVygWY&yW914qh{M}62g&_4*_jw$cGgB2bf`ciUa>+ zOao@4pTn!QvjN47L5jCH;0$nH0<`Yd@4N>KEMW>by^tcYXdXh=di-zbaV1G zLr(NQ`^?$s@7MPm;5A6{A<0QBlOvA8B;a;XNN_Ma5|>vef5B<21e%UXF(;XC zLyBtxRmF*_1PvLMwRiy6qW*d8zFCb3R+5N=-?G;NhGuemgefFUS=i zeF1-Z11fq`K2CFKf^!a`ap1oL$}Kn$j}w{EgiAxZ@HZ)}X5`IB6Tr@_n}(XTMk`JO z^W-fB2Tgd*(Dw?t>0`habJJIaX?G+io8C43Hg{iUdm{a!(68r)xj!VDh{IIHM0Tqovb&sp7R(6GF8nwNy2J%a# O8eH&rB}LonmVW~iRPU+) literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/lexical-012.js b/js/src/jsapi-tests/binast/parser/tester/lexical-012.js new file mode 100644 index 000000000000..bed3322dde22 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/lexical-012.js @@ -0,0 +1,53 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/lexical-013.binjs b/js/src/jsapi-tests/binast/parser/tester/lexical-013.binjs new file mode 100644 index 0000000000000000000000000000000000000000..ce63ba5c86efc04e7eecdf0b94e8ade1d1412285 GIT binary patch literal 6275 zcmds5O>Yx15Z&^PkN^q6fzuvA6$%wd2uLGnnyRUyP&HAxAR#yFCQF^&$o4kPzu?S2 ze=N-kt$lIzn z_gZgSop^w~a!Jl9laTSs*GHar2WFMc<%fud=!oEL+#!e}9>$S`3iLPgPQoY{$NB*{ zYxA&TDxt!_3!{+d0Ot1f07pDL4l$K*5$fwhGfu;(Te%6_v})CM{X?@{Qva1p3dF=} z$@z_tV~U7`J4Gb1@PrEpJ_|dDJbS+J!p6+7OVVp)wdGYOm*~yI z+Cgho-nhHk0mY0#inlo8xDTl(X@~Rw3v;xJ2+>RB3dkLTb!M3sJ7n~2u$FN|c^fl6 z!$JjXqU&><#{{93$^=BaiEsofG~L0N`+zm1AUeCC#+bI_M%=Y+l2Y;wa@7K45ge9S!>c6(Yrl^zM8b-j`4qziy_aKx&0S{UeS19RRNu)^VVGx9Y@ zPW3+jEZFGp*Y_LXHAwP=6eO0(5l3MXa62d@IG7%Z%d3;W;51eOO~zz3U5C&peAdAO z(Gl6UFX74ufY^-v9MtDM8V?Jwa{~U4{f8hF)EnGc9Y6OGV=Lxon~rpSk)1V(J11Tb zMFD|UHEXL)7Ho+b6N_fH{7s+J1i!U+QRh4Q)jdn^LR#YY?|y$J0hwjEO7TMdlJoVS)= zATnGNsET-}S0yN6SXSc!T#WkDFIVPLhe{;FY1?U{EX<{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Eu4yQkBJbC>VNzE9PtaIv`{ylqK*ruB#jej9X4GGHdcB+ydFyLO$-<`Hr;S3#{CtB zx0QJx!d&PA3lZK6C7;u~?i$;vJ={>C{vHx>1eeH2_P~TPZhJ<->lCpwuZ!1>ZbIgQ zs@_NrZR%NjtJ|LHA)Ik*)V0$_**KGK0ykiiE?p+KyffT~e%&O+4wV7eq(yYk*k;@0 z;ThkP%M+@NWGZ&m+p~9ROg7c80=D{|_22nygHvj=>;85v1&`2pRHr zxO!+?p9`&MN8b0Y*fz&7&M}q6w=EhE;Ommr>~y%FnQGh*rJ1Mr<$_f=I!jJ{P*AmL|Og!K&<$vug4lb)#wq-Y?sn3 zNaxG89&5>7J=&BrdIvvnrIjt3IR_&vVwN$+wpoege!u=|$N8Kpuf##!E53cz* KsSW{0eg6w)dnnof literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/lexical-016.js b/js/src/jsapi-tests/binast/parser/tester/lexical-016.js new file mode 100644 index 000000000000..419af22c0e99 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/lexical-016.js @@ -0,0 +1,62 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/lexical-017.binjs b/js/src/jsapi-tests/binast/parser/tester/lexical-017.binjs new file mode 100644 index 0000000000000000000000000000000000000000..a1e0e6e591981f371c016327a719040ea662e56b GIT binary patch literal 6265 zcmds5&2AGh5Z?0tb3sCI;Iv0jg+dV$5~L9{P1RIUsG6ufA~)+MOP$@wcADk|cnIE% z6Gy~bF!p-aPP|E+bQ^w7(Z=>?&&)U9j9uo#0l}4W52K)RNaHR=eeZ_nd8ctO_IB#c zgVwuNCmvw0T#|FjBxJnu^{MAQgjr>C`7xp)Iwg1)cL<`0hjApK0{zXr^Dqh~v3>x~ z#v-hkN~kdK!YJe!fVq7=z!4A6LQExGg!=l>jMFgcR_?+!ty;BR|I{p()PLoY0x_{# za(*M^m?9$KE)W@7c)|q)Uxpn-UcTCTYh$L^CF!-Y+VUnWyFk>QZXRJpZ+-{tHG1>7 zcGN1$o44WU2d%BoZ*0e`-;Y1n=SN|8yWVcpY`aZDICAm{pzRI$kYfJ`GfXdV;Ge`a zU^e;{yjr^)P|O&lc#9*B`;dB)b~yV#H%F_85WQ5cfZQQiXO?NPLq^{RYZ*tBw=v^$ zEL5;2x<1EMOb}YBOhB|d6pmoIraKt(2(U&JL}wq=7}Iv#h`Y8;QcAu-j$3KI6Gn)R zwOyVN8qjXgV$e^5&$vg!Zcodn(jx)1sW&p6bPbRWjwo8Eg@L{{Fynm=D;!QYCtow< zMDMfDoQ?i|eZK=5}PGcp|bWDorI)p~y%MKoh zj>xus1y?=>#AfVgpg!->c$9;k5%7QPKLnwm-r!Dg{5(XA70k~z9qalcJ8Kem&b=Or z0s^gS+E$w^*by_P7R_zP-vE;>GV3~^p~NI`nJV46n@^SKBJ0~Nu{$)DUfVDyFZ~L4M@q2p%B`jG!D0i#BC!BBGdBkawJJ3F2yCDUt)!_W8-!`(lLyBtx zRT1y>sss%gmW6l#ccT96dzHD=p$N%H+IE^KOVel*`UMg1iCf)@H2Mh5VK)-(kOo+$ zAKBKnnKn6i#g291Ij%(5RVg$(S%Dwy6`uts%GTP7ZbqFteb|KwMHvW1M}n| z1qV%d%Fvezx#=^&7IV`lg=u#rC!5|i{Wf=Bk*iHS(krEE6m<&{F%h@9Dq`4!Q^?>Z$=YjMoZ`PQk84DqTpbL$ZqcRq_d!f6D21RWw_i;3hJEBE_vnt z08y5&+-%PCu^P*H6i_4idS*acZ>VZ)27A?L9%qc9>5IF8$?W$sHEMfZ4dmBJHMro} KN-DP1D*py;ne93N literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/lexical-017.js b/js/src/jsapi-tests/binast/parser/tester/lexical-017.js new file mode 100644 index 000000000000..d7d33b4f0182 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/lexical-017.js @@ -0,0 +1,54 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/lexical-018.binjs b/js/src/jsapi-tests/binast/parser/tester/lexical-018.binjs new file mode 100644 index 0000000000000000000000000000000000000000..8d7deb8b9cf35de802a770077a28cf6eb5c561f6 GIT binary patch literal 6275 zcmds5OK%e~5Z>}eNPvXkz-f=53WZ8YywV7orfRAvR83SaNXX5)$x>%Gvb|07FF5nh zIB`V$3&vjW+KD%blcwcyiZ-@CduG1*X6!Og1_W2iJ&c0NK8?E+^}Q>e=N-kt$lIzn z_gZgSop^w~a!Jl9laTSs*GHar2WFMc<%fud=!oEL+#!e}9>$S`3iLPgPQoY{$NB*{ zYxA&TDxt!_3!{+d0Ot1f07pDL4l$K*5$fwhGfu;(Te%6_v})CM{X?@{Qva1p3dF=} z$@z_tV~U7`J4Gb1@PrEpJ_|dDJbS+J%ErvFOVVp)wdGYOm*~yI z+Cgho-nhHk0mY0#inlo8xDTl(X@~Rw3v;xJ2+>RB3dkLTb!M3sJ7n~2u$FN|c^fl6 z!$JjXqU&><#{{93$^=BaiEsofG~L0N`+zm1AUeCC#+bI_M%=Y+l2Y;wa@7K45ge9S!>c6(Yrl^zM8b-j`4qziy_aKx&0S{UeS19RRNu)^VVGx9Y@ zPW3+jEZFGp*Y_LXHAwP=6eO0(5l3MXa62d@IG7%Z%d3;W;51eOO~zz3U5C&peAdAO z(Gl6UFX74ufY^-v9MtDM8V?Jwa{~U4{f8hF)EnGc9Y6OGV=Lxon~rpSk)1V(J11Tb zMFD|UHEXL)7Ho+b6N_fH6a3cRMX5`k6w2r7@39CN7awt?^dhv2*mg*PZ#6I?bKY8h zfyi)8peo{>UX`GPVOfm_a53snzg(G19V(Fwr){T+vM`s{p=l67AG_Ku$))$uA$B9t z6KQ}&nvzXzn`x7SXIyKSBNXIJq0D3<&wkBQYLgerzdz@*1?tp+`37qX=}9N zG%!zJQ*h9P_Y8frkefaRY%w=`SD181da}t~vu|_vCAr$fL%mX}#;UGDA|~QWS49ll zF_DJ71fdcYWl_>NUoI}-?(=UzI@a8~;QaBLYe&i?nIo(Sz5fI{T0Hb^z#{fK~S00{}ffzuvA6$+I=2uLGnnyRUyP&HAJxF9#{CQF^&$ab3M9e4uX zj1x!1TQK%|*G{}ioOD}$PSM8pXV1(x-;7=6!vVpSau1`RvQOhKMSbsz=XpnQF!r|U z&Arx}Rwo`{uUwLI$|PjG^7WDD-GNzUbNL~nAvz*>8+Qnzh=*|`p#uHQypu2rCb511 z&e|fZm`bQH@WLqM8GyNcJ-`tUk3&o)T!i}i(2UbC>Q-*THmzE`V0K zVeOz*lsB)#(f3*#pI_LHxqLtVygWY&yW914qh{M}62g&_4*_jw$cGgB2bf`ciUa>+ zOao@4pTn!QvjN47L5jCH;0$nH0<`Yd@4N>KEMW>by^tcYXdXh=di-zbaV1G zLr(NQ`^?$s@7MPm;5A6{A<0QBlOvA8B;a;XNN_Ma5|>vef5B<21e%UXFU-af8*LC4wPJjb`jeSDX^^uCZw)g%dQV8 zt_f5{ywj@^G-O!T;sIQX`m?WA=2C|`B!g+&X`(F6q;+T+M93#Db}KUJJ@kj&NOVLR zV40R=Q`=_RAi84M@j|dl#H0Em~g=QMZ8 zTlYJNvV7}ia~_e^SkBXc8p)S51JZg)Rbw;Qt48xUV+>7S-wjM=znZC0+v{o|zf`Kh M1&>!!w5@LWH^S8L6951J literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/lexical-019.js b/js/src/jsapi-tests/binast/parser/tester/lexical-019.js new file mode 100644 index 000000000000..0280b77102cb --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/lexical-019.js @@ -0,0 +1,53 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/lexical-020.binjs b/js/src/jsapi-tests/binast/parser/tester/lexical-020.binjs new file mode 100644 index 0000000000000000000000000000000000000000..bd74082c9a61646f63217d75f6546cf7219be058 GIT binary patch literal 6271 zcmds5&2AGh5Z>~S00{}ffzuvA6-q%MBuFD@nyRUyP&HAJxF9#{CQF^&$ab3M9e4uX zj1x!1TQK%|*G{}ioOD}$PSM8pXV1(x-;7=6!vVpSau1`RvQOhKMSbsz=XpnQF!r|U z&Arx}Rwo`{uUwLI$|PjG^7WDD-GNzUbNL~nAvz*>8+Qnzh=*|`p#uHQypu2rCb511 z&e|fZm`bQH@WLqM8GyNcJ-`tUk3&o)T!i}i(2UbC>Q-*THmzE+ zOao@4pTn!QvjN47L5jCH;0$nH0<`Yd@4N>KEMW>by^tcYXdXh=di-zbaV1G zLr(NQ`^?$s@7MPm;5A6{A<0QBlOvA8B;a;XNN_Ma5|>vef5B<21e%UXFo#gHE0*H?T`Z7YG6X@y0z^3 zkm8y^Rm3~JDnUbrWi1}SwWvS)YGp2Us6#TCww)%*(o9;1mO+Gk;$pWVliovr*o{O- zqyd&`Nj9}@rcDl>ajjgAP>?aXB9n$Z{WVXiOaF8oajs~LIo(FCwF>!zV*t5LM7_SvZQgoT3o=*=ih*Ithjf<`DVqn<786I5mW@;e*)bs9{Dz49(Nrwe1Wp%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(3!IHcO$_BZP&IE2O_{~b{7Lbi)EmoPfv zs-bOs&ZVLmdDp9A(;Uq>CsgF0w`e$k4@|nrAQ$}%HjeKWUwNwTXb`d6%hds0=q#74 zp)Pktze;b|wAC>t*kA7wUPExwu=5xa#8!vuxLvHcFSoW&JhYllnwBQ7I{zAEkhy}c>Q-l0 zyJNv2a#-KkLvMC*5xg~5b5t}rEyG25nNnA1yZqk=uOZ6v-v@lfXMHtR^PxtKU}oEl zWXrod*t>vQ8j8uQ4Q3eylQaG Lr%8DRSmOIX<7O#o literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/lexical-021.js b/js/src/jsapi-tests/binast/parser/tester/lexical-021.js new file mode 100644 index 000000000000..a3b4422ccc75 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/lexical-021.js @@ -0,0 +1,62 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/lexical-023.binjs b/js/src/jsapi-tests/binast/parser/tester/lexical-023.binjs new file mode 100644 index 0000000000000000000000000000000000000000..39a9aca701bbc3d9a58b34e8d969317678588c8c GIT binary patch literal 6271 zcmdT|&2AGh5Z?0tBOxRN2TpqgRZyVf0^5i-P1T?fswOJjkehXrZJpi7cADlLcmm!G zj$9CL!PxPxop_TtVH?CL+SvZ=8GrN5j04{95nKv77=@(+nzSkEdRIKpJ5Iu(w^OaZ zZ@g)=k{;)rJe=JwSP$2>ZTFqLpI>gq!?PNTS8x(VAfD&=PNV?EeV{{V!rR|y3JM!1+9C;nKYF3-Iify;a2uEH%1hl=+hhQCDro|3XeH*N098uoH zjNAUpc%xuVbbXG$F+u31G6B(cUpRv0n(koCeZU$}5T1QdWK5e$Eos{}NiF#XL2kwQ zP81_L)OLA7X+Xb0k3mBTKH(mX+8r&SN{|H5y57ii(j`DTIHG8+76$s-z*($tINgkR z&5%cepMB=gZ%Kjw4yITaKZ#XL#uS1KLEa}hfn{>UQJ4hW9*PJKr{Bct66NpJ`B7*T zzG&f|sETacmvH3+K&&Tz2I}(;O$IsG839*TfUKCGkZ*9SIDQ@=#tPfw5 z8i*9v1S%um>XZrUGb}T44;rKH^ybQ3>X3!xRoZr%C=2sw9SR0<;bX1cl04dm>aZP) zdPoB-QjlzE+f17rJmZ?T9HAgyawR6c^7Pj{r8aq?*!y=rTOdbG2!!C_j2eD7G4EfH zD>*&|e|kMCDpNj8V`+?Y4p-yAe+QIXa3G$HL`D-Xz0$eAqqJ(?y!mVb*qL>cP}A0E z#i?OFdQHJ$9o{o^S0Oij4A^3B`lvAJj?u{`cTK;|-IwHQ9S`(MsTxJKLE=tCJ6A>w z+jk-j+XSH!*uz8&`^8L+ V+Fn-!`H4~u&Uv_!l5N$>e*h>D@3H^@ literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/lexical-023.js b/js/src/jsapi-tests/binast/parser/tester/lexical-023.js new file mode 100644 index 000000000000..d5df7ce7d8ad --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/lexical-023.js @@ -0,0 +1,52 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/lexical-024.binjs b/js/src/jsapi-tests/binast/parser/tester/lexical-024.binjs new file mode 100644 index 0000000000000000000000000000000000000000..8f4f5a90348a177c7c5cba6a82810807d58b4897 GIT binary patch literal 6252 zcmds5O>Yx15Z&_qaX~`jz$r&ig#uMi5F%(A)RZVxBq~SbWZlHn*^RtT)BF|w8C*E? zFBp5hYiGULIO(<&PSM8pvuEbbo3U$rI-$5;8)4+vk61WlXzbnaJg*=6b8oNJIqbgf z4#ElcYE?O>MoGl$^CzD75N6fP<;RE-)TekK4=7@YlQ57_zW$E9Qxf=#Sib;gYZX?= zBoy&I5)hsOnA^8}9B^_%Fq3cr8tX$xoRMHyzYE)Rn~h%UQ>Ru{|JAAr#Kh{#`E9~6 zLsY_@Av(42gbOG>Cj&%ZyxiHfF%#^n^jb}Ac@vhMA!biEkFcRPe*pFsdh@vXxm%Vu zZ^O|KyRW`p3qSt6IzI}#d#zr(Sxg8=PTm8wk9a-{nIGAJ7a(Nwe8O-PK~{G;;&=?% zCYgrQ|8vu_fhg5W`P;c;{JboUbC@PtsJvP_%MK;qk9GrS16!;Xn)1;F&S+FN&WEK^6;Jd(N zi_E$XXecoWT&7BQ?&g^iU1oi|C3c72+0Fq;&o3}+S>Y%y4`3~H(Um^K==6=fffAN9 zAC$Y*-wVz+t~uf~@wMjwMf-#S)tYer#BW>abs@nuff|SpMh%Ll5tfB`0@tAN@~f1& z)S(E;NZNLqC~MPb8~Ozi?}dxphBSH)&EYT*?T`joryqH%Z8L3h@QiEOa)g3($yJyn zri zM?8!*MiVXx>B`@@s+y5EA4vc^wJr;_Y>if&Hs>6KD7%DM%Kn26h414Y=5i8O2ngh~{XbxGrVuegM3&%XibSZ;-0 zq~+EQlF2VeL=pAMGw5UStYQP^5!WHTSIAl(s^f7*zCADPoUWa$gULnJZ%GqmMoZ`P zT9s?PqTpbL$ZqcRq_d)h6D21WWw_ie3Ti=T7e8#jgDA^~?Wo|zSdHa83aF8MJu@J! qXHzw{guQAsk2A(l_Tp|}M)rG|8nwNy2J-8q8eH*gB^BFhmHz+`^ywP_ literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/lexical-024.js b/js/src/jsapi-tests/binast/parser/tester/lexical-024.js new file mode 100644 index 000000000000..be1c3a7b9145 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/lexical-024.js @@ -0,0 +1,59 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/lexical-025.binjs b/js/src/jsapi-tests/binast/parser/tester/lexical-025.binjs new file mode 100644 index 0000000000000000000000000000000000000000..aa3e59877d2d36190013e5c81bbe26e6788c4ccc GIT binary patch literal 6248 zcmds5O>Yx15Z&^PxF8{M;FKe%LMatoV5y*KP*b8%k9)2zF8+l27sq$_~*a75YCEDfv}19RRNu)^bX3sN*kP9;A7EZFGpm-JiUHAwOi zEl4bzBc56$;oc!aaWp>?n=6gK;51GG&BmmhMnh^8zUbniY=T_d*Kp+nKx`$I9JC_( zEEyMI=LGy8TMkJms5iJ<9zTx}=Oy#A!zQM_sAifb-LF9(#Sw+>H0z{o7VOIzGm92> z;Jd(Nhs>r97$`XjT&7ER;pQ_Xy3G1^L+%c}vzr5oo}XaYvBFbaWTOLJbmc5zuUvR7 zD|t3(XY0SGTyI@+az`J8hJeNwf{!f{gamHEvB3y@l4W7t3bI0IbrDyf(JkHhFl)w`h4nL9!I; zOBV9%*FL2&d8Nerb3R+4K+ULwB|X@TJUyZt`ut1M}RHoW^V|y z?nqBIyKDAs@4hBiTX<|%D%B|K4kTkD?{YQ7u^SU**bWGlEG4Uw#`{)r1(%+G1JbkD zN=NEq>xRf?mnWW#dF3(muy|Z?0gGtsk=#o}tq9fgxH8+Gly*+vF4n{3MYV5E3uH&j zWb{gPYqgT#VTR0Y;q{!eq=Az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3s^*3kK|q=YDK7?$CcUkq_lJTcCj8NFRFcWS|B@G zCZkuXTdS1>4>M$L3$N##B@LV`IEf^~#cozk7xZ<>qxKt!vU=3!3to%$SiysU9w}Bc s3(|Qq)njwmt4E7CV-4jm?G`3?-^%o;>vcU)TqX73k|!&r*G{AS8<(f&nE(I) literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/lexical-026.js b/js/src/jsapi-tests/binast/parser/tester/lexical-026.js new file mode 100644 index 000000000000..2711de0892b9 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/lexical-026.js @@ -0,0 +1,59 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/lexical-027.binjs b/js/src/jsapi-tests/binast/parser/tester/lexical-027.binjs new file mode 100644 index 0000000000000000000000000000000000000000..a29bed12aad5bc0fb704cec2979e99b70ceab20b GIT binary patch literal 6248 zcmds5O>Yx15Z&^PxF8{M;FKe%LMasz5`+qx1~nxL6$!l}H|r(_XE(B)rui%UGq`Z( zUoiH1*UoyAIO#Tg9HJ<({p^`}^JeUt7>_94s|_#;_l{ZIXJ{B)3xeP@4yVC>vwhTg z+3Ce29Mr06PK^>S_Qnr`;2zAX*~?E5Bj}Xk1KgvCAwl9uL51cw55AHpoW=SHI9toG zVy2)-7?6mF48Y#L8RAHgGlH3di_p*s{XH5)gU%jN6l{$ zff=F-?i|svgC|`;@dfE2`gCXag^QVDSC!Xlddusu>>M$7x_yK-z4;xmH|Wii#>Y-s z-ncS=Kc6%bAFU|cbnZ-!?oKcgeNEO0NQ&zoy08UF5o2`*|-=n%sFIr zM<9WRkZp=-IQzdaE$fIst&J-$I&JDI&tBE+V~u0U!F$Ti3>NG8Q+ zB4DIHFp8-qNCIt}jcg}f0i=f`%9dtnV8s}i@xFi+9;aK7q8V}`@!8LUjsAW~zXe`{ zBp=g)#IiZ!sYMd*9U>Hm^CPjj()bHb<0Mc%Cgn65Qls!i507LMt{i&$!;YJ*JRR%Lhum!RSN zi9>7KWAaLg_vd`JLV?PugXH0Y2L2$n<1fh-pMC*<1|ufhQZY?)X@+wiq4D6q z2Z|I85hn^`2$zO*>3337?a13tB!Hb+mxr3S#wbn;i{#}5hi!PfFjoq-=_A0FbJI73 zygQPU<#$bg+qVwr18F0T*0O1-+=Ti zw$hQh*t#LI+2x5RV_ta-JuIG7T)-mQdL;J}Q7c0AJg&^PC#9X!w~O^Kc~R|~(*oJi zG8w&6-CC_Ac$gt`TX;R^ENS3m!AT?;E_SnWx}dL19<|>=Sq-=6~Km;e9( literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/lexical-027.js b/js/src/jsapi-tests/binast/parser/tester/lexical-027.js new file mode 100644 index 000000000000..0d8ddf079875 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/lexical-027.js @@ -0,0 +1,61 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/lexical-028.binjs b/js/src/jsapi-tests/binast/parser/tester/lexical-028.binjs new file mode 100644 index 0000000000000000000000000000000000000000..c0ef34a00cd7dc9ef0be23f44e5881c58730a81c GIT binary patch literal 6268 zcmds5&2AGh5Z>~SxbP!!;FKe%LIK19m2Ct~gPIbBibTCu?yj3Gb#^1$X_`mi6?ika zaON!-d%bHX-Xu=CEkCDdWBapb=9_QE_W5W?aLw;y6xI%C(xYhLUGqHeI0+}-PP4t= z+3Ezz5PN=A&hbgac$sfA;pYA zR(Ck!cmUZZnTGTK3)8ZW2+>RB3P=}%buyVoIwbL3FpzOXc^5Ojz(NIUqU&>9!~`La z$^=AvBjE^EXu5+j_W^56L1*?rfHCbRt)yq$B-P^^q_vgVJ5h}2MBC*FZ2`Fk`31=& z_=I~j>h-l^DhU!mn|dSDNtXcW;E1xNSr}N+2IjmkV1>i!7Nls7oJxHDS+LRHFX^|y zYmnq4Qjl0CM;x_Czpx)r1JboS^#!BXAmritjkW=L;*dahnsw493wFee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^ldeytIO}k#}G(NS0iuy08C=e5?E$250 z#|%*kcaG@D!V@l__=0p1eYy2|%f?KxE7EI$+VUnWJ4ei(ZXRJxZ+-{tYxL$({d2o4 zZ{CKZAGBW`zp)*2{eJv$eSQ>ncN(2$-L~5#gd->K0oq4A8OJP4Y`{x6vVJjSI7uL@ z+Z=H`fNYaY!`c6ZX<0**>ZNi8qzlD5nM@-clK4Itm~g~+2Pb@ig$mY0*XOv52|^x~ z35fMZ!VyWK=?=y`1gtRwo!JKg#;g-JdZkk_fShw#yUR0&)%V3zA9k zDfbxZ^|fLu2@*h?dLz?GR{-hYh_a36_u zkmMs;kXR;19JNTmeL#fbaDF7NuQdLG(^v_Vk4ZU=hR`T{(Zxg21lhK);mRj~*oyrO z)aQK`j|;Ff0{)LJhaeQx8{93ApNA+(O6F&WO>}*c%`}a>XI>vgA%*TV?W9c>?1~w= zMGHId0GMo%S=Rv#B_@H(ROv3*`^7Pj{r8aq`6#R2OTcK3tbVBfOK`Xx(oADRqich|PKfNIn4Jx0c zxirH$htN3i-vLG3lXyJU8cnz~q)UIN)zyr=`B(zjnRR)nd26)dG%=sPq2RCuuNeAr zAvb*n*kW$_nvi$L^kn&6({FS4HM!ctW4%(UMp?HZ5fgE%tDywjF_DICgHVa0vMOnu z?-y5a{rNW_9n0<`aK2S`?O>Tab3_)=_n$*wi^skVSVUllG+!cbMW~L)6?ylfv~#+4 zwhksQs)BQxAv0P!w^yoQs}%--H!u_X{Y;J8URMLf^->KkdB&2;ZMDq5 E0cuX~00000 literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/lexical-030.js b/js/src/jsapi-tests/binast/parser/tester/lexical-030.js new file mode 100644 index 000000000000..f5fc09620f44 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/lexical-030.js @@ -0,0 +1,59 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/lexical-031.binjs b/js/src/jsapi-tests/binast/parser/tester/lexical-031.binjs new file mode 100644 index 0000000000000000000000000000000000000000..7430834e08b2cc23a5dd02dcfb08977b35171ad8 GIT binary patch literal 6254 zcmds5OK%e~5Z>~BT#%4BaLN%>p->erutd-_s3}pXNK|n{Zq_7Ao!!WGnnwH+{ux|2 z^Dh{Cy=!N^Nt|>W9;awy`?F`}n{USU`FKQd%^zSC)Q)J}r)cP1@jUM&4yN8-vwhfk z(doq_?DYL{{2XE`;UYBDhi06HQNMN*w&^tL-RAqYUseD4RRv;Vb>#e3 z$T3Ak!kr;9w(x`t2tE&ch&*|^yJKUf*j4E@Uu}66mYpGLPdAUSrZ>L>_6EIq-1yKb z%bVBX=!c!1PtR<}Y~GJQHs?oScemMXHEg?0LO62r7NEVu(@9JNW&>Wpk&W{a#f(8# zcR1pB2-zl?hO_?*)3S~T(M#nDNEd>2GMPp?B=K!9ka0wL7c;)VLIrE0>vLSh1R;;g z1VsB|;Rse}x`Q$I0Bb@)XAVGsG3~~!xNqAe)#DqawUya>VT9;Z+vN#u0l5bG1<54% zGxuoNA85r?5+s1O^+u+XE&Wcv66!5%7O(IRv4g-r!z&{5(R8mCVmBo$C4`n`sjFPQ3w&0s`G>+DV%%*b_5y zixzg^&w<+!Nodc4dA7R+C!ckmA^9@~egaa-AaA;mR;>WKFSb%MqW%St?g zd(d$HUCLbQP=#bDZ97erm3g!c4TA{y%uQ}h9=(C?upfzjNCT|Wki62inKn6i#t8F~dE2V0bbqx|R5!bmoV%Uy}G;9}yN>r0oN#lI6xP*Jp zzX9o3Z|{Kfb-lHtWD?8~QiQ$o2s&9jsn~!;%yr1`CAwCG>Udm{aF0tnr)w|kVDh5! zH>V3SqotF2rP8%pRd6svq&IhZ)LGKQiJFtBGF4K8`Ol9Fxp%D(}LY3f!0 literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/lexical-031.js b/js/src/jsapi-tests/binast/parser/tester/lexical-031.js new file mode 100644 index 000000000000..53f0c399c8b5 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/lexical-031.js @@ -0,0 +1,59 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/lexical-032.binjs b/js/src/jsapi-tests/binast/parser/tester/lexical-032.binjs new file mode 100644 index 0000000000000000000000000000000000000000..daa962e4b9521b9b21242cef03fc1ccbd31478cb GIT binary patch literal 6260 zcmds5OK%e~5Z>}e2!w>hfm4p43Wb*tf^7s%gPIbBibTC|KyKDemO8tU?KI7izrjC) z3upcXW3PAZtT&01F6D8GHnu-|X1@7mY@d%u1lRllMnP?##(j#0-UZL|4&z|zZ8zI{ zotK?nJi?w|m2-R&GG6;~*Yj?`EZ3kmjDlILAAqy5 z3@fG*Dh#|Z3V8-#Zr==W#KWTyQwbNLp*}R@G>rPStFTR{QSUb2xBaU6&#x*F6RRWV zw?d97A`VeFT%1DMD6M35!UqPH^4qeZyq#0 zbjtGPWjOj?=kcd!wqwrUkKfPFkHYS5v)gLecAJE7tG<`i1IFGe1U}u)x*orN!&a31}F*$bf;-2ZL(ln z%*ZWT*nz(QCR=3IbwERjN#HV7x(heYmFP0-+a<9(^v-q;NP2#RVap0fak&L+157Z- zm8}Y=WBkhAM2Sn56Uyc4@0kD?R~>PpodZkp2vTi~mCgMg{M-1CBk%m17p%MjURnj=$ zEq=q*=ih*IEV(zq`7#g|B15vt>HMb14a?VPS1 zt%J#nD&U+($c&cG>y@h4YK6hU43Xj7>1k(48z;(6BFu2fn-$ds-Cgp){TiYyAGq0q zmt!?n@Hn7GiZ#uEw4P7Z*c|q%(IU~BT#%4BaLN%>p#bd(mI#^#H6;oaiOLbVSvN6tb|bITG=GJE1{co! z3&vjW+F5TBC*6j}Dcacn?3wxIo3VX99#LHL2N(slBNp`;8hY0}&pU~Nskhf`A9h}K zdeI1bepSx#DT#S)`pEO{!z|xievBAFClv4F9z_gs5`_{f(BH9lM#5kg>nGrBEyIeK zgd%}QLc%iubNgn1LrzW!W)dz$Lw)F&GZOY|w_%%3quyL(XoXmTtM*!=^^^;`Oc1wnPOL^*L=0*by#+em_6M*!kXUv4%i#?=5gawrz~&Y zgrgsJUVPcL9kY2q{@9!!h27m|x7D!iHVNU#$vc4d0Z%6p3t}7a5{_(Kj2Mn%$m$M9 z91kJeB-3#Ae_>kI5v6*mTmk7qu}&t_NQWf83kJp7UtpnvHPQ7sE@Og_M`Z$H z{jqRFTxhz3F%JN1!a!#ZK!7ppMy;rC+a%TF8>F?B*?S~JY^v?@gtmZOgZzSIQhdri zM*0J-m`Z{K(6-*lbkY?-Iyjxix9@4w}P$DB2+nuu4DjM%!lECsCjF&;m@kFnbs!`T0NW?_k=ISWMc1)yUFF~k8F-dH!x%Sy-bbTURMLfby5v3dA5>@ZMDk30r}48R{#J2 literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/lexical-033.js b/js/src/jsapi-tests/binast/parser/tester/lexical-033.js new file mode 100644 index 000000000000..f36daaff80d5 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/lexical-033.js @@ -0,0 +1,59 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/lexical-034.binjs b/js/src/jsapi-tests/binast/parser/tester/lexical-034.binjs new file mode 100644 index 0000000000000000000000000000000000000000..b3278d53d2172070ca4eb24cb0e59065c638ef6c GIT binary patch literal 6255 zcmds5O>Yx15Z&^PxF8{M;FKe%LIF`OXj?(kpr%BjB2mQ+xmhRD|#biwJjz7dG*g0g;fT59h!}Gl3D42P>t;#LxM!1f(rCE_fAO|%wzomoQ-8z z5mQhk@JL8R24HUA3UDaM3BgRkg=nM?%>^UjVCODu(``0-t&bhQp8V(66A%-ttLC?f zzzk6ZcZTT1!jmqb_?+|+eg5LrmW`QW*Ok}&WXqed>mS$;SO&gf;zJL`Drz;833^|tg?6Y8_>o4hdz-tiX6Iu{h zCPy5#NW#5GgyLZFO zvVchZo%}uLeWTBj$BFx%eZ=<&1Fki}fYfmtS-+6tnm`RC`ojiA6OL6T9z!2ATHH&S zOC7S1x=Pzl6J=!{Z9>5yFMO_(Ta!ocpgJ6cvL4a^s}v;L+BVZB2hX_XEk`JbmqLk2 zuRQ%VPpM5_Dfa%J&sNA$If0NoEUDr5BJ=(wxuWB*;7@PNWMwL5X)Mig&f#ht`0s!s z8zd3MBBKeHUg^@`IIWsDZ@!WMc4l23YS9|4IBhKA#}gcM;Q2y#6>8HbfGy{y&j@*U z#3#$|ntq$RugTR8p6ZoKHL7ZZhTR6SyEGgn-(urjm`n!2aEvfC|x9zuZ%j#{LmpmFLV+HR5$w;xH8Iab?X)?Be ly~$`1XN;kI?`~jn`^hXBwY{DU6lcn0aLLP+(rl|({sW9|>G=Qv literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/lexical-034.js b/js/src/jsapi-tests/binast/parser/tester/lexical-034.js new file mode 100644 index 000000000000..b160e3d030a5 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/lexical-034.js @@ -0,0 +1,58 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/lexical-035.binjs b/js/src/jsapi-tests/binast/parser/tester/lexical-035.binjs new file mode 100644 index 0000000000000000000000000000000000000000..b5015535d3c6013bfb084d5cf5c3d7d0f8af230b GIT binary patch literal 6251 zcmds5O>Yx15Z&^PxF8{M;FKe%LIDaF6e?&M)RZVxBBAtn2eWGS@>9eJI-~dy_b6gWkT_CMq50;)R}zKuSU&-0XBAe= z6ch;q5)qLB*xNTl90_txFjH_58k$3M!AR8KzYW`T8uf1TW4l(>|JAA*#K!8V`7I(a zLsY?CAUbyNqzfpXk{+T@pY6SJF;ncS@>)%Ac^#HrAm&cDkFcRPzXSFby?NUB)G5oG zH{s~Vo#&rlx{letAAfAmkJ9dLv)gL8cH4yTN3s~WCx+Ni+Atw@_eHLu=_e=UM@EQd9 zm=*+<%@I#6l5p=4p*UQ86WdFTzu+`Z0OjwboI*ot6rT3*NESh^?HjoA0U);HN(NdH z0~SvTurmVwk0pmB6yzJ+E03Qii1U*9*<~}6UsN$ob(&VvHVY2qjNGE7 z75E-7*&(yZ0|rV?0+;F3UATEJMVFc1ZphuCc6MVx(eo6B9V-Gi=X|zChRVr<_6`vU$9MoiYFVwT3z9Opc)#)JPJ zD6%~gaUwB>aOst<{7sUoee?Dk31DZ|<)Id>F^bc|B6&K&VH+MVOi!UUeFWHYZu*Fj zcSmxv{I2P@z59k-ZR3eqsZ^t^CP?0iZ072S7YMmB>;(vw%q8oR#=EV!g0AP^fGj85 z+WhiFl($}a3}q~yR2D~~4eSx#D`c%G96XOJ37IDTJ%J=OSCU>99^r-7~Jy4t{_27zEE2Y>@sr(ynp6Lbv literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/lexical-035.js b/js/src/jsapi-tests/binast/parser/tester/lexical-035.js new file mode 100644 index 000000000000..c061c60abad9 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/lexical-035.js @@ -0,0 +1,59 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/lexical-036.binjs b/js/src/jsapi-tests/binast/parser/tester/lexical-036.binjs new file mode 100644 index 0000000000000000000000000000000000000000..5836694ee868559f4d00ebb8d6c62420f5e35786 GIT binary patch literal 6256 zcmds5O>Yx15Z&^P;DCh0fm4p43I#;f18gH`8q}01R3xgz3AtG}S?cUYw$n5R{s{jJ zE}Z!njJ@8qv)&|5x-B24Xk+`?GxO%n*ghYR2(I}9jDp%Bjr$Z0y=$K59mm1c+ikWF zI}lmS-!da2+Veufwu4MD6M35!UqPcfh_vZyq&1 zcFOYRO*r~N=f&qO+c8(~#~)YcM`3rj*=;p!yG=qka`FzKy~oo@Oao>EUcix!^AW|2 zK~{G-;&=$zCYgq_{|nQyjtJ39F?B*}Gwc=v3R~32gzn2Kfca zB>04TH0%$wVk!v|K%06a(@B>A>EMX6rCAtQ(FSI`FJOhk=@z7DhMY)z_F1se-!JL6 zz-y4?V^WYU-ce&eDe&XZhx_7U3)DUhuJ7Nnlr$Sw>it_f5}yf>&5G-gCsCjF&;m@kFnbs!`TGNW?_k=jw=IJ0{YwEf6YEPF5w2^UdNC zEz48QlSv;xOfJM}GNbn`XR)p$!T#<24OFO4)H|t>X zqWU+d4KkypvwEf4wOUzlFhk@wcY4-Y(!`0PlgKh$@Ma}-L2s8lZoh#j%g1fD;MG`- z6+8^6kzz$NAg!lUH8zL6YP5(m#!&w9ZeTL|%}kBjURMLfl~N5ZdAgFCZ8gik0onrU A8~^|S literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/lexical-036.js b/js/src/jsapi-tests/binast/parser/tester/lexical-036.js new file mode 100644 index 000000000000..6b0c3e9edc2a --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/lexical-036.js @@ -0,0 +1,59 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/lexical-037.binjs b/js/src/jsapi-tests/binast/parser/tester/lexical-037.binjs new file mode 100644 index 0000000000000000000000000000000000000000..ff6c26bf64799bfc29ef046af0103552d987b619 GIT binary patch literal 6246 zcmds5O>Yx15Z&^PxF8{M;FKe%LZOHQf)GK|pr%BjB2ll%&AN%f*^O+cY5ofT3@)7c z7mU5$wX@zNPPz>rr)XpQ*)#Lz&Db?D8B<)Z4KWJq$1EN&GzzW-L2w#}vtYl~IqJUZ z_Tw=QYE?C-MhO>n{xAsc!K|9S`~)$APANXXeTot#+XU|`{m??Hud99|mybjCG5p$>8N7&Gt-vN7z-aKi3>Xzlr zn{f1_?%wAYu4A_E#~<7CqqMu%>b0A$-8LaSIe7=rKH%9jW+8V0FX71M#h78vA*;Ir z2|R*qQ%u9z|AlGUK$M!LY6YYV#U`0-BR!J%E*QuKVxot+SYn}uwb9KvE@Og}M{NRP zgNbwmFEri5nEQY=WuP;MAi$XQ;&wc6ZBpv-4bs}l?0pg;HZyhwQd>Z-L4H9pDLxYc zBZHw)Of5kYXxD6HJLw7_JseTCG)n_3#=wmC1+4Hm-I5f|kQ0f|J_|Pb`z8Grcny+# zLJJbh=7^^jNx1ijP#i9f#P&+#FF1{pK>3)I(`ZPI!WVr!mQ9dr`v$Ij0EnHql7Uvl zkj2vi?2Lf_W6L241@#8^%j4%U;=E*j_SnqS7u8JDxc@a6q9~-$ou-|%&4PV7Be!U2 z2fhbPcF1h%fPs>ez-7907jB*_(Ph@R8*+E(o!uNz^z6Z~V}+-<$ch17bcIB(U39G~ zSu$u}>%ZqbZ{2a^QIb2)A>s#w0neIn_|$1T*vJT)toYLs;ak};82xd!6cjfpa>3PL3-$-1QRzEoVno#)?x^sKc~ zW0P9zM#v_YC!7p<eY^_a7wf0OklQDnH*&8z8>wk~63p0pSI?% literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/lexical-037.js b/js/src/jsapi-tests/binast/parser/tester/lexical-037.js new file mode 100644 index 000000000000..d42c13170aee --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/lexical-037.js @@ -0,0 +1,59 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/lexical-038.binjs b/js/src/jsapi-tests/binast/parser/tester/lexical-038.binjs new file mode 100644 index 0000000000000000000000000000000000000000..a490d4fc7b2a0a911f741538856a303b4d7405fe GIT binary patch literal 6260 zcmds5O>Yx15Z&^P5C{p01E(B86$%K15Nso88q}01R3z$!19G!&V(RQhUZ-h}{0;sY zTsZSD7<;{IXT3?BbXz`7(Z=?(XXeeDv3))sQC#x}7zMR`7WEk#dY3%UJB)&- zbzXIP(Fl8fRnGA#iFxhoeb2iEvwU;;0b&FlQoMtE6fwj}6iTQ-f5+Z234>XzpMbNm z3@c(1iUb}B3C{q`?VAA(IXNPjNw^RV^`T?VNZ7Akhiy8IdbjzZ?N`-*epP{(SRFaP zML1@NO1Kk5#}=M&0mY}Jhv?%c&tBS?DRxzQ%~xAqhGi#++0)GkI5v6*mTmk7qu}&t_NQWf82?oX-G2X>7UtpnvHPQ7s&SHX) zM`Z$H{jqRFTxhz3F?RuL!a!$sL4YyqMy;rC+a%TF8>F?B+1n&UY^v?@gtmZOgZzSI zQhdZcM*0J-m`Z{K(5BwVbkaFMIyjJ zRN1OH9Bv_u+Um7Ziv+h*G2 z;2GD_

2SQ>Zd&$kSi*l-lH#((ljtY=ttF(+I)C1#SFJWX4~RD?0oF{`5vnG^c!; z=F$x3975y3e+LwCN8(YUGn#N|NSFR5mDP;A`A`DbnRR)nd26)dv@lQJPjJwN7Yu!| zkefaLY%w=|Nyxh+Iaz+!^xNEhO|G`_M6Z;pQPxdJ#6;Za>L|u`Or&8iK&V7PS(P-- zcZ+kl`urP^jwSatIDe+(+JQ1T=7=gHUwH`qES^+sz#{TGr1%nPD?)WVuE@DZrJd8Y zqjfNOQ3agS2$|8+dA(BgTCFfRm?1KpJ3Z|zY2!rMNrV|Ld9$Lrpu0;RxZgmO=$O$U95(L4HoaD}-~P~b>+(OhE^M1-iNVg+Oj!7870JJsRE%%VKL4<3sdqO6Z&w!%UQtD~!PT*U;gkkSN1 zhg0r|xX^S9V;%z5jDpl0g9c;Tk2=xNv`GlaH^^)wxetR7(YdnA;qn5C4GIjZN$@#y zXfPZp(UdC0fp*nKx|6N}(!vo{t1~ySrVPw@U%(2B)2+zT3^`Hx?6Y8_zhBkwfY%_& zr=%dUbdFfc5r=z^0)qYJk=R~!`~{~m5-1;&YI+T>QTWos6W#}zwr}9dM}XLkY8hya zjc7D0z|IKxKXx6QP*88MR~nu3rGjfYo zHsJ@rWP{AA4k#!-30x*icj4x_5?y6|yTx~h_SwtITP!ln4)FfycV^N1Ea1k0W zzf9>%EozVmq-m#)Qkq4(&@S+BFI?p|WYIh54TmA`h7>@VcI1t+O}ELyGqzRB5(=`V zP+-!Kr@#6smC2Tef+qnvQY>d0 rr15Sl$Cj{Hjuvr78_HkXHO$z2Et8|B*X2NQnUsTT9<7968=dlRD1+$Z literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/lexical-039.js b/js/src/jsapi-tests/binast/parser/tester/lexical-039.js new file mode 100644 index 000000000000..01e4407b32ab --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/lexical-039.js @@ -0,0 +1,46 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/lexical-040.binjs b/js/src/jsapi-tests/binast/parser/tester/lexical-040.binjs new file mode 100644 index 0000000000000000000000000000000000000000..fd39cc1f252e5610d90e799b96fe785fa68aa89f GIT binary patch literal 6253 zcmds5&u`N(6wdgKxF8{M;M5~%Lfynp5Gq(#v`$r-XtgVH6R!<(lge?|l|P05j057# zf5Efk#BQ9nPM4J*rz*Am+3&sYeec;Wn@$LBxFd}G#wm@46pfu*j^hj>f9@Q%yC=QZ zJujMI$E}MwE(v1R`1;gw9>FYEUw(#YfCdB~VUHk+SP+E*%2(g9a}k98BGym9*;$7b zQ2`bBP7nqx1JJi``#5C5d4Q>a3(;5|I%YHohmHHNO|RALw?B5>y8O?rOAsBaC+2qo zhAAQf?h=uyfyZ4y@KxX;@^bHB&%{iz>%wcU-10UoyF}ESt{-7TZ+-{tEqe2;^{H2t zH}AsHPkQ^G4@}2w-;Y1G=SOaLzuoV&OuKbLl;EUFh1kTrhA&%J6N=*)61&F`!(&J| zK{lNIUznLqM2K1{RzSuOtnx{>QypH+EXw1D;IWt?%KA8FD=d_-I=VW?bxhz2DNR6h zIOUFr3r)8$<}qN+C`ipQXfUSzs1prMn}mRTgUmLP`!EO*oh!Q>E-#?ipunJ-1fMg9 z2E&mOO{qd0Xjg5dJLv`>EgVs`I&%YS%D{~G1+1_*-HI&DkQ0^9J_|Pb`&IoOcny+# zN(vH7=ZK{oakvjCAlP3XiS1R#UvL^Df$}k_rq|#ag|9q3;eC*4`v$Ij0*KwHmVwsT zh(@yl?2Lf_W7ok61@#7d)$#Kb#c{>_?9;ibFQT6&k$2&YQ0NnAP}62wXTc$#kz2H~ z34aAlHpr~%fP&(az-6*@7jB*_(N)&BJA8L&pUoT)^gM%M!wO4r;W-A4bZs9Eyf-Gk z)Rin9q_^eY3%=JbI{Yxn#pf8sM*#(p&(ld z1ttx7`m3K(nOrLK{+!QBRH&Rha2~Gc;Ey6b{+wLV;0yTEnNZ%BvU!?I3!JkEjRpTL zP#(a6Sd>VNB3v5MwZBPG)g!MzlK^&RT^?%L8l^ZL%#zm=?04b)Lft9Erq2MI&rRPE z^6p4Zmftn~)_32Kt6e-(D}`!QbqV4z;g`84im@3JVc0$h6|W^_Nn?GjxPe>GzX54k zZF!8+YHP+wr&kHU+H>e)@vLS77V*|1yVs~%5vt{JdAhx*?3}iJtcA&|irGC68`T@DnNNjbRY(Mkxm(JB81e@*D! literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/lexical-040.js b/js/src/jsapi-tests/binast/parser/tester/lexical-040.js new file mode 100644 index 000000000000..346345579623 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/lexical-040.js @@ -0,0 +1,46 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/lexical-041.binjs b/js/src/jsapi-tests/binast/parser/tester/lexical-041.binjs new file mode 100644 index 0000000000000000000000000000000000000000..57264e20375fcc7abebb470b315ba9b4ea819bc2 GIT binary patch literal 7088 zcmeHM&2AGh5Z>~S5E2q6IOPbcP^jPpOVlNxbPcfaodOc>UQkp6?satjk72f@^LcBfoY;qaH;A=bGalKlw_J7lF`@xFA@~4$1X09-C=^h>e2$&7AoORkege+c zDy)bKsK9rEFkm@=x_r~eAq!3eOa)ws26EFeqe0lK-G*g4je58Fq3u@F|J-T{qGEN# z`>lXsiim(aM`Wbo-2*&=CxM5^v*#~&bj%F9D!k^VOJ0X*=ZNaBt6Nypo8JL@gWf!D zeC(9v&0DbbM*aQXr@z9HKQ`yco3K>3*=;qJM?`_3lw62)%nJl%V=|;Tj)B=7h8P|I z<3zOK{C^`g>xd9JRm=d&5G)C$M!wvSX<)QWn#O+rDw0JSxC?*}2GQ)!pO^#vpwBp76q;8W(% zpx2kGnaU6c+LjBcM{o&{7LF)ep1FY)X<#1rhN!UE-4d4O$cfD7kA{WhF zoF93X#}f|^c`2dWzJ@Cw0%AL=BCP@2&(3Tsuemc^6{wDw z*RK;aim|xK4xyJYSlo|Lr&`?N_|~v)r;1WIinigx&5wJg8?t5;?Ll?b3wb>u0g7Dc z-$>h3n=CwIo3$*V770vtjCAS%C~ytOh=a)br=T6`gzr8aYGC zD?2vLxHJ=U7Drq<^ zQ|4brGL1E=N1S|-F*McE5wo17gB()(^pK7%h~9M66f?@ueA%vG#(KXw9o4;_4w%zq OI=G@~B?Mc$DgOqosrrWi literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/lexical-041.js b/js/src/jsapi-tests/binast/parser/tester/lexical-041.js new file mode 100644 index 000000000000..9687c7adc472 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/lexical-041.js @@ -0,0 +1,48 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/lexical-042.binjs b/js/src/jsapi-tests/binast/parser/tester/lexical-042.binjs new file mode 100644 index 0000000000000000000000000000000000000000..47f879d5daebdd7c53c0be93ff95dd359160a195 GIT binary patch literal 7085 zcmeHM+iue^7|u8&goMNuT=fz(p>AVWP%2ngv`$r-XxT0D8m~3DN#(d}`zkyNZ^8xQ znz!J$&+|?~f9mZuT8Hfy z?QS^4UZpJGsZbK}>eok}cOTxWnA?vLBj|+UecYvpAx^?TLizeR@;;NmpT+tCI2)_5 zLMEYz?~#D;6u>;b;p2dlQ-Ya<3(!DcI^v83z3Oc^rd_Xf8t+<_vih%5Rv;!;TfW~U z95X~E+!>-H3-2D_Q9L1CM4xT#?%0?Kc3EnzqK>={+s+WPUpKF?rZ&F;_9bfbxcQIPm%ya0nJ{d9`MG)9+jyN7b zz)5Gr>HnFLSwocSt#SuM48=O0OgZ)C<(pY?d>1qpam08BM|_Ed3f4r|_c)ITf+3X% zi1kK75mBb-4#GSDtT6+sIRFmEtP?iFo-LCkkS`F~R&ei;0I{i-%MSEuqFWH1kS0eoBQ=>U>zL35+*?E__7`*6<<*xz;WkzZnzuvaEnd=&nqIIc-k968w2j>XPqv)7m=s-Pg?K|43>r{72Bdp_fMrVx zM{>CXd!ZFAZSOpPX~Qd8Nuxn2Tm3zwdSg-`?h;Q94p6jD7&uxTZl9QJBki~oTob5< zc(-4pXcS>t$PQtWFjzc|Ft<7sapG#&meWMZ?L?bUZwqVB%tF?5qBqc7^#ajOXn;KR z{3|V+DU*X{T$7d~)FOUKOrHFjx6~r*7?uWG-d+Aao#jYS`C8!p(6qmBuJGg&gpoI7 zqOs%CB$j4;&cQSe{_lVyNP~wl!)S*~OuF(n&Z(y5%{e1rr_#+sE!v|Qr-^wye#CwY z27tOLmxn$EZ1HZ=ILxafzS;b#$+LO-n!eh?W4%+dMp07)VG}V8si7!?;G|$%KvW`? znW3m;BRLRy38`HZS@r2DwPoRdy`AF8(s~8mufn zizF1ANgh%BIVNMIrdG1qOf3pX>$`(mTj0HFHOps=rTM1az>Mr^vs$&at`@Shq*`1t LvXXpl70SN=&ae2H literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/lexical-042.js b/js/src/jsapi-tests/binast/parser/tester/lexical-042.js new file mode 100644 index 000000000000..0defe9708958 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/lexical-042.js @@ -0,0 +1,49 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/lexical-047.binjs b/js/src/jsapi-tests/binast/parser/tester/lexical-047.binjs new file mode 100644 index 0000000000000000000000000000000000000000..483ce6f420cb1da7077a22bf97bcdeab264f2ae7 GIT binary patch literal 7567 zcmeHM&2Aev5Z?6v7bx0Wdm-FQ0-C2!QC?P;+~@+0T(o8fG#7jwb((;1_a{U=IJ6+KJd zNRs4OPA-yzqrv0hgW*`tS(5IWIjP{e-hcT;l6(lWQh)hVsyICs?2wHGRaA4C8K{YS z&y!Q0O)g{o0XVm=!;;EC@kzont}6h4`=bfVG(X`?8Mus|xkKk#@oc*PE^IUGbw@|v z4bolvE#0*sKGx98?{m!*6$b7(6^j55RUp_oA5-zw-TPmMm?ieE(OPP^d=r*Erz)K8 zA7Mjn{s!1v)aKLP_rtcd`8FK=@$lY{_d~^OUyr|UPmd_~=xEgMg>w525$Tif1KNpH zL`XT$L&O_svUfgLEYBgVhni}32H|F0jaA=k^(hk|^=#_jp%6Po8O`{zhqxcp+OX(7j_ z$&6+b0p)2~O8Z`LfHPJWHJ0GN0wp1I8zuNJfU~8*K$;)RMFy31b65-@uPQz+Yj9Xr z>86k;$=j`gfk-s#e;5KC390O~o%npP!s_s(C+%OY-3m4&OhF3oau+H6U&&jr?W@1b9 z2qiaFQ>Dqvr+-Q(@><#R@6*{D<@id9M?Y+6R~$;;{^(rt_!-1qGFNyB*B4dr`TC16 zO@#kPpu7hM(y~Yv&f!XvUi)ljA;7MrTZQta^_dIBD&G4{UuLedDmI&b4)bts*)m;K zM{%;%UCVcW_YHk@z?N>MVU4yrK4=r{Ty<&ALYo-D`ao1z4_+dw2y;jGQ2w)3US!?$ zB`9C;jFDr-=xI)tT+et$D8V|7RdSlv(}`F51`1Y3rqn2r)43byQ>93grvo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eqn3Lzm<;=&+`dCZ`sCLdZAQ?u zB_k5?6ZB}Q_#C1!MPo9jDQ7%KgIp4!12o+78mjJ}Ed-GgV8;q8GKY9HzDUaNwSn8i zjJc&|1q2i$F5G-IM1=VVpaQ9|P!l3mgM=2=M|bDAjtH7Stq535ms%0BR`dvAJ_W3m z049126ivj05BW5d$?(fB5comtAJQC)b0=4#*#`(62pUM0krR~&I-NOAwIrp1I&LFh zNpAo$LJ@6~w-yjN0ZYHH@rsDkH3V^qyiNk;Yt2Uge$syzv<5-GWHo{1`$!~PX}Iq& zWhA@Y61z*Df5K^k0IJ%gol-<|6gf-DqMn7fQ03=LRkl+hI|n z9SZUdN!#FKj8x1Mm8|eKDzs1=m)+dMnZoA z&;@9BAKm-52DXT%E#NIQZ8(XEGQ$`zuyq!~fl0*v#; zt(JA9#rU~F3`<^x70Tzjn)Hq0w`(-&`Wbwj-Uw;v%iSYjjl=tC4im%g!bGX8!S3a9r2(U}( zs!+bPK67cY*6%~2E;3h97n@DLfO&du(N(RgV|}vfuEo2*`4PbFGWHKRGgrcNN`Eg>|Y z?|G4XX@5Ys;XY4RCi@lI>!Y|22sE+a&4%8QqjS^f?#+BeE+ zo282gF?8IksMfX>$``_?+UpdFKY*2Wd0)_PEwRY;f47?Es2!ZYb^e|=kPr;6c7O?~M+0_nS(b_jW9~9Vs1DDaFr2qf` literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/lexical-049.js b/js/src/jsapi-tests/binast/parser/tester/lexical-049.js new file mode 100644 index 000000000000..ea2483fd8fb1 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/lexical-049.js @@ -0,0 +1,49 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/lexical-050.binjs b/js/src/jsapi-tests/binast/parser/tester/lexical-050.binjs new file mode 100644 index 0000000000000000000000000000000000000000..38c0cbdcfdefdad1ccbf659d1cf6cfe938e78830 GIT binary patch literal 6284 zcmdT|%We}f6rJ)$Y><#xu$m=Rh0+IXP^f6rpr(pKMWSwzJL4t>XB^p1(+cq+@Mo-8 z^9^jcc4lH{JV~5(8ekP=Y#-m}x%av%hXaatt38b3-DA$W9QA`+K@gm>_%hgUw2s=Z z+YuY!pjy#;s+0)1`|W8EJc3G}ceRSzCm~ zxP~HeKoTM+0QU8b7$=gP5zIAQg8D{iAvsC9yZ7OmcD>eVyl+)2>9=Yn1+lT(dViBh z%n{Xa=ZFp+JY@okFGz&wi_KS?E@p;Z(N?RbSKfwW=ZL%8Z4s_$%^!fhLTjGXKeWrT z=3Nl|sJ->^rE8eg+wu46?5OnaG&;??tG68xo-w%&X!Q%!hqM+UI}7)QlJy}Oqp*$p zBw~~$VIvWktNe6tyoROg7Xyxk0NA!f689k;btvM=_rkobAxh0reFE}{Vv}vQ6+E*1 zAy`02#AOEyIY+}3)E`6{1bJKoCVvYq`u92i9#{>Md`Jrt%Z?FGvQlvG5TQ7p?TOXZ&R-ynlR$Z& zl+%eQj=~oa9u%|i6-@aA5L+yqfQGWi*{EEG&)dSY!&_lbq5=x)4UWo-&toJ+$?@6Y zm!`hxZkw{`bI?OcOrd?vT5UTD_SKHup}8&k4n(pO%%%<)D76VpmX_|q%X1~V%=&gm z-44yQoBx_FPhi>6!joK7j(rKY!tL;DxZ~odypreR^z)SMtuaUmGaic$kvJe6BCQVM zXJ%WQj1w8I4OBxi>eVP33asn!0LG;L>`}`;>QRHVBV9dhl%=C+1KI`U?x{iVicz!& zybhCBxu#9ij@`QqHDI}Q8<=L+-rBQjQ%=>#bTcSec=t0HdoDTkg z+5T6-#ZEtgJ%a&PeW|?6a%n2&JY3@u{~jn0Kp@G+6k`G|bLqn0ag%3z-hM;@?1^@H zs99$W<211xzpdc71+N=srqGu@18lW7du7O*qqzOdq_A(lVyw3C$eh%yQPvQoe4>WA z8WPy`iB@bIh)UIxWrN0hthj-x=l_5#r`p=_<%y`g9zKUQ7LP*L>qUX>Dr9wO;?Lz##+kH?G~nRpUcu!*Xrp)ah*&T M7ra_&#&%leKW%dI#Q*>R literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/lexical-050.js b/js/src/jsapi-tests/binast/parser/tester/lexical-050.js new file mode 100644 index 000000000000..d0079468a916 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/lexical-050.js @@ -0,0 +1,45 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/lexical-051.binjs b/js/src/jsapi-tests/binast/parser/tester/lexical-051.binjs new file mode 100644 index 0000000000000000000000000000000000000000..fa840f33e0af9c2ca316c15c9a39b9a7cc395288 GIT binary patch literal 6321 zcmdT|&2AGh5MKWOE=WimI9Z&i3M!S#rA;f^G>D)oAQJV8++8;@b=HyX(B@Tm7~X>u zXP$uzV`n#Z)|I|7&#;{!vZVHQv;RQ|1vtGX)=xV18}Y_ z!s5a}(IlcNRTBVr`({E?MNcUa1}?>YduXWyO}l${V4HTM-f6yX)i$zkwT%qK#cG@R zM^q7knSuL)+0et&E@0$>#+bc$`D)Y0%&|9&*J|08H(=QpEd1&25iaS??|{8RZyq;3 zwyW~yEjaqS_U5N8-!ZHA~8UH9f$Xhk$i1K#1OgLKD&9N4)FX zWaQ;5Ow7!d;Zlf+&NO45dlnBH)A3WXh zkB~`EQL?koQ{i!LO8UIxo6}n?52*k$Ho(H%v)3j!jvUtos$&)R>I@GhF{OF{H>v*Y z+nBpFpiG%q`*yl0OA~D!IttB*sk`7MiM9{zV>i_elLc6&W7)N~xi$rOCbX~xLP0{6 zYET~X{MS9DHF>Gz{ChrIqKFj~MDuV?lYhwF_-k_Ulh5GKXdra!sz!M(O>r(DGy(h% zK)DMCQhcmJmT-AU7ygd>KsWO4I}2b>tSdszT4NRGh^X=N3rSk=0AjBlX45Btt>@+s z5k+^Dcc}R(+}$t9)fPFoD~)PYbx+bU(f7SNmc);VF>DKjN|&2uNfUhYxPpt({{b0T zko9w!Q;_{IxeN=$)Nx18pw}hm$OkN=Za{)B5VkVZz~kzSTdVAxq1|qP$@A*pj5f%P zmd)y=YS(gQA;1is-zwnX7&CExtCzlIGk9#vp(&MMRm~t|YK8d2} zqDWWK$#8Tw{&k!b3mWx~^gBJ433>eI4^i|Dyw$_gpA(*u3r0_A!U!iaD{>8$+Gi2H z%JOs*>mR_mwF|4@8Y)YpEYD;GfR`VpG?&?BM!AN|$=q&QNS@`><1b*D@t{8${xRwu zng4o61_Wb`_50_Uq?|Af_nNS!gZDMyF?yXPgx!De%TF%m8v96lt!I|}6sEl<+jkGm0PI*2N#~G`nu@gg-=~6jDcufy5=3BtJ z;!ud5K!v7!Qk)l4*Ct(F-ay_vseh8?gs-e!kt#k=&!Ij;O=a{_Mm(F&Y)LgWN&(%o z3t=bS0Azq8x~|>Iz}OmC@!rFVfZc7$;R?Cz0o9{tq5po({~WvqNxo#B#KIg2ELIBc zG07NBn++@#3o63Saj{pu#(# zCQ*cfenXS)`1zCw(J?~o4K475~ zKpv|VaQX>|ijU4#R+JmvNY;2df z#Bi+z*-L1cjv(9fT=W;%tysEIGwWF0oHx}n!c7M3iomog*{kY{3%9209!K_WSgj({ zRnt@arf}`=nyDM!84NqY3t(qMBpMQb$H7P0TWS-a&89Xf|9(QmsqO&-u%wbcjd}%B zM89;a`aH6ZEv5{XRv%$2H|U%f5GMVBOO#)Znrey}_No{&=D8X)BYs(hAf2x(W~`xU ino(b?LPPcIJA^6RTXQq&7JD<`m+NM5$K|!3VgCX=nLr8v literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/lexical-052.js b/js/src/jsapi-tests/binast/parser/tester/lexical-052.js new file mode 100644 index 000000000000..b134b9743095 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/lexical-052.js @@ -0,0 +1,47 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/lexical-053.binjs b/js/src/jsapi-tests/binast/parser/tester/lexical-053.binjs new file mode 100644 index 0000000000000000000000000000000000000000..10394859b5cf6c6e27b63f679536519ccf1d4d6e GIT binary patch literal 6943 zcmdT}O^@3)5LKFfq%8sj=&3ysIc2dZHbI(8;24O#F5+O}2DOoEKucVk4J{fZon7C0 z?oa4H>nZ2_hFmhFD3L45HoZ}d?#YlSK5`ys-ptS)wOTUL?aT?zx~~ME3A{+YN|I#C zvvtxNj$V$Rj#IuQN$13T(_vJqZt`=I{0Lul{OPZ;pm@s2DM=X?SW%uEsLVafwX8zj0gS6@Q+dF#J=mC zSP&m;Y`#CEiU`aM+&j!x0iLFSkxQCl_UpqZk3-B7`^2!;u}j{DY45NIKlitAO*a1n z>;tm-dhqACEjGV_t-l;Udh=UI%;9U9s%0m5-%XECF1Ak z`AYEx1Y?TEWIfuRPP((wvQQeQ_T#B zCq`Vf`7A_4`S-wpR9L79k!p*D7S>01`}iCaw0>F>u$Zkh5wg+r2xIO6)`b8edI1Ve z#Dt&mS!k1ymwzGdgV68M9E-KHE79TudJg&wn##zzN(7zFoupcg(m=;>dj#{yA)3!rN=oVINw;T->NG7a(4Oaqd3EE z5Hr)gm;oxQ(=92e|F%F$t)6SM82VbfDs*C@*(SIC4a0$cM`ohOFqfXA2N-qH^ymk| zBtb=@L&wk1{ikTg6;hzDdO()-?fq~kHeJ<;wXc1C{q9AcVIN)i*5OX$8An>%=aYGeqK&`uv^Z*e*XWzvpuv&AX47>XcyTi&X>lF$5& zldU}ppPG>95ZTfgo^n4qY3Jh8zaWf~rO@q;T9>hO#pfc9Mz6cW|07WD0E*&;7=^)9 zKjPrI=pFo%_tgWiE9>f0H_dU1b4FBgWk<3RT$;I7)hzl8VC!$o%d0va&0S5o3xD-% z`s#>WxS2*Z+Ul+Kndm!$K9&s!Yz*sxQ0c6*uhT?#t6!j*z8R2_c^NL6P1M8nE#zah z5;=k!WRoD-It(P=-y&DgUVt7zw?r;b2-xJv5#hc==9*9=x2xmtsI`4=%R4@o5hicT zh8v0^e+3ugdllgOC5Z?#bhN9ei^ClyolZf8NJHCvRbaPNdd2@M3{Lqj%r8Z^QBGv> zr$)oolO1W+H#?{ygWG#MrhUxoy1chu$6?=Y@N_%cAC%dj05u5DBme*a literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/lexical-053.js b/js/src/jsapi-tests/binast/parser/tester/lexical-053.js new file mode 100644 index 000000000000..8739afbadada --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/lexical-053.js @@ -0,0 +1,45 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/lexical-054.binjs b/js/src/jsapi-tests/binast/parser/tester/lexical-054.binjs new file mode 100644 index 0000000000000000000000000000000000000000..142d4f35c604634dec18f9fcb4536e533cf7b326 GIT binary patch literal 7538 zcmds6O^+ir5cTr8zyT!01ulJKM=LZS!3AXlJDH%(Y7|x^+ADIpJ&9ST9of##%s)Z= z4}J_M&fK_jp~~rQJKavlne7?v>?umS{p>2&dsVLPne|Gres95O)_Y*-M3B568qSCtye7hHcWd-Rr7U!3)l4K zUx0m!-h4j%Wzv;5--WF|oqY4_YvITLZqJWs_jEKp8@2~TWK13b+VGMtfz~>a=gH%> zkxL+BnoQV|r&7o~8ReQOX~t4B(Ss zj%_|IB3S+bct9Jf%#>-e3HeS`WZJg4f)*+o!%K+i#+K~n`gH$?II!bxhOQ3&+VE#x1;4M0XXqHFC& z0~2Rp759Oth}c~Vhb!bw4ygVH7JB_P|2^;;kbEry#PVY#Qmhc}C&~rOcAv!U<<5U# zHw^;S&!n451T~6Xrfd~f;cK|^Q$QTcqykOMLdlD66~69^$O`WkYZ447$TuwQE;^wHEU5clVGKK`Jcv=?gFrl)ce7*kbPj?pGA(zY! zatS(d>;8g1BIMs6s=Ln{=b*F;2azA&Tn7abuFr}Zsdhxr{Tp>q?PAbnRs9ZxKLbiM zqr?_zGZ;pbx3n{|r1=cy@$=*XP5Q~~=tCwnOVZ>~5^#7?+0@BbJob;nZ^YonHvgYc zeaaQ&x*?cSir&3O%=$nBYSP6((6we(z*o?yS?+H3_){a*nl*juqa2*a9>RqMkACYc z?wn}H*3A)4ZYy!>q2zo1&iU+s8o4GFNRgHv!m0G@7z{2s`weJBRtj&%=BnhaICXan6|8baz=chW@JSYS=|T z2W)(|>~q%L5xxMIyYN@PW~`3cg_~(rqpLOyo(Z;-22=+Q*c#Rcp~Ad!XwXDAHg2Hr zayKBm&%A!DMWSN_BoE+H%`TGNtn`5+sJ=(yLez-dE^_avvwgPZoC8g6%Y-`$B7X(P z?}M&uhb4%JlS8JPsQ&Vvat_naMxdd)vMsJHRo><^-0yJ8AH)1oaD!5!H{ZSj9m--P ztZl_0LN-3~6k`};-sRkT>fKMhr{1N^d+HU&#nT 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/js/src/jsapi-tests/binast/parser/tester/match-001.binjs b/js/src/jsapi-tests/binast/parser/tester/match-001.binjs new file mode 100644 index 0000000000000000000000000000000000000000..075236aa2fd129bbe9720356786f53abaf21b32f GIT binary patch literal 21482 zcmeHPOLN>r5Eg_-cvFxQ2k;?>m=xalkvO524YA`;rh)@mlM7I;@oKVGEbnef+EiRA zuJ9lDBUJG#xWb)+V~Sru_h_^;yED?Z9^QDdQmHtWM&I=GbbsB`Gg31e4t(Bf9&qNi zz7G1`fE_t6I*zm7caNQo?VT^%pSC;w0e6}W(WdEpVbuEg8^?JQS~c~@AF#k<`#!(T zJ3b3o{nSkyWA zc8Yu%y4u~|y}MhOfM}2yvv^q78cEpN+@{i$spii z2yWkwSj3OO9fb)(Px89eZ#S9mt4GBX9k|4mx9Ni?c=>BE@GxRQw9CUNV}ue`M^|!` z83OXB90CivLsUd)9Xeq!Zv)mX*S*iXAloJjxrJQ>sXPO3N6#6f>3?z zz#@p&J?Ej%x@sQ6IPhbG)iq^N@-iy9tF9($EMU4QU}JTyQ4Jb0*y`Hq8vfO!w#i2` z<#fX84gEaGfPY0GL3O86QgSu*ef0JADf0lxqSnrD%e3!h{A zmBdJd>bNG<^YRePlFAk1U}@n*x$AIuhP@8%ALv^Nhy?Zj0c_f*v+Z>|~RUcGP=uA9UEnLt+TnjHOzz(Z-V-bI?smJV}V}s#1^n82zz|6FX!`zkrQ~`1GOy|TU84Od|7og zrscB=nIo;dw4iinTgMa0C(XrekVNUQKDn?cH> zai(Xq!E5s~qB?P7VR0!X>$Kq#IEa|X7NhGrI7F?}7aTICJTapGacuakjtzBeNKRy6 z)@D62Id@BkBsL6&8E47#+>Q_%FpH$5(sghcEsbJzwUA=xbL9{RhfFIX1cy8QK&=>J zNH`9S1y*M`aN*Qtda+8k(SnDHe*^6s>#<3!>W*s5;+?rj)Q2*0016}=*~}>D%Jx#f z(v+}>HTCp$nH0aN1lI*7@B?xVY4F7ef*=8*cA9fcq?NP8)SW~~;?aRDVMJ|<<+ z(VWZ4#Rbykl-eU<_?Z)sn3XPN?yB)QC`lQvq(-Tn92@adUN!y*^i@}llhTz^0@gX?MT+Kx@l_w$@&}8; z)aBV0MB4`vHC7J2e*|FCJ{sV#| B9Mu2- literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/match-001.js b/js/src/jsapi-tests/binast/parser/tester/match-001.js new file mode 100644 index 000000000000..ab6082a1a7fd --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/match-001.js @@ -0,0 +1,106 @@ +/* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + * 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/js/src/jsapi-tests/binast/parser/tester/match-002.binjs b/js/src/jsapi-tests/binast/parser/tester/match-002.binjs new file mode 100644 index 0000000000000000000000000000000000000000..772363013e947c229d2d07748285db83a20ccd66 GIT binary patch literal 36161 zcmeGlO^@WnwFxAAL`0E-kU$7pg2Rk}nPq{?(lg70W9t-kvVMdiB2R)qB;0a6WUy z{@}i_Ci{Q$y{T_q^nTat_3n9-hrPq$$;YE>qp>#=y}@oYX5iRCxc}dO_IiJTQ3Lw= zEz7s9dye=(j2+9jLfdmAP?Pj?(0gFJlSNoR0i4IGV0nH7%AWLW*A5c^bo${$xS@S+ z3qJzqS{EtOLFn7=bpJ`1W^{aXHoSQ<*p+`9>`EXM)+ic(!w!XSIT5%oEN7mBha`xH z?p|2o`2L$$u3X*uEXc!FbL>Xc8_202hu6Qb{QPi=N<*st8(^=Hs<)0$M{QB{4}kjd z(I*FYujVPUdP4rPIzs*)raBv*-8jy#n@R*zIQsxC9=bF0z0eCE&cse6rdxeqOvUA_ zzn!0G2?8Hq&U_IBp!TEC3dIGeV=f3@v{e79NC_ zAD)RIELouhOQENDEVBf(pK=M7Kb<2X0`1Zni}@44I+#pO#T0NmvI3#8E|F3B4rWCG zS}@7+Ys!uxUNb8MqvrO`9c!8*B@NPxFktKUr;|HhzWep|*6lYx?ccc`eSGKZ?dz|l zq?E&9G%QPgSjLXN0DyM4ZYT5NwD2LCb+?rn&{7|ILFl<}^gpqJV5fiO>RWHWQx5wC zSm)bgMLsmA3vK{D!@oD)*Dn3Q_pOJiJjI&eL|T#3J>uN|00_E*1zr?`iTNN z%@dy*Jf>ivVJKA4cBW{gp?oDfg%#xDA?E5!lx$^!d;pGh>Y^(lHU+H)#O4rdLwxLr z^RVaJ)B9<79K>NSu6r+)1ImAfDx=r%Mf$qZQVOP9IR*qYen#P;o)n*yMz#ESM@0U> zqfA43diOpP2gJ+7*(f_J4^qDci^;~X?Iilp-@B4m3Cec{`V8r5%AL+^3j=4y%Kr$|PDpw4JWoj_=usqm0;6%>CXq0{ zr{Pq_K~u)@g9j6#XUM3yM#*V>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SL4ioLU9iTok&m>uN%nZm_B#8G6Nn8o~I_ zN7f83q0`n4ehDu>PdHg!Viq4k@0VS?EQb^xr^)Y8YDULLXTzH(>4~=d4nzI3;n|Jj z+&B2vt>e>??ydZhD*>0e(q!SAg;r$wO~J33$ZrdOO;LWY+eDKoGf5BmO^Jt*BaqiV zxt)~EmMz(nU!g*g-%FQ&#l;1o<%f9TX^zH4WqV|{_`kU~kptK;miq!HoWm8<=e8>* Z>9 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/js/src/jsapi-tests/binast/parser/tester/match-003.binjs b/js/src/jsapi-tests/binast/parser/tester/match-003.binjs new file mode 100644 index 0000000000000000000000000000000000000000..1422b2f79d54876b0c68d87ce4a3a885164ec239 GIT binary patch literal 21251 zcmeHPUvJz*5I2IB? z--XY?m*9mb9(myj3GvJWGwb#3od4X7?f9B&-G^T8ygNHHJM){}+3|Lx;lP!v-9stt z)jNUT55$r6x@B4WzI|-1Z*BjudwI9#52V#yR&Bbj6Gp4ccP#5;Xw{|N?~1??`>wn$ zd#(sX5u}O@z|gRqby&kqm^Z$UPD6FhlPXq^FuLABm`U`1Q)l z#id7KmUc46veI5x4}Au@KM_H;Ic24yR{sFnGt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C048;n1QyqF*{2f-+aaohJx8XXt)MX|e zXs4DSdd-wCM#0-s@y~TxxC|^{I7n`U%UK&%VD5BsHD#tz4F$6n|GXgvaJrW}lYhfB zs_O`~vZhy>>4t^H2t@0d3j_5toU7DrZKPM`LOlJf;6+INw6IuIKgVO9^a+4|gzTh> zd-RhDh_73q?&&RJWVCeYn|_3TLoRsIzoKwq_U1MHwCMbwj28cCqNIM5Q`s2%pZfnC Nj7t5ua8mOj=zk4$_CEjs literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/match-003.js b/js/src/jsapi-tests/binast/parser/tester/match-003.js new file mode 100644 index 000000000000..24453e621cc9 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/match-003.js @@ -0,0 +1,132 @@ +/* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + * 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/js/src/jsapi-tests/binast/parser/tester/match-004.binjs b/js/src/jsapi-tests/binast/parser/tester/match-004.binjs new file mode 100644 index 0000000000000000000000000000000000000000..7643a2be422b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 zb7qVNx`I`0+ieyv=i-FZcAN3ut7{|5(nb^+J7@^8s1lC_SR+`@7G@5rOh5LFWoFKl z8iOK7G?j1|{pRm}vfXC*ksE3ww%aWGQ#po;;>i9C;nsGW*>1D{eIHi|`I!<(GPCNo z+l*ID$e~W#Z8rSQ9AjQI` 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/js/src/jsapi-tests/binast/parser/tester/multiline-001.binjs b/js/src/jsapi-tests/binast/parser/tester/multiline-001.binjs new file mode 100644 index 0000000000000000000000000000000000000000..7c56b53f6e51409086a4a9ce792fdc20db17512e GIT binary patch literal 15866 zcmeHO-EP}96xRMbciY7<>|z%~E(&Z}k)&G(Z0pYA~vZ@;%27{d7n`Uw+S{Vd@|IlyPz)=_#g@l=)$2`#o5u z-P}FgyWgsBiD&gKK}4t3=HvJMlrj=TiIm1)Ipx?7D0rqHUz^ZS<;E{?bnkO!tQOK#a{U~tSZno8lqx&&sx3PDow}(LGYp(`FsUsn zac`jwtOlVPrRVpLP0dOTbK@SsNCTZL;}~-~58Z+_vIvn&>Bih)jOeg~tJ8pI1m!jh zma>=q2UN4IR%cGKh6`@Ez#Fs17U^z>0v;4n2=e&#TBQ zW;;=ROic@O8qb_lQ~D4n^+@V=Y4VI<&NC?rf7Qip1d)59vJ93c05UG+9Y zSH?)9=hRh_%X&oq^2+D|3^S@Wi=Z1DDLM4i&DiP(fvojm>7oBfrsS_aXC9`v5YZy+ zbS`ZrE0nNmtbPuGik>|Zt194B%<`JJQfCCoii|Y%&JYV4*coDn1owreFLEEOfv+M$ zj0iKS(NW-%rowWNwD3$@n6TV^@hvrC#h0dmioDf=!}0JS!bXoCOIFdk>oeoBVuY{K z#r7i7MJ{_3dEfy}`%LTqf>)TCBx@Y#PNpB#6;2U@iI>1{5A5l%#| zD=K8?)}^xra0{fp0wSbQ2A}1?Sme=`kh?_L0d=vy8PKqkcFT34Bf{J)Trss+7#i&` zf6;OQVqFZ*O_4JUl}oxMnvv}-(&n<}uwPa=OuK=U3(-{$>&S)zs-o}?(h}t`+&Qgp zmNX8F(zpeDU{|k%;`GTd=Z>q4AubA9*k$}KIorR?-sFPRgkj-{wpG^a zw`Y)e8~4Xt;?hylLYrgbTBkKx)x1L7h4i6xLs=L-OR{6#$O3WiMocyDGm>zXo1eP% zV-IeXl^^2i{7!ho@GmG7u!tJz#OGi5LUuZ1`rk;yqf-mEIo8}J>+h!wx-!_IC*?L%%;K>gq_#)9WpgmnG8$0sW|tzV*MiR@b2rJ?U>r~Dq7Eq*W3+W6LFEFr7s0|M z79SzG!~)slT@u5of1y>bz~ql%zWio%+?`WlxYDah;(f{YaGKeTk7UI=+_mLCP}F7_ z-++pD=HZk^F4w%($niJ&w;3a|Ms}m(4JQ5kIih$q2IjRTjSI3G;ru;Z@v7uoIq?=n gAHBgWUKF2gi<+JGHf3E>)JzPtzUW_#V0rg5Hy#N3J literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/multiline-001.js b/js/src/jsapi-tests/binast/parser/tester/multiline-001.js new file mode 100644 index 000000000000..9e69022d5d7b --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/multiline-001.js @@ -0,0 +1,68 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + * 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/js/src/jsapi-tests/binast/parser/tester/number-001.binjs b/js/src/jsapi-tests/binast/parser/tester/number-001.binjs new file mode 100644 index 0000000000000000000000000000000000000000..dea41480451cab95c845c9b34c4344105c50df6e GIT binary patch literal 7566 zcmds6O>f#T7|y=G4y&}=wnL7ss*P6KVcJrpmNJbB(Q2?>CqrDw8e-&_QZD;T`#rnt zzUzL$UMEiMVgn|ni0*`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e$_^q#fFE17{~eqWJOs`1n2QsUauhj5ixY&XVS-Ci*g77h@hZcGNqKEG=bo@24pG4&G|e>E}$O>>}eYc|T)<$+XB7RATST=uMg@ zx3N9|&S!UF6+%I!NtEWPtO4lqhY8PRdYN*e;Bq#yMwe2g`Jnj?EYoebdWR>S#*Tj0 z*wG*qtE=8WP9+yCQ*c)-n>ct+0WY77F1UEHyZf69X`pvh&>DKhFJRUc6YlHOf)#`L z9^AK_lR%%W-NGF!eU*?Bp<;ZR0QPpbMIztu`IJw)r>wo;&zKs z-vhSx6Y#r~OvoNDyr|d?_sw)8~z~8nV4F?B9t5uaS&w?(u`lqNTh?I)lscX2()b%qCpCh-=VT4n=XDyV!Mn|BvM#2?Zk0`|IQ9DJ#o0^Rp+WR@BwG zHY@sXq9MzZ3=WFsP)k{GfN#u9T6h@#144lUd+RW4#n(b1;~`|aUV0b*3rguA$KqiD zmQnA0%R=f?fO=y-i;I8m%x8yR6VuS8`xS0n_hinx^#;i&%<_;NwRaTjs`UMwCMs- ztp#ItDxK3}vOjEPY*KPnEymD)8O`tE(5V3~s=DP8nW8LRG`FE*qC7tSq8UQ_fFR=z z;&aYZi&FpSq+*E!`G%-P0RICLyb(e{#Rc7}?vJ^wnzlUYK-<*zEtEPvgZJ=V)4!Yz zM?IY(p8!eaa0(6W@z?RUlWw(H_$YsPrL=6|6r9%AKwlL zAkH27=tB)O7dP&L?k^2MfSrp9)(TMb%BXHi8Mn=quCSu4ELU9uB7!m@gWAv9De8n@ znV~1PK$+h`MzL3Hl-c)TR93&faH!fimZ*Bjt5kZ-^K(Lv_@$FTI{$|B*c^WAQ6HNZv#E*CR7jjYq=iue*NjOJ39N`Qu+}%%d2(( literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/number-002.js b/js/src/jsapi-tests/binast/parser/tester/number-002.js new file mode 100644 index 000000000000..5f4462e043f8 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/number-002.js @@ -0,0 +1,48 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/number-003.binjs b/js/src/jsapi-tests/binast/parser/tester/number-003.binjs new file mode 100644 index 0000000000000000000000000000000000000000..5ff1d672080e763d18823bad698a60f83ae84427 GIT binary patch literal 8026 zcmds6&2JMq6dzc=IRM%lATdV}f`Z_LvXy8EB2|D4fA9HCL(Zld-ENF2Nw(i}HsWLwU5ujWfF<*2r`_G{ zz3L6vltzs$^-d#8h1~vjKZ(bZ>tDdR za2yun3Mx&aG*4v(U?1O3XfD%XO1Xl|$;1dPBv13v_Ek8h*J}3Ld)>yC{;#p6L2Rs^ zdcTuO%1Nf+zL0F@;N1Ycd^S0t{K>OtFI>nHdP^Ctp-=n+c6}k-echH|O=JEI*r#aB z{nm%xri^(RMBnW_|Mb!|%<0?l|I@Q0>fLYmJ1tjlJ0Jo>@&TZ=z7FUV(@(@h#^bJv z(5EVb_l6H2x##?XeOq6roC*Pl^(2vW0y(GxkXHYDleI~*%xqOV2Jja(DQ4>)klNQl zZy^bneJbP<4K=KdZshnC6_7Nw3WSelXb9m|JwTb;fOW)yeck~rQ{HDCHga`Rq;dk{tmU*Jtc1$2IAlzG$W;8MWtsCg{%G7@#jT5zXpKPY)BQemD z5MABZFy)_s*ky4A8p|LI`P`7Y>T5GLIE=<5 zPcmo}%cj>zJY`t9pf@2^SEzWYW z1E7#As!HRc`HT^Oigi&pUyCtI?DE$(xCw=G5=-cky`5dSX}Jp9igoFc(M?_OHq}9) z1Vv?ZB~Wbq5ngaAP+%>^RB7i!yot_TcwI$HN7jFB{f+Wx!LcWrp&{Y0saEDuo; z`Oc630#wDc2x%%;yPo|vfm8Q&^;|S?c3jz`F)(UX@~SQRWqVJP$icXok(r>XrcYr? zHd#Drv$qELR&^IH9oZ-=w>FRA;)n(Qe782CQ6FGrgrW<&-es;oTTCCI=nB`SGeQ;t z@gJZ!76Zu^wGMR`JI|XT3Y%O|t>U>uWieW(Nf(COX1b&fy$kQDhDH>#?z%Y&$sB<_ zG__`|o?J7BKEbhGlL+b(oKh?YqH^wF0qzc-S)IU0?R-E6_QWmlQE_>N4=oF)b}tMTr1xkYv6F-Ex3_bDymPud(2gJ%Tl;}eZ6c=-K$yk0x zIhWO_HJ}#tiwo{K_6ch;$!Y~9z;nn9GU&U2R?1ewPsT8;Ttdd*!J~KJ(DIWXx}-j% z5Cu=;QvGtIm%QX;Z7ZV7B#d72d{ELWej>FN-2sqZL{XfNeR^#{Ug%X{G+G-y;}&aU gJ@%}P!u{BzS6y%G1%GYVi{2@XUOVP{jJLG@0KmLA!2kdN literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/number-003.js b/js/src/jsapi-tests/binast/parser/tester/number-003.js new file mode 100644 index 000000000000..8d0ad83db006 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/number-003.js @@ -0,0 +1,50 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/octal-001.binjs b/js/src/jsapi-tests/binast/parser/tester/octal-001.binjs new file mode 100644 index 0000000000000000000000000000000000000000..5a3c602eecff39f4a9601c03641763c38a7e88cd GIT binary patch literal 12564 zcmeHO-E!MR6c!XHQ0N7`fZO3BnNF<+n9k5~42f&NOzL*xv{%ezHqu5`D@*F`sw6Xg z1@3_x-iixefY;z0X=SbcoVBfZl8$=Qv3B>{J%8Uh`;(rCLXY-)Q%daqGZr|E%#8O9 z!#D}-b7Oxr{$=uLVg(^JdS=|G=eb<;?{*F2W9ZdWhrb}qB_|$zOf8QvBHX}_q3rB8 zH(t5EoyYnQaNfHJD_}8{Ya6cbiaCHf{m7=ia8F&zVmP17vPE;jT;J*6glQ(j!O`gH zxM#|5JyU|HSd+N_fh#B@UJUn!cu@)OOTas%&hRWW14|I^{(}cQ-Iu(Koz7v#+Uv=w zZ@}<3gq6FiOIcB?{{r>~wfbUsIB80&AHmXxgC~2(Uzatrc}3m;EpAAWAA;aVqoadi zS#H%MG@Ww?&=TkDghYTR`@AEjM0Bjc7sT~DPtj$E+#(^J(AN?5EqWzfcY_-L1a!3j z{HO8rC;P+0Mznq(5T`Xi$^#1Z9UfrJuP zMbFl;jtH2-qzHsL5h{XLimoBdZNS>I?Ie~4gjYpL%09%YT27@x! zN|lQAoXgMf8~^=Ksii%}$a&^vNql&5tYp@R?fEBQpuuwX)MQ^A*N{q3yb6WLTB5)f z^PiU%TDY9`*a00zEKLkQM!tnLrCMGh64Zntl$$eNU$d(G(qzE@1G*>$yv77LhEWGt zd9j~sKz#~OzzN3AfX<3h+Oq=hsIyE52i!OqB| zr@~;aGtEZJG=Xb;`!5v^G)-T(6pO9C==v2w~c}qKb=C$LwE% z={2}YBka^w>PnVMs*YVcR_{WfqTl7rmic5BvuIl&Zdqo})vZpxY7}Uw5IGfUQ7o&m z5-s~;?1Q(#S23D%!mMg^6!=~?kt*o*fYeZ{E=_0_e+bt_uGq@-mU?OWzp6)#6<(N3 zt8g`!ix%E)Y^6&^`KrOvri}PFQ#WN4GDwxT98wW6<=_CkVoq;q|EjV`IV7$eB0W8Y zP#yoe66`(57A?W1_XZmDwahj}leMlH$>Md%cGsi6Bc^&>dua@}BtvVM7j1F*qP3}_ zzvMhN~=0e$t$JAE+v!vAsRwLS*KQ6(upi~+4XF+KZr)H#0 zsH8AQdxt^4AGp!B9*Vsc+O8zB)?&2kSKR1ONa4 literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/octal-001.js b/js/src/jsapi-tests/binast/parser/tester/octal-001.js new file mode 100644 index 000000000000..0aa1d040746e --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/octal-001.js @@ -0,0 +1,78 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + * 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/js/src/jsapi-tests/binast/parser/tester/octal-002.binjs b/js/src/jsapi-tests/binast/parser/tester/octal-002.binjs new file mode 100644 index 0000000000000000000000000000000000000000..3a42bcc33bef51ac10902d1b4981c354cb25073a GIT binary patch literal 16156 zcmeHO-EJF26kcfgEffjvK%fY5kxa^oN9nWQa=ktzby$!uO>hPx|a>>A>_o?lX zh;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h$ThiECwz>20R_$7Ljs;xpef4E3ARowOyt(6r^(O#7Y g63xh+>>)AHP+ 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/js/src/jsapi-tests/binast/parser/tester/octal-003.binjs b/js/src/jsapi-tests/binast/parser/tester/octal-003.binjs new file mode 100644 index 0000000000000000000000000000000000000000..c1c1dd331e5158404cba2a717276213a6ac90add GIT binary patch literal 18706 zcmeHP&2HO95N4aE{|yQhJ@sPr6eEZf*J)7%ii22D3KxkJSWYf&VXVou#DpSQa+TUZ z9;8pv2Pn|j=pn~m`WWd9xvO3AM;cM0VyC=Vuy%Jizu(LbchwQ&(BnIuA!p9c<0u$J zY-GJ_S=MpjoLRej`#<(?_3a?!R;QiJ>3D7|cK+yD)`u{wV=jNnB9|R|{2sSG7BS%l zenQI8|HsyI*LS9A{R?#7nMW>l>XxxOnV1kA_pIoucSiOZveoXPW`RGfq`~{2h(@jzMmC zKNqgMMvZ?2I@*2m!~To!l`I6CSop@}ZnUXmHF`)JHjjb)MH8}zUAc6d6nXH8@w($||+2nRzpG9Zd z9v0>+CC$KqHf^uJVB+A#FMvSdM@ehLl{M_ zty~$VOaxPlWqmXGw;;ZW_Cht9L9han7+P#Pv=mj-4G3aRPxrhfRieFT8OTF>Er;3w zUzS)HuD>_*Cnf{&-=K>e5ECANYa%}2r(r%m7UcC~ zAO(1Mv?6l2bCG#tY1TfGtgVV3#ue=9`03J|eFl_9OxQynAF(K6XL*VeVN7f6dV&31 zM-C##?A_~M-&z(bbSh8polKL!K(L@xj+4?@Cpq)U4}yUUA*bV)nj(?MmoK$+Cef-n z5^3JPT}<;_rnVJ@24W3A<+hewp}P7^QrcsfmP=^_OqdyYnS5uOaeq7~FUZN}nmSBR z5RnjeCYMynl={uJ3&-l$fG+6SQ?aT8PRA_T7JyrBeyUSFAA1D6D~QWG+%hX(8SDz$7(iPB1orSB{u6b zkd6pzmmjyQhPQ;^Uwyj?dud7;`Shuc0@slc9`uN`5jQ%}5Etlmo4Ao+z z%rnSB*X9wZs<-bIi|J>CuvpBA7f+8B5A^>7#>shUmey*nNnlmrxg)or8aH*>4SdJN zlV7x}zC4878d#FvN&o zXk6|_%zn;mx-+->DrRAgRjsoL*27|P=G&>uMZK)*3a=_kZAB_7;D6ttB6%dOF(qf2 zAY%UL2WWdz)+oSHpJi(h2~rwRQKy#zxw8+y#-Z;zCpG>C%uC7-S$h^sRs6bX4%<`~ zZUGC3uj&Um3hKfN%q^>!dbpaSGE_r})zYuKEQDj|g_b;q#a|j~oOMrA>a+B|j2tid zVFtq*x!-Y-V~7y_, , <'1'>, <'1'>. By contrast, the \011 in the + * regexp should be parsed as a single token: it is the octal escape sequence + * for the horizontal tab character '\t' === '\u0009' === '\x09' === '\011'. + * + * So the regexp consists of 2 characters: , <'\t'>. + * There is no match between the regexp and the string. + * + * See the testcase ecma_3/RegExp/octal-002.js for an elaboration. + * + */ +var SECTION = "RegExp/octal-003.js"; +var VERSION = "ECMA_2"; +var TITLE = "RegExp patterns that contain OctalEscapeSequences"; +var BUGNUMBER="http://scopus/bugsplat/show_bug.cgi?id=346132"; + +startTest(); + +AddRegExpCases( /.\011/, "/\\011/", "a" + String.fromCharCode(0) + "11", "a\\011", 0, null ); + +test(); + +function AddRegExpCases( + regexp, str_regexp, pattern, str_pattern, index, matches_array ) { + + // prevent a runtime error + + if ( regexp.exec(pattern) == null || matches_array == null ) { + AddTestCase( + regexp + ".exec(" + str_pattern +")", + matches_array, + regexp.exec(pattern) ); + + return; + } + AddTestCase( + str_regexp + ".exec(" + str_pattern +").length", + matches_array.length, + regexp.exec(pattern).length ); + + AddTestCase( + str_regexp + ".exec(" + str_pattern +").index", + index, + regexp.exec(pattern).index ); + + AddTestCase( + str_regexp + ".exec(" + str_pattern +").input", + escape(pattern), + escape(regexp.exec(pattern).input) ); + + AddTestCase( + str_regexp + ".exec(" + str_pattern +").toString()", + matches_array.toString(), + escape(regexp.exec(pattern).toString()) ); + + var limit = matches_array.length > regexp.exec(pattern).length + ? matches_array.length + : regexp.exec(pattern).length; + + for ( var matches = 0; matches < limit; matches++ ) { + AddTestCase( + str_regexp + ".exec(" + str_pattern +")[" + matches +"]", + matches_array[matches], + escape(regexp.exec(pattern)[matches]) ); + } + +} diff --git a/js/src/jsapi-tests/binast/parser/tester/properties-001.binjs b/js/src/jsapi-tests/binast/parser/tester/properties-001.binjs new file mode 100644 index 0000000000000000000000000000000000000000..f520e8914f2bbe7043267ff27b287004f5abc42f GIT binary patch literal 23094 zcmeHPO>Y}T7~b;zQE@;>d>pDAD%20+B!~#La#A&EKtXLlb=m{5izfEO-FCfecGqpv zj}xjmAP$`P0f++^_#xauf;%S;`~=>2cg8#Rj)oh^o~ zro-2ZcR8!Af8l#|pEa!KEX&&WYDd<__ReRe%cZK<$LSR*g2JD%kv{scFnR~J8T+&> z?MqPgt<4)(zxptZ%;s-^OWpq2;~ki-vnc@Q4cLSa_5p44NICg40In!x;e3xNoi{6(m4~yw?N0Ym>Uul90yGn!eYd= z4jfib27yo=e4%h5>2>iq?%8f-QgI{ls@uM<3+Akn%jhm4J`ojrW`I?=THY(yDvwv6 zrl^Ih%6jrtM+hRfw590mbrB3}(6J~#rCrH)<%)+yyptgmlJ)w`tJgOMc!rbVUb$4c zayB895H0LvJ9(<>F(S=$h3L!;#+Tuca^_j~vjLX94OF^wZjUWKs$4j~cc=WY9Fz~r zZrQI~ObDjXu8};|@q|b_QmH!ogYhs+x4NtoX*=^g{K)_h(QUR@zE*j>^1H0EV-sEcw$de1!belWm1^lu(MIePLaC3)xxuiIugrzvGa%*{cbtOeQ)Hy?()0ILX9aNwn|J$5x$RgE=WzzfmtpT>77q)!((W;hf zbu;>wE`z|deAF2ZKWBa}HO92%OCRf*W@h&gF|DJFp)qYZ{2V8yVG9R4l*8@_`#z8R zq~%sI9zzYyKuZu$(S%TqM$kLnV^~W2i%w|?QjQb0&lAS$*hnygJ)t@K?z6RMCBqF) ztV_mVC0fatT!>bjG`ivpPK9T~@v8Te<2LM<ZFQkexq01;E zg6OWqaFGJa%fi~4h!iP6WK-ycM@=3jq~XvFz$zI5e67isi%@yo@$?E~P^(Qag~29mrX^h|$t8dLw3>~s zG(3?(1~jSqdn%>seIQIB^kQMt%aur^v1u+@(Wy9LsJ;ToOW>J*EVw5k}G)Nd3{nkTfM-Cqrr5>B z4|!FqS(q>vEVF`zP8d3_`E(~=u4z!KY;#7Jn4#l_j*R_6$;!T_n7>MLXtaO( zzi^+N86_v2*dE^39b6>5sSB($U;i0!9ZsJRV%yuk{&VNkLqhhnO6k0(iP+6O4rAvg z#l>_32irugz}{F&cevWoM4`|qsg5>-)k|k_#2TFuk3wu8zz!2d5PvsCd$W>g2s=t-eUw#6ONEh$G;D@8LQbTo&m2WUm$OGa)veT( z49dDpJngmAQ8FpxTs%c=HA6?qqs)d%9?b-!q-yRYh*YGOdJ#=2NV!-hp6br5lv0B9 kXEsGDLfv`aPbBo%^v7c}`u7TC#Y)OyoJCF@{q#cfKhR!VWdHyG literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/properties-001.js b/js/src/jsapi-tests/binast/parser/tester/properties-001.js new file mode 100644 index 000000000000..b0ee18e209ea --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/properties-001.js @@ -0,0 +1,91 @@ +/* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + * 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/js/src/jsapi-tests/binast/parser/tester/properties-002.binjs b/js/src/jsapi-tests/binast/parser/tester/properties-002.binjs new file mode 100644 index 0000000000000000000000000000000000000000..e657089d33e6b87ba8671797fa1ef9142248436d GIT binary patch literal 37649 zcmeHQOK;>v5ccwZi38%m3GIRB0!en4=V~^)ne2cDZ34<95fUp_j;Av*IQC$B_8|oS zfFHu|;0Sjl;LM2wcZ5Wjr+Zws+i^|Lc#?Q}4{OCeUEN(>_4U`)54Ymc&|~YZBWCy4 zKM#XJXdhdTSeA7V^dDO7?)Im>Ydt3zGOM+k{HEo(QM~@|kCyc+|5XcT-?u~8KJeHr z=6H5!$8O*!qWbCIk@b!1_p`G8=5j7n$qK?ml-svl-;E~%aPi$f^JDkWWnm)Dw~y0G zM{(%-gY_qQF}=>_Zuhh8)~a~dS`|XDtX}f_+iuK4+e^gVv%OJ4-b-BG4jXhH3|EIC zS5g?eEP7{c?aIp6QLzA7&}yQ>mMH&GF5{jZ7JrWGqp8~8x$Fh1cE7XJo0n>z;8pKz zZf)GXQq;`i75UHN6!|zWYPY+4yHjj8wg{qyzRaa@w-%;(F*v+9w%3bYKZm4iyiqKJcNFScWL%)u@3Wj1-Q zM8Qql^U|zI4u`*DDRyBiB48#cjGIar@3JU9p@l*$mY&vQswQmkRu6n=a4Nt8m;^Jn zV?Gpk>@c=McW{)B1OiO~?XIV_#I+%`^)a41WOpy80%QkbL1Pb+g98kfLp$apg>M~t z_8^*ci>ML^z2j`$NQI)h4$`->sQeQbohsxkX!KTqdk7Q}9DL23*b;-`!-*`TUz8&) zF5x9V@LxfrGt_RIH#~G5Y4hM^8A8PWhJQDeWQvygMw(d=Bw4Ne6E|DaA#^*LpylVe z9ya>@F-UCMk!plZ6#XmLGK?J=MH333ffSJ+6v0Vq8*8~81Rk^f((b>Y?Dt$QFc3M3 zAQV#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U?|WK!w56z%Q#dNG=g@Ed`nDW$@^2^tbNL{Ja=xdn}SX9*1h zQ7Y>{O^9TkC_-f8Lb|y@G*sxlfmbpE3#*EzIFBx$)dsL*Oj%X^xF+0{EqDyH%YwZ;%6avK(Nmlc`6N=tS}W^E@L!3eXc0r0D?KLtv?_1)s(S8d&8t9}Z4W z{{tSpRCQ=wRsJl0K8+2$l2wATldEE;0c;&-H-KA}KXNPAR`iV%ZgvQHU~+%0^M~D( z?^ypL#+Z^l!zDm=*FvIWxb1NLahe8y!MG>z%kLFdcEReB%Mtsns<*SBDvqZfVCe?H Uep?c?eY@hIX1`W2Seftt0uneaCjbBd literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/regexp-literals-001.js b/js/src/jsapi-tests/binast/parser/tester/regexp-literals-001.js new file mode 100644 index 000000000000..cb2448d1ec59 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/regexp-literals-001.js @@ -0,0 +1,44 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + * 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/js/src/jsapi-tests/binast/parser/tester/regexp-literals-002.binjs b/js/src/jsapi-tests/binast/parser/tester/regexp-literals-002.binjs new file mode 100644 index 0000000000000000000000000000000000000000..a3ccf7cc93a6876e15a53bf9977b885a4db8373d GIT binary patch literal 2735 zcmcgu&2AeZ5T^fskI>6rTQ%7z$7*HCv3+pmxK-B5wZdM!A;qu)Y}qf?hv~h?K0>4p zEHlV3mc}ud$?f%1EEg7?xO5!7Wtb*9v{3ytt2b2RM)Zh9#thq6MOy>K#Dn zepnE$>6{X2;W%FSpp}-Cmz@{jCLi=B!_VU^b$eOrKtinC+K;Fv5;F_8!fYAgy#u@v zS<@M2J;7JTzu+pBq$KO=gw@y8$=TWY>8*-AZat@#)650*1VC3<#^zyw|H<_az&;|^ z*MqD4p}0138}u%_U(aJ^j!)#T;}Q7`Tup|P(ICz{R76Y3z6G=^QZAuFlfk-@L@Cg0 z;-vntBK7#W#+odkKCJqnIGo?cLhfP4{8f7c3XBn7eqr7%${v~(QW{G=Axg(A?$qO8 zLv$aQcb6TpA)&W9luEc>`G8qA;oSup)6fwwZhfm!^^2YtStv(uaF#nsgKB zV^$~ry%N{c;K)3o$s@r$5z|{T(}|cTdQ*`E^aZ?~#-WAGwhZPe1f%7$Ak}&C{-ZZ|=1?5<7f{TVm_+!wGNIIK80_``i4h5e$n{}r#SMFesI_f{sA1e3_x(R$! literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/regexp-literals-002.js b/js/src/jsapi-tests/binast/parser/tester/regexp-literals-002.js new file mode 100644 index 000000000000..5b256dd22d9f --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/regexp-literals-002.js @@ -0,0 +1,28 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + * 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/js/src/jsapi-tests/binast/parser/tester/regress-001.binjs b/js/src/jsapi-tests/binast/parser/tester/regress-001.binjs new file mode 100644 index 0000000000000000000000000000000000000000..c013b642ee7c044cfbd4fb47d044306be14c3461 GIT binary patch literal 7756 zcmds6O^?$?7&e7|K-E?~bMc`9R;U|5s*sAc)g}bAXg8qEE|;oWP3&36tYcf_3EGtq zcYX+ef(!qHd(|sPj=b-9oEgXC?BruZ+e@r?W}bQ9=lz_q$H!Srx4a=G!PYaDhK!7y zuN=o2q`{ff-swH*|K9i0j5=OR%<&=V7HxKt+KQB@v$h=-clEG~v;4M45m~$VdsDa~37x*0-=tzuP(3 zdD`<@@}1X`AUalG%-@YTWh54GFG)PE;r$GF`!wvHWIzMB&gY<2WmLdoBvl|R93v6AQFRMtegv%TAShCHhvd|dtVND~ z54)mSEA?%PTWi4{rd&}W%2+yhL4EFI3<@jbXGV1jAgK4$0W0|nba>|lf?xMSwCGJlE+(Kqr zo2bF9n>RP=TIjev@G%zoCG)6HrTC+uj`Q&kBbVEZku%NOxSGZye3i-8!_^dZCJL3H z%S0&ZxLlG!_u_Nsmq+8o$0k$nHxUV%#0>h+QQq9d>h`v9f9t&Q0JuOADtW_V18jPV zQa#%@EugLe6h!;cir`SPm?j|~E-l#)042H(njaC2lRBdGS=~JCIQ37IdtxG-eKy$z zYvHVl4OZjn)+yh@PTzxwP>ZmvVkN3`A+kgdP6>EWs3_Bp62kN>gEO#{5Dw?0m>zS7 zMd45#lVtYCK)tOts<6CzNXz_;oZfPkRHi&-LFajHZ-TXy5L+O3W3wp=OvsCsdUhSH%Agd;H`y{(ozLEPNH)it=HcRyoJv4KiUf{ z6W|U0bpeo;{lLG!V?i%*H~v(au?(j2sfYeW1ga&I7;Tn(4 za=hVsUo(5{1E3r;e1Fka)jn~_F}&@m-i*otQzs^eW~3W!@$?0b9BR0bm!nO`U^$G^ VPF=JW&Mkg_fl)n38o4&d_h&BM%CGRvPx^$p`opVwc9Q78n-jc;>vM13gQvC;i-5A zE_ezafaA=LPv@jfyQ*U1DvEzTpY!?rI*@~YM61COC1Lfw;5|W3yz8Fl9rAGK)wY`N zT5nn%-ltwrN!J7sOJw!?BhPyXs{*|JfCxqoBf3F55fMZ(9;Z;D{ZG7O7Kfu)zX9jk zBrGmcC>DAwW-ubZRC}wv-Ej5B7E#hB9|PJR?FpJB;DElQiS)Z%__aar z3yUJ+KY9J?#Y^|7#Z$aMTfGaU)b`&t_jhWIJy-V`Xub)Eb0@O#xv%f7C5fab5YSR@ zrrCII^Z_Lcl@{#l>TKadJYQb%zkXZwO`!4D(qEW(mRUHA znQ64pR^ST8^#V+Ejq`|-*i`l)LPk*Dz5HK>dETWM9?TchH)B__1ZJ|Ju0$P^(}`gv zn)J;2+Z?JT6+TSa<657gG5b#63tDNfR&@AriRkbYNQEZZ?}E?A^vpK|FR!e^7;^au zmwmMyzJ&Fb$Y%v87c4OQ)xLpUWIh(B!T6B;(* ziO43%)Gt54!UwR{ywwz@L0woEG?seSsRi_Se#Fp|xsOzOF6XHL?Q&jY^xOq|(4z&l VBbrUz7EsT+_o62XN~zq;@)wAct+xOG literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/regress-7635.js b/js/src/jsapi-tests/binast/parser/tester/regress-7635.js new file mode 100644 index 000000000000..7ea94e037ae9 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/regress-7635.js @@ -0,0 +1,55 @@ +/* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + * 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/js/src/jsapi-tests/binast/parser/tester/split-001.binjs b/js/src/jsapi-tests/binast/parser/tester/split-001.binjs new file mode 100644 index 0000000000000000000000000000000000000000..c9118cc73707008c915e4dfb7a429e9e9dae4cd4 GIT binary patch literal 22400 zcmeHP&2HO95N7)Sduq`F1p=t2*iCAs0eWa48;BhTaFM!g*Nr^)fiG@~ zf$v7H^uj=q8m9lp&SNha&eQrA=v*kH6-J7bH*~zflQRNz`n{nDr1#Jhks=qkTA8OCPHcT)%e?<6p`yIa!*`;nxpp#&=Z5Pdw8vzJkgCO zz9&Dwdi9HqM{#}%GgVg!v8OqB6{tLMqx^8nQBC3g1+-65xOaE&^qUgy8^HSR&Nnv> zujM6k`hxuL^aS}jOm(n#aCQ?-E1i2+ zd~fW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w8=C8=-n7f(r~=Ah@W~UdQk{=pc(oQfb!n&~5qgjFul4ZM!k1Oq^gYQ>|#* z3h>)BR3dF#!R*r+h^(AfS{Nu*TCJj6z@W!ce@&B;eo5O3z6al;s`_-Tt6HZULytro zN}u~sx@~^Qe_jk>4+?b949-j2nIW`}OjU7YjYpY*(F;#uY{3YV+m#9U5yU!en?~~K zKZe3I9VFO~kF|@mDPa93lr~Q~qj?fb2MQ7;+X*W9UL{!f%iN~Xf#uch6ro`#?QB7M zFSttuy+;8H$>kk)BBznHd8P{we*n*$&Xw{$i^N%PE%>CK9)Z|r{UC_GZ>g^9I~WsW zzgeYkq4MXxMoI`~z5z*|%6(>2-zz*k(D!Y58JRHC`k?Qq^Su1Q33)DaY@_cK`U^@o v|5e7hySa7@eb*Yi=zF#(Oy9D6$S7%=Qh$Gf{ZN^W9=+VA=c<0zuC4z8jP7zt literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/split-001.js b/js/src/jsapi-tests/binast/parser/tester/split-001.js new file mode 100644 index 000000000000..f8e2c762a20b --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/split-001.js @@ -0,0 +1,112 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + * 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/js/src/jsapi-tests/binast/parser/tester/split-002.binjs b/js/src/jsapi-tests/binast/parser/tester/split-002.binjs new file mode 100644 index 0000000000000000000000000000000000000000..918343cc2e0648f6ea57a586bd626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4MNu8j)U_g76N_N}4-o&^Q2+n{ literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/split-002.js b/js/src/jsapi-tests/binast/parser/tester/split-002.js new file mode 100644 index 000000000000..8f14e4facbd5 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/split-002.js @@ -0,0 +1,270 @@ +/* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + * 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/js/src/jsapi-tests/binast/parser/tester/split-003.binjs b/js/src/jsapi-tests/binast/parser/tester/split-003.binjs new file mode 100644 index 0000000000000000000000000000000000000000..ce86209d718ad3b09a210323f8be3f32d97964c7 GIT binary patch literal 38042 zcmeHQ&2QX96nFS6AS5IZNJvPF1X4powzMb8CeWl?DOK2_Y$%7Sirn4Fu3N`myxz1q zfdpqHPH^DB|G#r(qgHck|xYn)WK()es-Q zr8|ax*JRgN$J8C&HEhcx)eZk2YWEGR8>RI(&{>&8%XU0cMprW|!yOY4U%%63mTMdu z%<;%s`cXLOq3ak{Z}Vw*O}n|hzjL$IsPpd{bxuU2)%Nb+HC*QCrbq5rH%AG2$O6_m z(hn}x{U_?ffoZsJU%YsE{oXM7ir`gskBJRFg2#c%vF;>q7e`c(xxWGJQ)KR~=3cuh z<~{{OZ*G5h_25#HGpEnU|4xsQPr|GAclLLi$$5(sL6p(AfSP~n`oOVW+dUbubx%ys z*BsVk4+m?t+iRwAWVm-~tI1cEV0H81z+uB7;6U5eU3LWe=?NpelYcK&)lXytLG7Ob77Sh8arfEK&6pu4D^d@~QDzDVsC){#(;FcphSI4MCi6Vdy4vlw z5ooscA(Oz2hc17?OP_#yBM?oL8I-_2Gfg|mERi`a_8{a>1?z+wzsGt&Gx^>?48`{o zXY(wOwb+AN8flT_Rmag!Vv}N~C%WN^dHg*FSVcY+;V&X`KRHKnAjG*LB~}?Fa|S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JzlgHJnKilU zlHZuoO^)Az*eh)h#;;?NFSdKnui%R9u^vPkVW|MWgbUqnZtw5hY$dKC!Tp{6-Dctn zK6R_P*Oonn!;}^$2!o05H3>6_<<$9=l)?<*xmZ~UzmjUNM7pl-xY%?}I!(ASS~AL? glx1i6rDWqm;cc=XQuLL_`@0F;6BV(*qRRp9f3_h^D*ylh literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/split-003.js b/js/src/jsapi-tests/binast/parser/tester/split-003.js new file mode 100644 index 000000000000..e887dbe0e917 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/split-003.js @@ -0,0 +1,123 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + * 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/js/src/jsapi-tests/binast/parser/tester/statement-001.binjs b/js/src/jsapi-tests/binast/parser/tester/statement-001.binjs new file mode 100644 index 0000000000000000000000000000000000000000..6b06c09c12642fe477212351360c1f68c963ce9b GIT binary patch literal 6268 zcmdT|&2AGh5Z?0ta{(c7;Izk96{JPtf|iIj4Qfyb6^SZt$j!RR(#>vUJ53|R1MmvG z8C>DQTQK%|*UoyAIO#TsQh zV-Z$N1XSQVK@_kIKo{Team0et022Whp@F(IWh97t)!QJZU9WW-?^|9)e)B34M8|52 z{mp=3f3_F_W zH0g2uL%S@K-h!*wYwz|x?V6TZzaf9E&yY7kRHxBt)=j?0aFB)=(I#qvAvtK4Fzxy0#WMeHSzZ4GHUD%I0V&VRdwM zkISgQ*;1;2NN>ccfEKE5p$sRKF#*~+1U|;36F1|YsgvN5?~vd|j_(H%A`_*T!&wH{ z8`u~aG{mROAwjRN2vm|02ijJGbR%5>q=g~MW@@gWs}#)Qz91?rZZ{`aGvtKqv%dv` zRwVZypo-!6JXSgNl9Mqc`6w(%EImdnNr}U~K|zT9*`8Qmk^HkhJ93V~7hOE$J&~#V z3Z{Gnh^^SoKwZ`+@wfmx3&6ECA8U?Js5iJB6{mE?w&b)6!{@E zt7&7cN5MYdkvlZEA%6jkV32~U0}6_70+Y$oT_`+PqRXsrH@I|YrOg}=;rS7k4J|Cm zg^we=+u01Z+%NaOni3?lWCOeKb zy8T*+Mih%mJcO}mFnhGpk6KhA;Yw3a9cAe_+J=UKJA7)eTQQFIp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#-Cbk>MIKs^M_5AV=;4Sht3jG^@{`Q>fz-81yrK7~@BENN6s)aQ{18CN55 zO`tO7txh?>{g}vV-Gi%Bck=biTSj96aM%+Z>@Fr*dT|4SD)&o>H4USAPCE zpUqLn#zaK$a7v%Q6PfWB!HI=p!3n}^)=9$<^P>ASH{6Z>4M@kDd>@?OjTnKNi$fHJ z1a(RGkTB?5(+q?eX9H9K literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/statement-002.js b/js/src/jsapi-tests/binast/parser/tester/statement-002.js new file mode 100644 index 000000000000..7ac633058bd5 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/statement-002.js @@ -0,0 +1,69 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/statement-003.binjs b/js/src/jsapi-tests/binast/parser/tester/statement-003.binjs new file mode 100644 index 0000000000000000000000000000000000000000..c77fa4f7e1e8fb83aa578062499b3b9ca0b78c2f GIT binary patch literal 8692 zcmds6-HzKt6n6P5AV8H+Z;%kaY_)2)2r40(u3)oSb*m+!28P;n@<4Ly> z;t_ZOo`V}Mcn~hRLc9g%jK}tg$MKH6Nhs{i%CYC0^ZT81W_oHqi}+q|%2~MgR3;P2 z&b`+>&pS!Ng|~k+d_4Mc6eKh5^>+0)y-1{L@7GT}?>+dcN0&cmQm~VVAMhYzk|~kI z8Y(QGQ}0Z~;WE~rfOG9KtVC)k5qcsPssNzdAB8+t;#6>{;bL}P3Y{t`;>q51*k&~7 zkB^=Vd%Nbh-mU?mSR?)Yu~1yHNW;Bg(cHp&AMjGe6hDWp@7%lhnT?vG?`pgC%%-oy z!WT^1pHm?^+Vc;<-l9F951x(IWzRQ3^v9!5zyI7e%=Yd0*Y@m)dXJCB#{*k$8W4_A zc@xp5+&@j^-Mb?8iwL#RuVB@|%bDb93Q0c7GeCzOFMhAh(mso#a;aVsz)!r)Evm6Y zPQL@%f`(F!d8!&TG_VxCl;bKYAX^$0n4HX!3esBD9hA8NSQip#=MnHRm*eC(nb|9A0g0Axe+ze1|S^_v2LbD1^rUN zBJOLV!a=%*d@YbOzAqkYHhT5>{VlK>B>6n5Nh}&8j>Lp;hfG8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?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/statement-003.js b/js/src/jsapi-tests/binast/parser/tester/statement-003.js new file mode 100644 index 000000000000..7e257675c4ec --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/statement-003.js @@ -0,0 +1,80 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/statement-004.binjs b/js/src/jsapi-tests/binast/parser/tester/statement-004.binjs new file mode 100644 index 0000000000000000000000000000000000000000..f91dfd20bc69d53739f1e0288f1d85f223826a80 GIT binary patch literal 8367 zcmds6-HzKt6n6P5AgC%(Z;(J%uUf6zEfQCduF7V!>Q+lyHBoO6LbLX4GOX8*#*=O% z#3S$myb4dkC0B^I;GD_WKJiSPi8ommt|G^tZ_YV$&Ue0<>8R->;d`AiXYt+(nT;en z58eub;3SJ@!TwSI+2HFzludZh+11~45|OLD?291y2)^pj;jfq!>?Gj_JW7~kN@S^q zimT^5I1_2Si1jDn+*pN`New09K%_#I0Cf7Jn5Rmd3NAHV%FZjJb0tMO+PewU40_$+ z(er+1*ZkMnH6RpgpuayBic6MgxYsP1T6iA=Uapwp=P>nyM~}X;Q49249k-5|^lcdU zno0X}YDCL;{sGum7|&O|mxE2k^Ib6g+2G3`uSFdHy1F=`-@~Kfaj!WcJhSo+qK$cY zn#qR`MH-eFYNKBwJ9}>?lIJ-T`Jku(op!wZ-&v(ymL%0sJtBg?cvV}p1Uzc`1Mn6+ zlxoOx)!?C{$}2lA;{vj!ae>Lv6saJ0y6)l3ZNR#aKs!%?kGULX$JxmCNmI#hP~%pa z?~9blS>;!NL<8&%Yzz#V@KY5?F&b9{YWN6&cB+Z!5^Mp|BM_TrYIHEH94zzRkrf`+ zHPmZ~Jm>rJ(J|5W=lAy@YEb0U#8Fr@M?8rM;SQNdc)WZiuC7o14c1r%R9}}l&S|D#ikl%!=xT3m=<^HG&v3xy^uqgq z@ZIeB$xqI#Da*yIMhiNstgRLh&4xrZg2}n$HDR<#RROsXaM-}uf!3t(J6MMXF67P@ z+Wrt!XZOROKeWR^O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#vmD2`)@axV=5!8@FNFAUQr3IerMtQf#2tb$87*&?X#g1KNJWj!3T5(_1)j;_ve z856i%N)r$rPPrDug{E5=^8m1B6m;hh1R2v_)QN_sO+rh)LXaDAzE46#=gKaJD-Fmu z$T3K0fKQo2$#A3;R06uubX2``FF+t+aA zLqP0CZU*YI5shXA*ck!;#{z^C3i1seY>uDDD2_MG&mNtt{343$AR3%GBNX}pRI6!a zt+QaC&&Vw*t;qL)$p)EK9#Bwx61YsJ?!wJ;DSDIn?FQc+YH2eD1U)?%Hms;1E~4al zV}eUj$znmeT7F(|y!PbbCrO?_hbTTE6lm6hv!_1W$({}=t`5{hY%ppDXc}XYgeUMM z8ZUoV=}RpVkhn$DP93E(g?6D<;CH?7s9Tdl@1ZaphP)I~099&{x5_r%CJWElrYuV+ z2$e#0Nv}Np)laERt`v5E&Sw?UQ%)N=4@=7TgGj%BPOhl`1^nquC@)IcJdLFV&RJZI z1^+Ej?!bXql<12hTzaJ|f0K-=-@M*10qo4WJk+u^N^v@vC4Cg^ccGJ^9u#8J$AHb} zru~GxJCc*-cTNB6yRXUBE}p5CLNzw^0^)bVUvfboN>9$2s9Xg$ftXT$2+;w6+NT6{1&! zYI$59jn6iAPTLyS!sN2txTHkVZ%ajdrMy-xWmuTOW1m?ydsY;9JRv2L4bQ$sxh<*t zk{0+oxMk4-k4t*Xa;%_TAV-STPJ=Yst8#1!d*x^mXSAXGlU~D&%}$yeHN7qeinFL3 NT+z@HdTtcbzX39A`F8*S literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/statement-008.js b/js/src/jsapi-tests/binast/parser/tester/statement-008.js new file mode 100644 index 000000000000..a71fc266da37 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/statement-008.js @@ -0,0 +1,42 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/statement-009.binjs b/js/src/jsapi-tests/binast/parser/tester/statement-009.binjs new file mode 100644 index 0000000000000000000000000000000000000000..1b521624dfe9c5996172b36505896108f4073533 GIT binary patch literal 6133 zcmdT|&2Q5%6wmmcxFGRyKpb)eO`|F|pj2#K(TYl$XtgWy60Z$Qlgf71^-l$HM&iHV z*>PewPFuGNMVzX}_V4+9{oZ?Suw)YAW@Chr-#j7lkf5=1!*QIm*q=Fvo!-a(o4yxM zu+ylCJ&iD+ta;;!PYw7Mur|2)GE1)ukyTK{RaM1u^}0YtZ@JYt-boMoog~Sbed-8!${z zDBvzpm>78X0I&Y)z%^mAhLm>`&Rim5Zr9~+Xv!aey+u==w!ieNGUXk( zdb{=M;A`Eq%=QiWYkP*g4Wb5}LAPz{tw)4qL_XqZBkU5)5)!$TA%@407bf^MjM~1M z5KJlLcR#}yVTbeYr3uJT$!~sALy%+(`4oAVOrO^l~`S0C58m19^t{ zoH-;IjudxFKH@-oN|0_Oi(6OCsE^?`?nVKe$8(9dH>A_=a2dnSMXYKn6Q@7OsU$3k zW8Ec|G{E6LpdiG)@@&yS+bc`Iw`WIA3HZvx6W)E8x^H00hk)3N-5k_qBN9(buygxv zt=w-pK7rn`S6zIbAWAEa&jFb!Iu~7R7<(7a2t|GfZDH2J>QQjWcN7jSZGG!y2)lgUb1D!fn;t1KtCxO8Y*%^VQnIe=w@+APV1bAH-iyfx7!tK`WbZ7n~~Sza41 z_*K$j;~3GSfIytJ;qsZ$cJd}Y!_|RWhvn-e9V$Q-f7V&R^!Y5@Grv#${E_3P1 z-?XIap4Xoy06W*N2({>pVw^5!>5B#Sd+=tU8h9b}DPZ%x+4x>GM|!iO)a<`5eZyGo z;i)<)Sfi?mgZqR}PAx>S=@X$?8;FWml68Z|dMx-0Q_KGWX<2KZf$`-mA190kK6c}C z7rEz2V$ z`UN;QhG8X4LWO}B#vv~NOz}Gbjd^$+QYPVIa;h(#au&v|je8)bzFlqX?AI#G>RDx3 zftXlzxqmO@l#xinosp<(;XMSr4Cc+s%Bl^SLoZ9CRg}bAaO#XOd%JmqF^%~XuxDt@ z!|l)YX&LhlTz$8``sJ-{nAzL$&+P0d^lt1l_O@-k&456L&?TN^ zk8BAOSa$oO!)Tg9me)Dq^c1pBh8``RJJYmEqDUW=Cz|kx>f|!DMkMtE&^YCU@di!# z01XwaiLUQ4i3)-)l?sHly222tQ+0$gPXOzj0q=YQLZ+;d>?JK*CrKyYAkVE--wb2I zdRi|}kPXl`&@oVGM31@0!d6=|sNy66w5SD{M!Et>gdwI))j~mED_F$6BPtNL8<4XF za>n_^PlurS=lHu|HAwPqu#ch{7Znp;q>LkMeBbOoJMXeD&l-{@-~4`^4US_F6WF`%iivvnET78LO8& z)oG53giplCt4dO86P#4+)oss%&t;-QxEnouxq{iye+!A6p*#bBX64^s_hWkQ@5|nP z&9`H~3|}PrdqDRy_+n}da+_RGJ~EB`2R6$FgM5@vW8|Q)ac|=6_aCaPPamZT|XHowP9B&ak literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/string-001.js b/js/src/jsapi-tests/binast/parser/tester/string-001.js new file mode 100644 index 000000000000..68bfe181c9c7 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/string-001.js @@ -0,0 +1,53 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/string-002.binjs b/js/src/jsapi-tests/binast/parser/tester/string-002.binjs new file mode 100644 index 0000000000000000000000000000000000000000..732b8e6cf1fb5bee1212637e8b8b5afca253d837 GIT binary patch literal 7976 zcmd^E-EI;=6kh+e-k5k}jEP*CHjSkkuPns~#YjV-5z<>TWv8%q*(I|>DX-$o_y9hE zH{R=0cxHBXXJ7^xU?Ei#60$ox-<;p?oIP8hgT9Z8g)T;J@q~mOf_lzP$8pX=cjT0+ z_2cH-W;^U-r;z8*6nrnD#c$6X=OH{*P`95V;-NDiAK|u-2%=sXa41(^N6v*8xZ_wq z0q4d%tdMXh&vm@OqbY!TeAUGP_0By^I9z~wQs{^hFX$BS!7D1sz!QbchNl8;9oPVXDDw2XXTZsj}La0|=aQkAyI=?9>2L=mAa9MKsX z3Ro3g%CU+Hj4g!=^>JYEfl>{m%i2?1(gH$7}0n)+{Su-_LFeepE7LkJsr&`fXbCjwlWh79#!>jHjr*)8 z(sf_Ll#c{a>&`xy%)<8&rMJo8AG@=?zN1=+x0x;yNJJ29P zYd}XvVJym^t@kXTSiPUyrLL~jT1^pGLFt1ekW{fPOu>pp+Pdp#OQKpCIKfW-Rmo*Y zUWb^rup^63o91P)HGvM7&`bxnh2gTt>9rE&FH?Va|ko7%cUs52sYAEeypuSx+$)W#LM^3uTyb>{uoK zXOqXm$jtLl_^fKJYWcs;W(#!r*MxH{;@`r-_rbw5oL2o(UJ<_4u458VJ+JZ&V5jZL zBuCXSoxxF00bAv$NpqO#DUm`weaToIZ)>w0Br%_`fmj(uSSL8H*o)ha1HW;i zvT(QcXl4zQqyHAta>DWs{24b9xx-w5hq(st^bd0J&14V^i!q=+BRG&&(!Ef@#jarG%d0XM*0^Vv8p>%ESTF4v1oh+ M5^HllvKXuW9~<8ukN^Mx literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/string-002.js b/js/src/jsapi-tests/binast/parser/tester/string-002.js new file mode 100644 index 000000000000..b68f2a156a95 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/string-002.js @@ -0,0 +1,52 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + 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/js/src/jsapi-tests/binast/parser/tester/switch-001.binjs b/js/src/jsapi-tests/binast/parser/tester/switch-001.binjs new file mode 100644 index 0000000000000000000000000000000000000000..8fb0718c119783214fd073991c0e492be268cf0e GIT binary patch literal 11212 zcmeHNPmdcl6!%j86p&D*_Rd_<0=or4r7GR-CJnG?8>%K-aX?hFGv377$xQIf>~1fJ zdp`l(`4D^#ZU}MY#DR~%dyYN!WIVGo$u`>3xg<(#|LpgB&(H5YyOX4|fbMiA)b)2B z@o3E5DS3?$auoT`NOynm_3-Y{i)NH`wnU#!z~W@*`3HpDgkBwU_!E~i_b8wbs28~0 zO;{8PC}01M$q5VnJl0=;vvCnt#03=d2@6@00hrV8`!r10F{50-h3-@@I!-tX$2)Jq zG{b&xwExYZvnBuQY)KFkYbg33u!M3q5OAk%kQVUX0lfH(CEnzt?d{t|NCmwmNbATM zufeEOmlwO6D_D}uKLC4;WIpLX9$priZ^F|1y@z{GKPfV^ej@)~ACYgsRHOaTLBA-s zX%RJT@)n{^s57@qCr;diPGM&h!PigfpX(#_ZJ4Ti_~qd6VYmOdDEkt`qJ4gP`?EWr z-zmbaKxO}Y#%Uabvm7c_i5*O{|E=Dx=LUfuDn@wl7u7z>6tRYHM8d#Wcrv1Km9a=z z6J4)k6%p{%ks`Q!oTAOfR?%w+a|5u>IJobx;9R486dgq4qSl00{sr7+!DDt==<;V; zE`mNAPC+=;;3Nv@aY8s7PxL_~T{{A8>WNH}UI1hbA};&HLjfHvU}pCgtEjQM3eT4z z&yUXRr)46ormJFp7#9phTwvc!LZ%sXLYvRUPy?`g&O8-)Ky$VQ6a}VHEp$iiZ&{+r)fH>HHBSy@*abKjh#089ycwwa6tcxn)tZFg`-G@iiy+dp)?d z+~UqA*EK)Q$^A|bZppQfdqeZnoZLrxa7(U*+*_KT=Hz~>2mgP`J+mEX-6#sE8>;xA zaG-6haFV?etXiY41y=FkQspjNgj6pucqQnZ+KhCN27$8BmP;%=)=CI|w{dw`m54&+ z;Fz5gl`dySE3?tp0q`_pewMFoG|e?y>-Q!VDcp0L#%k8-&~&Yq(4- zO49Qg^(;^_G%^vpLFAq2DhaN=`l9F8_lT%{2n^&>MRxuAv2#a!mGb8W63OX}PsMT4S&YayWg1QPi zGwO1!&dPMQy{gX8$ypAsmhm#icUNT`&(bnL_73qUgLqo)>TyzPjvixl!ZdQx6WxK}nMYQ($b4JKs=j8+H58#cU&cB4!y$}7c zuX?O!O$YKDO|8I`(R?|%hN&+Q9^H0{@bkZW?kq{Um5@DH{<{VtB@e4)$1Ma5_;s5{u literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/switch-001.js b/js/src/jsapi-tests/binast/parser/tester/switch-001.js new file mode 100644 index 000000000000..44e72985dae4 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/switch-001.js @@ -0,0 +1,65 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + * 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/js/src/jsapi-tests/binast/parser/tester/switch-002.binjs b/js/src/jsapi-tests/binast/parser/tester/switch-002.binjs new file mode 100644 index 0000000000000000000000000000000000000000..1906560b1d9b725689ae1af03e40752e1ea40d5f GIT binary patch literal 10566 zcmeHN&2rpC5FYazI8dRALvD!5frE>(i(_hIoL!cRQ)WrAOAcHpSsL$7MJp{M$#yQh z08apK!gFxrzzxn^xYIqFzm-O^v}-30)@8RO&Gbxv{WIO4G|2K*L=OfF>W2qUc{1nz zlDt6(IZ477WOy`rGJP-&k`*O`Juzkwu{1ll|0y9K!l;2g{h801e-hCzX%P9`&sY)* zQK7j`$#WKm>$3g?IXjohO1KckLc(H}X#w`~MX}c z)|t<%!|fex2<9Ik`z3<;Z2ax?s=#~)wmu$x{pg1q0p#B=56HJ+soBx&c--s}Eq(GM zl(wK=;g?>T`59e8WK@N3;hp1)6{l$m5k6J&h1*em-x;DKKZ?v$F(ZIm)C86t0xbgi zJx~@j5Ty zy~8V7?5-hPwd5k->r2N%#!NTG{qQiGio?tuOhTs>3__n@JNPHy_nZalxP-?#1QZ0e zQ7w;Tt{TzG5B-`_pzDWgX;j-itO&-KD`a#p1X4HFi9fn$La{HQunx)pFPT~0d5qeyvZk0la1t!mcaU08nC)GI-Ad&(||>gcr7 z%7*DJ5O|ibP`4C2UCZI#`-4S8m+`a9VlDX(Ox^q1GOt}*{&Y>#x z>HqHBc)?Pv!yU3T;A{yLSe!u!rF3H&uEB}KR-b?iBMxhD7h4*^y25cW0!fg>Dg7}A zN>D4`5hJnQF4(qW-VOPVN5I+6V`M3ffVMOtI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%Qm=o1cnesUdIyteS;`0b( z)=`SWq5<$#_HZTKduU>8CyB>`ZaLppFjgg;w(eR}YukLg(IgHM`)Fd&$ZuabKrnV^ zqDdUd_tC74Cc)U9i6+t8?xR^7O@gt_qKUH*TjrkrTKW&nuIteLyf-@HBg{UUwb3LP zbE2v!td7y!JGKyCcJ|S%jV8g^orxy#m1iH#+GrAtt%+t$hhcgw)5hZLphoBmFJ#Yn z#^>fu)oHeMDFi!O{2q@jth=SC)c6k!M7e0G@%3o$ysuf@!YvTbCi_EhD_3_CLijrl z(<~fH&d&1(VW_00P~^nT4!ihz5K*HnEHdeah;;(i22iU+pKFP{FqV?Ytec#e&*jZd zki1IGk;i9nUD8N1Dz83(=kVFZy+u+EP)}C7-ogUgNBa`#7N%a~JW3)foG*XwvS~4s zBq1Mx`KX{S2q71c*3(ugt$G+!?%JI{Jwh*dJ%}?pcP{l9m2=i?*OXa3vf=`r9(Cnx ZJ+S7gTA38;??bQ{Irrg=cAZZ0{{b4CgoywE literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/switch-003.js b/js/src/jsapi-tests/binast/parser/tester/switch-003.js new file mode 100644 index 000000000000..5ceaade69884 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/switch-003.js @@ -0,0 +1,57 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + * 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/js/src/jsapi-tests/binast/parser/tester/switch-004.binjs b/js/src/jsapi-tests/binast/parser/tester/switch-004.binjs new file mode 100644 index 0000000000000000000000000000000000000000..cc3af70a45719503ae28e8d9e19ba254dc8a589b GIT binary patch literal 26087 zcmeHQy_4HS6xZ<$L%|FTEhZGq5SUBIFmnXwnDfPfV=fMJzDtpY(b;=G5m_>loJ$G{ zhJu2Eh5|B_{6};QLrG0T&wHztw9-DwYxzs|>561*NpE+5@3-&0efw5!2IG;~zD zZnK_kdS+m`4j0u=KKsT)%ju_O{S9)qCdqO=F3Rc~mSY960J-^tK63)=%wirF=a|E! z(|+Jt&S3XNXr|lVKR&qEX>N<}n%hE%EUU}!KePhonKl>q$h60byjMV;e_;i^^AE0F zyP=AVL~nD@nxe&L;i*Tar`|62pd^@og6t)NdB1(sofnudK-b&*clW;fP(^0>K>o8l zAfJb(jt`Cx+v>PwMrd;K4U~4y8X+$meqaV{2s1+!zI;&sS{|q`LsPAj&pIb}TkRut z>?MFje%`qL(Z@SGs<;`TY(E}(%=f`qb|Y2s8O-AENo%)n+II3Nf1(FpvBXBnL)5U1 z2pEvX3yzszL>3`dmY(!umLZ_m5koM&!5BH~lS9`S%xfU)!UOaDIruf^9lM9_K-C(z z%1^;uDi*V4Ii~j{8JB@J8@wQRHSk0>I|~fY8k{GNNSJmMbTw&625A8zHGr76$HM_O zk^#oNCs?7;y8_D>OAcLU{E=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?_tU#1Wc22>K+WLv0SG;)HJUr-eq-Nk9d*pZM#pTlTK0)~&}h|~&F{>5 z^T_&E)fQ`wKV|KWbFn{|kfF60UEd4o_hW$0ATCt)9@IxkfJ==o?<5qHMiw?TTTa12 zppSU5*@8yuj{#+iMBRb9doo0tTzQvs#opfmrkM6a%Ra_dj%n3S?;Unj9WgVK&q?wk ztCl-lAU>f(GK9aJ8Z)i^@2z(Oj;Mxnq^t&I7@Hau1U)W`?Q(y*M`B`cwlju~(!6Q_Jg z!hI*8-N=Ty$6S$0BhH$+$n*6AckpVR!@@JOmHOsol7b~5mP^JVWr;E?cJecJnNJ#4 zfPAH@Wyw;ec4_Ye_Nqm`z$xuI0eYsxv(f};E-tRCk({lItC1a6u}+dEtJbj&b?em< zp9g*=4tk;;$hR_1Y3C4;B1LBWZPIAcDx$p>oTZBs7M3;Kf$1?HC7ox;ez3exJhfZA zKEZn7nfywFwM?BE3#k^p5F=R=a8b!FHfHc#(juWuM?Po9%3mP4M!-@H7L8D^eL}W` z1H2`O)a<(8%?zv_J~WH791Q?VD+azxGQl)wiS?5CkvhZJQ_dhV-=<_?8p|$koN_-N zPd5IP^$2qjwKdB$uq+G#pHhb$Yvxd>^A(l)Gd)SkS!NuHkO*Hx0BBN*=#C1}^8YZ`= z|Advk1v29<+1brVX?)hnpfo<4 zUHpZd>xcX)vOIk^fg-ZUIh;S@!?$ARkeW_b#(2kW{L*2!EKL74jGIqM0;4 L8>b1Il}`EpaW{ZX literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/try-003.js b/js/src/jsapi-tests/binast/parser/tester/try-003.js new file mode 100644 index 000000000000..9244fcb5d9a5 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/try-003.js @@ -0,0 +1,82 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + * 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/js/src/jsapi-tests/binast/parser/tester/try-004.binjs b/js/src/jsapi-tests/binast/parser/tester/try-004.binjs new file mode 100644 index 0000000000000000000000000000000000000000..aad744afd13e0a8bcfbad0dc7540f88c43dc60af GIT binary patch literal 7554 zcmds6OK%e~5Z>~B9Dpn0u^{#lHw;#6# z-g>pRRexD;#y#qlmc%=yFi807_lKT$7v3uA+xG|y$bLvSXfq^?@F0!^R7?F%yu%=B z4P*TVoVl~GVkV%1mKQ_;&jIw~t1TMw;2@w(z(u61gibgMqW0=dIHq1HH>z)Hr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hg+=bUgiEg#BYCNP}k;-VRLSxZoVyhjY630zu~9{+3u;CImcq5+^HY$DPVF77=1 zzTOF*F?AKhX|p-7TIediK3g~Zxq=%)*gMc}*vZl<4+Tp`=``f0Lq5ZTeP=z+xoMo^ zJjRXyT_u-kv@znuD`B*wew+^9nfncSqrRiO2iTTKN(+O6>qV{Qya+Z>w0N=+ z+FY}dZ69iw6|Agb$`r{dj)K#E9RwZcmWw_Sn!ip#k; z(=pXX@|k`K^JiVn2AY&_+oWeB&_x+!*o2v$2lG>w9Yg|3K#YPSpf8m}n*z5gqE`ai zUYL7T;2*#!RsrV0C)l>A@s*uK)NCF|IHlpIGw_BDMRYRGci|yx=0W< zm_X$c!>q5EOHx%D-#&l2lGb!0=6sANuz((cI1hgU(~)t4^8f?Tq#=K7Y)f_WbPq^2 zj~(uzP#Y$f8ous<`Ot(-3y+!*t|%M}VsM2eAsUdSbYi(h+iKZl&>6R5HqW^7r7GE~ zOB%Y>!*MFAjN1!AC`#jy{_%em(ib;!VeIn%`pYVGZ+@E{a+%lveAI*Q6J}tj4!r^I zsq7%*IZnbNm#h?2hez?7MvGydM%2~gCuXN&;&l}r*sbHFw#_oCk(OC0_A78Z)+SB4 z!Fy)7f$m@fke&^Px{BdezY~%G(dML);E@=0m8!mdO;v<(OWm^GvP%oynulwwkj40I>{b A3IG5A literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/try-005.js b/js/src/jsapi-tests/binast/parser/tester/try-005.js new file mode 100644 index 000000000000..b50c5bf53665 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/try-005.js @@ -0,0 +1,57 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + * 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/js/src/jsapi-tests/binast/parser/tester/try-006.binjs b/js/src/jsapi-tests/binast/parser/tester/try-006.binjs new file mode 100644 index 0000000000000000000000000000000000000000..237641e6393ba1f5ef525bd576e91490e294d554 GIT binary patch literal 12542 zcmeHNPjB2r6nFVkKnMg9Cr*1Tf|3d(B%*DkX1hSDkW|@K;Y2m@PIgTkdpn+On*#^F z2A_iu!WoWm<}>i#c*cI-89U?Mb(+v#vWmxke}C`a%=G1A9`l|4jI+tkLy=AeI}2V5 zg5WrvoCmvm2MBmtfckbQ}g7@I9KK=X=6A?R(`F$S7OfVUxi6S*A z|IdQcD4A4g{RMPxTtq7sic~ZSq9l?90m^=F!V?*tL|iCx2|Fu=&ZLNv>CRigW;7g( z_YM#GTl!glOB12AM(X|jNOHkqMeZq!7fyOooZr54=PR3@p}VCl*4OM_2N9k!VZTn< zuV~3XFV~WfhDW1KS@I@`J{)|1@9`J5WiH>4e_x&<-vn0Uz489g)|(>26ObPwwHfaL zD0`V?lAl3L*p%0>=NvdwpphPfE0`{~s7n#v=;L8`Q} zD?#TW!&$p79X$eIO@iB7HV|9`ZRdvu!|0?#5|& zS_Z?#_5W9R#X{j2IhIs#-9&~nFgk!(2P8erjo~}|aWH&{jm6{9_-OCo+h&7%rgL<} zwkLkuW!U?vBc|)E%JvN?28TkypDqb^)r?B!c9R|E=tqxCYiy4}= zzj?4xmb7DaiDyWy`^}0S+P@%^6*tSYHq+~N21@KPioDWOX(rija9;cN_YyMXyP!mp z7HZhyR{+vBJ$?p0w%mNg{}9QU zjZ0;yUtIV);85;ObFQZ4O$mg(HVAa6DnyM)IK^WZQ`r&lEOXdb&3GKAHfX4Fpyiv$b*6u3S_>1u|G& z(lUJV^jCnZGc;jQ(pkam=TXRdL>QV>wjQ}%6&)$T%rl3r!n15+qmNIn`Uf~$xynO# z%u}jaT^mox{bX^$ROTTOYRl_qJPkAI;?|?y*HDhoRh7iPVs5(!8%NUww@OL^ZT2ee zmWHP~U6o;`0Usu`sn{O=^`PjYTw1qP>G_|#=b~WIzG>+qPpYrnq>hg~Fz>Y`K%LZG zF*~HajBpb|FGKt}E+0{6=?y54NYo!gG_^X`trmQ*_aPeK!gfw-uR^iMw zD_*Sx0d$QE!`$6Uo<1gFS3Kd0H}GOtd2asbzL%JXx@ z^kaAr-!)ffmL<+5vjo;`Dfbn#Qn!sIUR)Tk%mH+z*w{69d-xTLvDY1^4$ewDAnDmk z>un#bptpL>sbjU>0uReKH7gX29;8;B`#p_?Jx%Wu+e#*ssIY@HnM8PlfYJLq*#F`# zV8CLyBA38LqaaL^j6Yex-cC`3D4pwIbOx z++C&X93HmVU`}fVECVp}OJmMc?7FVLZaZc3jSjfG$c09c;jRG!P-W~M+0S43LH2?qr literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/try-006.js b/js/src/jsapi-tests/binast/parser/tester/try-006.js new file mode 100644 index 000000000000..0a85200a1522 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/try-006.js @@ -0,0 +1,87 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + * 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/js/src/jsapi-tests/binast/parser/tester/try-007.binjs b/js/src/jsapi-tests/binast/parser/tester/try-007.binjs new file mode 100644 index 0000000000000000000000000000000000000000..1a7d5b74195dc3106bc2097b90c53930f6888e8c GIT binary patch literal 13660 zcmeHO&2Jk;6yNauArOcg7kmUkNr6M9$c>b^E*OQRicQ4@Rh#wLUb5LWv+FiK^uT|C z_^UX>l_Tm2apt|*nVo0P?0VMrrfuk@u06Z&^Y=dH&7_^prV-n3PnbX4zsHj?_bRCuOB2+=CyalGwmo$v;8Muc-}kkR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2nx}tA z|8_}3{e9JeBFvaZ;iY-FBTp3(%h`O&5693`Cgi}PMY&#nb-`aGG?8;2BS$Q&86y-HB{3q|QtoT|xw*3@(PTr{)A3WPk(5~| z_9IjUV<73^SLfSB4O}B>fTUxu@fKi89VdR=s?Hq_M#PF-x>KXS}ZT^NfqKY_>avUyFs?UR3H3#JlL{9@G z9o*U2tsIOW*Q;XJ1RyFks81RL4z8%$TF7ovQ7%67x=I;cU5ER0xUT4{5q2d_eg1RD zpTe~#Yoq@;y!-*Yul`1&IyU5Pz*@uQ8YY#cOZ9Ta-c-;<!nY*h9Ic83ZDm{`1dh9DY`)NX8A2#!rJ&#Ah}iv5^J`|r75yQ9-;pMso6zK literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/try-007.js b/js/src/jsapi-tests/binast/parser/tester/try-007.js new file mode 100644 index 000000000000..93e08a0a1765 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/try-007.js @@ -0,0 +1,92 @@ +/* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + * 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/js/src/jsapi-tests/binast/parser/tester/try-008.binjs b/js/src/jsapi-tests/binast/parser/tester/try-008.binjs new file mode 100644 index 0000000000000000000000000000000000000000..0c3174f12fef9a2fc9ae0c9f8c4f00fed8bb614f GIT binary patch literal 11748 zcmeHN&2J+$6rb|hMM8iO7fwMOSU|g3aY9w7Xw$F+Wdk(Xo{)+=agy0iXM)FR8)*-S z3rFq<@qcjTpFn~We*{R}c+c^Sov|}|v{k?dSJ?@6*q&@$o36yR{)Dz1=TZ zJYeL^d&cv;lejnW_M7d`Iy)Ud9#OAW6?1A~knr8cd!F|S%&O_jj|dCMNk|W<9}-4* z5J!SkPkkreX%O{hY5f6owieNfnIIMPydVmAMnK=b*`pB;`T=EvTtv`9e-dVbM-*}b9F#I4_kGc-B!btTek>DgM0_6 z4QU08vXXGZ=^6OMj`$3s3aR*U1a>&~d2F%3HE?cRju=f6@c2%;tMD3{{cd&HItfFy zRIKpfC#oDx$H2kCZ-M+EH{)HJa1+r?LP=JquJ~9-1Pq;01i}Vmgg>#0?jX#oKH6;lN#i2WOP0DIoi_nBOPk$j6MSC(q}APsn&9NTz4W{EVzC z$bnx(vl($Zpq3aQ82t%mpdrs>cL&OdgvgU7woCGeeoQZYIzmWHYBHtjMEAqkKUJQ) zxPZ+&{?horB87EX&kBB%M3pm1# zO~`ZxmiFGS|92vB99z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Vql9%h}`n&E|S)bMI#+a&6e nZZmk5Zb1N8-uWg-RG&XVPn5G3=-8lP1%T0;lT~N#l=$HP>#kmC literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/try-009.js b/js/src/jsapi-tests/binast/parser/tester/try-009.js new file mode 100644 index 000000000000..d3e0ebaa23b0 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/try-009.js @@ -0,0 +1,66 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + * 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/js/src/jsapi-tests/binast/parser/tester/try-010.binjs b/js/src/jsapi-tests/binast/parser/tester/try-010.binjs new file mode 100644 index 0000000000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hJt_ISh)&L>R26DLNI=#mG*6p4#{vgA;rpCE=bTUugd$=hsmfb!oz V!<0}?C5XzyM6TzxL9Pw%{{c6e-3R~x literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/try-010.js b/js/src/jsapi-tests/binast/parser/tester/try-010.js new file mode 100644 index 000000000000..5ee472c3b73e --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/try-010.js @@ -0,0 +1,73 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + * 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/js/src/jsapi-tests/binast/parser/tester/try-012.binjs b/js/src/jsapi-tests/binast/parser/tester/try-012.binjs new file mode 100644 index 0000000000000000000000000000000000000000..7974cc3db15e2a835305ff4ec9d52af0da448127 GIT binary patch literal 12422 zcmeHN-EQMV6!!A}Cj_@3BvXL^p;duOfU0ao;=0>FHmw?W1y^XAOcSfFUB=FK!y|yi z18{-3MZk0L4!|8R!a3uyXS}xKaemsS%1zV6o^xi-eCInqGmU6`;nAJOh?2q1Aq$3# zoEuLWhH(-MCPu5>{j#^+>jxLqXl(L#8lD?QJM^w$ybNzO)Zq^abIFNEcWK`vj6`nW zb5R5NJv7c-e~^{+56HPwB`aWDlshn7-;GiMs`~bT`jLC;QpUyk4L&Irc5n@&8avt+60ppEW0%5~3 zVm2&Xy2fH&16h|0hp8;MFc$E01Y0RB8_YpbD zt+e$|bJ!Yl+-SstOLOBS2-fD-fc6h_m>W4OHuu)bAshK|zBv30uD*5%-W&UUEVb0C z3nf9RbOBY^d01Y`sa&DK*_zz;D=5!#n}+z8U>r?TpXvLrAr5JhW2umZ1>va{Xn8^Z zOvaJwBKWVj3`0kLOLKpd=co z0ySgQyC8J0+3swcyX{@Gd*GP+ZO3ePyY`W}*X}kuoo~!m=fL_ZuPxD9f&i39gO33pva`;iTEPy9ydRtTeOI#6x7>YnmE z$MVQHq&y$zHPymODx4b4Z;m>F+RXV*5p%9`=Dg0c@W}AG@~pYAxGs81wk|1pws~P3 z=Vn&ZvG#S#;tDPWUP*XUHhJsO<}?u*P!v*lhemNniVnJP5--nlc;I;hg!90ooSvvW z7-vK&zYBF4t#zxlFF+qxsY;nKV&AfYK|kAB0O}TC{w}?g8^=@FMdeG_|G`sGi-am1 z#hf`R|A71q4VLNSXyi=V=W$CoE?k00&E^gsonr#}zBxV1(J)|T(kXUH1(@b6--cP5 zA8eaA(=oIU2PUs5OkP-e6O&iE`2{5WG=s)+ms5plSf#psTat{cdZagHD_okkuZdlb9zokz2=h_KxofB>dCsd+g z?1d{54X5|hOB}HxvBkonR%=QPlj>nqZ9x?i!#;d0AMOli3$FNQi(EuwmK0%A)(~Ip z{v9UxD#%Q(E0du>6vNqBD2%SUf9B5f$0Rtzu<7htCtI zo67iNbcq*AZc>V;nDb@tcZdhYr_SPG#f8SWQs#eu0r_b4WbdZ!PURjf$4)VtbDiA( E0hRT(U;qFB literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/try-012.js b/js/src/jsapi-tests/binast/parser/tester/try-012.js new file mode 100644 index 000000000000..3ee7d10266ba --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/try-012.js @@ -0,0 +1,95 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + * 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/js/src/jsapi-tests/binast/parser/tester/unicode-001.binjs b/js/src/jsapi-tests/binast/parser/tester/unicode-001.binjs new file mode 100644 index 0000000000000000000000000000000000000000..537e8e34c2bb7819af0fbd313189daee41993b1d GIT binary patch literal 17042 zcmeHO&2A$_5FY;j1mePtgONCFv=ApNPAkhRC!3Xmmh2LTNQj@%ndvyQ8IP@=@sdcq z2!bc!DLBIua6vo*RWsew?fFaD(*!#^ImEJirnDAf9%IxupklloCULjybnO$As_8sPP?z_jQJ)A>ZYA^tq4Sh8{Cwn1DH+WyUL>2_gq|n@9_7}gHj9S zUdAU?OjWQmopB%pyV4$+Vkt;)rQIo+`vZ_vAbKK2RG3djDWzBb>+QnM_ZF~&*h}5o z2wAqlgVZL$bI%TXkP`-m#%jV%MO5l7tWTL&eVS(0P+z;? z(*npwXsmK2(@9zYrOVY@1|SY|Z!3G-9_ehzb^ywm$T&@%%chnXf{4;q z6GVp%qEOAiU#LKIWC2IHjMz4Wu;SAl*g;QD)dt8ZTl$rWTTSS+3m~Vg+DR@R9KTqw zp(I+wh*P@kYk||x3LyFLbGs@BHmYuUZ?qk7UQGhd>eUO@96D{$0QMG2w%Eu)=gT(e z;Kr-Dx+eymJY%%+=6{Gcn0q(ds6t|n7v7_KGz(qaSvNP?Q4;KoPhr!2998e!o33Va z@9Cp5BojKoMTg)cemT_@i!xs(hGBo1Sf+$w9V+B;G;Tk_Cq0S`y?cC^vi=U8*~3g0*>FnaT+)R6Y#Ux5&r00pMa6+BGS=a z-O-$t*FvOakP|~G0==`zFS&b18&7eN`ZSG6Q1e>Am&qmSiv`$?%_{hp2_`5^Wt4}L zSYs_Yjx{-b#@*PN3iQzUD%;OCEtWgrfgmTHj##cY;&3g+3FIPlo@(Dokp2`NLx9d9 zouFxL7|N}zO_LKu*UhsYtkyf|WdHHud1>dvy`R zbgU(Bb^KPgmdMMpcUwjlb&3ldb11n}0ia>#Gg(NJ&rADCS0Y`1X;KpDX~j*2i3C9! z{Bi_A(11`=TX0OIMW2*uivB8bYrWP>*Z!&~r7k&Sb1o+rSNeA=YEp#ZBSTkCfO0ES z%Z00nKR_3SWw{=u2KhRyXn%sqZL5hYvuMH@6)yW9h$Nt(U3d49M>f9EM6R%}K1~iF zSae}tA!eya65r9Z+!4&Z;L8+K3FEULHWs$n^5bhu7OPmYAUQxq<}80UL2BMA2he1B zg95brta=BLmdb#Q}% literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/unicode-001.js b/js/src/jsapi-tests/binast/parser/tester/unicode-001.js new file mode 100644 index 000000000000..ab6fbd372ee9 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/unicode-001.js @@ -0,0 +1,59 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + * 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/js/src/jsapi-tests/binast/parser/tester/while-001.binjs b/js/src/jsapi-tests/binast/parser/tester/while-001.binjs new file mode 100644 index 0000000000000000000000000000000000000000..8ca95ad2805f27e8aa7e69554aadb6a20c8bc72c GIT binary patch literal 4573 zcmeHK&2AGh5MKTYoZu01FotC}|&%$ePLE^xh zFypn?4(o0+SYG3T@u&nQV+??g5g_G~ zp`ln3v6QI-z+b+X&{VMrqe8=_n~==Iw}ZH8-o;G=;$sc<_kE_Q zAY8+p6TT?n-3Ppj8RPWH{{GW4qD5}%n8jwnTQKRIi1O$D2Cf;)AAr5XSRQxZ54RP| zJ=l7;^XBl=vvOp1AIM+33*;SGYSbI`yJgcY}C#zsv=d z5^8&B@wMV;@jh6b9m2Vrs%MPh6?G-$bFERzSbD%vs1cP_3=OQ0?)I?>1vE)Rfr#k> z11*EpYmj+}NfY2UufT?>7-juzTF#nwk*`qRr3!Del!!~mD?*O}(*_d;&Es%4oFCGI6xioDeKV-I91!1g@ zvJZHCT^%7y#FxguLf|$KP-|EJ%SAfI*2M2puw0nwe~Zf+TrG%DbKZs96on`O-HgfPBd zZrg$qudYI=GClcH#=P53aEkdjlxVlEHR=!vrv61*- zH6m1Ha7K7mM8$vJIQR?sw{Hkh$!+Y^>&#gpfApbzdANw?CnZe=aHE#yb%)H=LfCiK zE;WZekQH|4wuFPHp=m&aQZi$KZp(~>we3Nc?xkidlovB}#eKqzmRk)ou%dI%ld69| TLP+${ZDv+cuOt{E5f;^Nl_Sf1 literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/while-001.js b/js/src/jsapi-tests/binast/parser/tester/while-001.js new file mode 100644 index 000000000000..88fd8dfe840f --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/while-001.js @@ -0,0 +1,42 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + * 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/js/src/jsapi-tests/binast/parser/tester/while-002.binjs b/js/src/jsapi-tests/binast/parser/tester/while-002.binjs new file mode 100644 index 0000000000000000000000000000000000000000..19ca8c9db45f7ed60477891c24c917320f46ff12 GIT binary patch literal 13384 zcmeHOTW{k;6n42^ga8Qy4kh1%@n#7Z2sA~t0({82x z13ayG~6$*oOy`;sWWd_L#Qcdp~q;?dBj_1b_E zul`jO_9JrSJmok}C-hF8?cLU`_O*6598#yYkz7;r8IS8fZ#vE^a8*se{SJv3>G*Vq zc6}0&n1w+C<*DD?Ib?yC$NC#^)+S+vQ3Az0hXpLo0QAT2dNhbxkI^WB3&@cYn#U0f z`t|4GG3{pKV0XV&+YrZU8v;bfYA4t4v6x20PvDM;KPuq82zVz0=F^WhH$N^SO5}~i zW;OA^r{Sh!5*07k1(?y6e**Ry+VW2GoA#n?`5cJeY}~$aZzT-*=z*o6mjPuX7m0qqMUuuB!vnj>W|RS+^D*RGOyvHMG$RnLKvpeLAV$8i>sDI zk)Oc53m(4B0ur4ny&Q}&5VRo(L*VpjFLolw~LJpc()sh%rCECc1+a9ARqgiKL^zqdgW-uejDa`@XG83y{Zq?7kzD zS4Lxz8=iqjABRjmVJ&Z0$aoR!R{4RXn=X;1Kipc7Ke$h{L;Sv)QTzQl9OBIqhuExk zgw|xX&cMMHR*a_2XGw{IHsF`=2>z`c4T=F^6AWU;m)E)H?mfnx#c{8W`14 zh@t=qw{F8}P&=POEn_y^2027zk8G+kMqyn|OWey`U^m#RuHgS&&0O&L98UHY5YAK_ zwaA3&o<*yNUByJ4C!D|-DCQgDU^I%Sp5J^i3c5I4*5}NK1jFGW%$<*T`S4l~KNc*o z?L+^7rx*HA3w*SoDzLMdIi-|{VrblFK;fnFTL;_5R#VL`Fg;c87W@aRQ!tMj9VnVI4{+M10HzstZ7CIX*qumAacnjPTrb#sUt)nW%E*HqF%iWu7zOKx(&_yyhvRoYb zeYr@J_W51{FXD20!W7hm33W?aI#C6hTpv;L>friDswqmyTj#y!>{8?8nejd-ieV== zHnOlXZUm;m*Wg%b2b?q0wAtwE*BuATg`8ZrzJ z0g1)lql&BU3E|pC{FU3o7YxqEx&aynIeGVOF4?ZbAnB1wag0Wf~)AN+Arj>O2x+5e6FR|uOQ%3ORbAg z#?Lh1or0!jX6e+i@GwkZWy6It>MwMO_30Use7Z&@b*3^rtZ!00c;!CbQKDW8{yV_M z;RYGTqbPsO*dwL?jQ9*HjyC{P&Wnw6GM@e&p<;VUT!GT%l9xDc>^{Uf!&|E2jJX}s zAPevFi*smnZJ$aUEv2${m)3TPqh(cxIBiJS;*6=P(oT)@Rh&Z6wW*dkTJrX|I9t|g yi_;jx^1GJeL}gAE*GzcTJ0)xK`6E0At)Vli@aGkQTDh`wS$y2Asrwh^0sjL=(-{c> literal 0 HcmV?d00001 diff --git a/js/src/jsapi-tests/binast/parser/tester/while-002.js b/js/src/jsapi-tests/binast/parser/tester/while-002.js new file mode 100644 index 000000000000..a3c315bf2064 --- /dev/null +++ b/js/src/jsapi-tests/binast/parser/tester/while-002.js @@ -0,0 +1,86 @@ +/* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + +/** + * 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/js/src/jsapi-tests/binast/parser/tester/while-003.binjs b/js/src/jsapi-tests/binast/parser/tester/while-003.binjs new file mode 100644 index 0000000000000000000000000000000000000000..accc07368888cd6033498c6374bf77404c2883cd GIT binary patch literal 13218 zcmeHO&2A$_5T50KK?pb?aUA6k1tFA$l{hSpQQ~;DLBT=T+U15io{rt@WX5!l6C&+9 zAg&-?EW9J8D4{PoGd{bTZ)z{V4y^U-EEGq%b&+kPv$=DI2Jcmoju{K&{ zoF#+i%kY_QyVct}=rlIvwZ^6dF|oS&^ZP8LoWwcY35mxR-fh4;9kQ6df9K9!8&M%| z=00o44?Yhsoe*w6ZW^$lFMkE>3-sl~_7~k{`SK+&z1{k3`>PLa&s@ACpIw|IUxZKf z_Imqmd)y`?JSq7GpyiYdMMg4u3^`%r*6?Th+YzTiKyG&xe$F^rUUw#Ei^Q>hHGiWI zm#9uDbF3bzjHw4By*TXM>^EO({hP^q&5Z>7*4vdN^X) z0*wO<^#DuWJ6Pdi-IPo%kqfCW|LORU4%1bkA9{T^eS{O4?W=0mb?B)cOFlg>D<815 zkOmzbeogz11kcU-2cAQ!Pn02^LirB7R|q97r7L72%=p;hg^AQi)0mQ^vO2g`r=&nB z0D&FHS-2IhjffCyAKO8Z6-7z2|0nBya%tV=v+my-tb4nHbsyLQTXd>%JTgh$q@o+s*l+@===Dr5YM)+B9^bCP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wjo zQ^PO;ERZf~l#*{rn#I4>dL88&WjVn{M6M@3sk5V~-MaGFGGeG%OPi5+RmAX*KkM}n zmClr)d6ds^^Vs)52dBA|*772T&%)5Ph~WSiZ*_2C)Jz+$I8PETgnLWweAW(ir9PC~ zE;Zo;v+a({B*yRBGkh7QW_UtFG0OFx0(CuRkrnwF&=s+);$)3D0V-U|(b zfA4H?O>OW@#s-Ie5U?RG^@iQ1M}dEP)`D)T*o!knO;%fAi2Q3h>^i8xU62|EbyMU+ zwuwm7l1DpvjrbGg8f9@lNXN4C)H1T6IbtKDHC2&~_Zmbt{tK$N!pH_TImMC)ig1jr z=~#R}s{@nR05_Ah>&X)@p=%VK+S3Z6HG0K0!MKHNC?gJ4a7=A@1;vPF-;(9axI|+Q zmtPGro&&4TZ79R-9k3-uVwwDKi`WSiSKu|Yc5goWe-Nrp5RQR=PaQCoQe}|i+$w<_ zUxHH39psoHZJmkNEVkAM=QxvEor-hdQtDZ8maFiLycr%+yrEI!GFEt6nu#gDNvCBH z__vtoJjU5jvY{5&hKhb z(ES&n97*M+-?}UmoF*`a(kZqYO02^=!emWshjnl{Q0*{OwN*024(s42&d22|E8j=I z&|vsUhjrA%I+i^cUd#l;Xkv}>o=Y^N`~ zZ|KfB%f!2yDeXc7cXtY5{NnmG4BXu@XK9n1X4iF~q3)P7^6EC;u*JR!>2#8BNpp{X zD;JWJ(pkAi%Qk%`G-G`ub|nhX%jD~Adjc=C)ShIw0XP2?3m85uTxqO%PdvFQwz;b; z;l1K2VM=o^0d6%{$p$3NRRYlQt0-ornBv#)l)l5=!@V7eW%Dcg7oZW6H+QZd?7p+F z+&Js7KOBzoK3Yy!_Yy9C38e=WMgE2J{3;fi*|+bKkt*$1^0fRhMC56j_51wljQ7PS aS{ncVA&d)UEcB;rE=ncdv{dyA0sar @@ -19,25 +17,38 @@ #endif +#include "jsapi.h" + + #include "frontend/BinSource.h" #include "frontend/FullParseHandler.h" #include "frontend/ParseContext.h" #include "frontend/Parser.h" +#include "gc/Zone.h" +#include "js/Vector.h" #include "jsapi-tests/tests.h" +#include "vm/Interpreter.h" + using UsedNameTracker = js::frontend::UsedNameTracker; +using namespace JS; +using namespace js; -extern void readFull(const char* path, Vector& buf); +extern void enterJsDirectory(); +extern void exitJsDirectory(); +extern void readFull(const char* path, js::Vector& buf); -void readFull(JSContext* cx, const char* path, Vector& buf) { +void +readFull(JSContext* cx, const char* path, js::Vector& buf) +{ buf.shrinkTo(0); - Vector intermediate(cx); + js::Vector intermediate(cx); readFull(path, intermediate); if (!buf.appendAll(intermediate)) - MOZ_CRASH(); + MOZ_CRASH("Couldn't read data"); } BEGIN_TEST(testBinASTReaderECMAScript2) @@ -54,9 +65,11 @@ BEGIN_TEST(testBinASTReaderECMAScript2) const char PATH[] = "jsapi-tests/binast/parser/tester/"; // Read the list of files in the directory. + enterJsDirectory(); DIR* dir = opendir(PATH); + exitJsDirectory(); if (!dir) - MOZ_CRASH(); + MOZ_CRASH("Couldn't open directory"); while (auto entry = readdir(dir)) { @@ -68,10 +81,12 @@ BEGIN_TEST(testBinASTReaderECMAScript2) const char PATH[] = "jsapi-tests\\binast\\parser\\tester\\*.binjs"; WIN32_FIND_DATA FindFileData; + enterJsDirectory(); HANDLE hFind = FindFirstFile(PATH, &FindFileData); + exitJsDirectory(); for (bool found = (hFind != INVALID_HANDLE_VALUE); found; - found = FindNextFile(hFind, &FindFileData) + found = FindNextFile(hFind, &FindFileData)) { const char* d_name = FindFileData.cFileName; @@ -92,25 +107,25 @@ BEGIN_TEST(testBinASTReaderECMAScript2) fprintf(stderr, "Testing %s\n", txtPath.get()); // Read text file. - Vector txtSource(cx); + js::Vector txtSource(cx); readFull(cx, txtPath.get(), txtSource); // Parse text file. UsedNameTracker txtUsedNames(cx); if (!txtUsedNames.init()) - MOZ_CRASH(); + MOZ_CRASH("Couldn't initialize used names"); js::frontend::Parser parser(cx, cx->tempLifoAlloc(), options, txtSource.begin(), txtSource.length(), /* foldConstants = */ false, txtUsedNames, nullptr, nullptr); if (!parser.checkOptions()) - MOZ_CRASH(); + MOZ_CRASH("Bad options"); auto txtParsed = parser.parse(); // Will be deallocated once `parser` goes out of scope. RootedValue txtExn(cx); if (!txtParsed) { // Save exception for more detailed error message, if necessary. if (!js::GetAndClearException(cx, &txtExn)) - MOZ_CRASH(); + MOZ_CRASH("Couldn't clear exception"); } // Read binary file. @@ -119,13 +134,13 @@ BEGIN_TEST(testBinASTReaderECMAScript2) strncpy(binPath.get() + sizeof(PATH) - 1, d_name, namlen); binPath[namlen + sizeof(PATH) - 1] = 0; - Vector binSource(cx); + js::Vector binSource(cx); readFull(binPath.get(), binSource); // Parse binary file. js::frontend::UsedNameTracker binUsedNames(cx); if (!binUsedNames.init()) - MOZ_CRASH(); + MOZ_CRASH("Couldn't initialized binUsedNames"); js::frontend::BinASTParser reader(cx, cx->tempLifoAlloc(), binUsedNames, options); @@ -134,7 +149,7 @@ BEGIN_TEST(testBinASTReaderECMAScript2) if (binParsed.isErr()) { // Save exception for more detailed error message, if necessary. if (!js::GetAndClearException(cx, &binExn)) - MOZ_CRASH(); + MOZ_CRASH("Couldn't clear binExn"); } // The binary parser should accept the file iff the text parser has. @@ -143,7 +158,7 @@ BEGIN_TEST(testBinASTReaderECMAScript2) js::ErrorReport report(cx); if (!report.init(cx, txtExn, js::ErrorReport::WithSideEffects)) - MOZ_CRASH(); + MOZ_CRASH("Couldn't report txtExn"); PrintError(cx, stderr, report.toStringResult(), report.report(), /* reportWarnings */ true); MOZ_CRASH("Binary parser accepted a file that text parser rejected"); @@ -154,7 +169,7 @@ BEGIN_TEST(testBinASTReaderECMAScript2) js::ErrorReport report(cx); if (!report.init(cx, binExn, js::ErrorReport::WithSideEffects)) - MOZ_CRASH(); + MOZ_CRASH("Couldn't report binExn"); PrintError(cx, stderr, report.toStringResult(), report.report(), /* reportWarnings */ true); MOZ_CRASH("Binary parser rejected a file that text parser accepted"); @@ -169,17 +184,17 @@ BEGIN_TEST(testBinASTReaderECMAScript2) // Compare ASTs. Sprinter binPrinter(cx); if (!binPrinter.init()) - MOZ_CRASH(); + MOZ_CRASH("Couldn't display binParsed"); DumpParseTree(binParsed.unwrap(), binPrinter); Sprinter txtPrinter(cx); if (!txtPrinter.init()) - MOZ_CRASH(); + MOZ_CRASH("Couldn't display txtParsed"); DumpParseTree(txtParsed, txtPrinter); if (strcmp(binPrinter.string(), txtPrinter.string()) != 0) { - fprintf(stderr, "Got distinct ASTs when parsing %s:\n\tBINARY\n%s\n\n\tTEXT\n%s\n", txtPath.get(), binPrinter.string(), txtPrinter.string()); - MOZ_CRASH(); + fprintf(stderr, "Got distinct ASTs when parsing %s:\n\tBINARY\n%s\n\n\tTEXT\n%s\n", txtPath.get(), binPrinter.string(), txtPrinter.string()); + MOZ_CRASH("Got distinct ASTs"); } fprintf(stderr, "Got the same AST when parsing %s\n", txtPath.get()); @@ -189,6 +204,9 @@ BEGIN_TEST(testBinASTReaderECMAScript2) #if defined(XP_WIN) if (!FindClose(hFind)) MOZ_CRASH("Could not close Find"); +#elif defined(XP_UNIX) + if (closedir(dir) != 0) + MOZ_CRASH("Could not close dir"); #endif // defined(XP_WIN) return true;