OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 5546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5557 static const ParserFlag always_flags[] = { | 5557 static const ParserFlag always_flags[] = { |
5558 kAllowStrongMode, kAllowHarmonyScoping | 5558 kAllowStrongMode, kAllowHarmonyScoping |
5559 }; | 5559 }; |
5560 RunParserSyncTest(sloppy_context_data, data, kSuccess, NULL, 0, always_flags, | 5560 RunParserSyncTest(sloppy_context_data, data, kSuccess, NULL, 0, always_flags, |
5561 arraysize(always_flags)); | 5561 arraysize(always_flags)); |
5562 RunParserSyncTest(strict_context_data, data, kSuccess, NULL, 0, always_flags, | 5562 RunParserSyncTest(strict_context_data, data, kSuccess, NULL, 0, always_flags, |
5563 arraysize(always_flags)); | 5563 arraysize(always_flags)); |
5564 RunParserSyncTest(strong_context_data, data, kError, NULL, 0, always_flags, | 5564 RunParserSyncTest(strong_context_data, data, kError, NULL, 0, always_flags, |
5565 arraysize(always_flags)); | 5565 arraysize(always_flags)); |
5566 } | 5566 } |
| 5567 |
| 5568 |
| 5569 TEST(ArrowFunctionASIErrors) { |
| 5570 const char* context_data[][2] = {{"'use strict';", ""}, {"", ""}, |
| 5571 {NULL, NULL}}; |
| 5572 |
| 5573 const char* data[] = { |
| 5574 "(a\n=> a)(1)", |
| 5575 "(a/*\n*/=> a)(1)", |
| 5576 "((a)\n=> a)(1)", |
| 5577 "((a)/*\n*/=> a)(1)", |
| 5578 "((a, b)\n=> a + b)(1, 2)", |
| 5579 "((a, b)/*\n*/=> a + b)(1, 2)", |
| 5580 NULL}; |
| 5581 static const ParserFlag always_flags[] = {kAllowHarmonyArrowFunctions}; |
| 5582 RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags, |
| 5583 arraysize(always_flags)); |
| 5584 } |
OLD | NEW |