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 5530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5541 static const ParserFlag always_flags[] = { | 5541 static const ParserFlag always_flags[] = { |
5542 kAllowStrongMode, kAllowHarmonyScoping | 5542 kAllowStrongMode, kAllowHarmonyScoping |
5543 }; | 5543 }; |
5544 RunParserSyncTest(sloppy_context_data, data, kSuccess, NULL, 0, always_flags, | 5544 RunParserSyncTest(sloppy_context_data, data, kSuccess, NULL, 0, always_flags, |
5545 arraysize(always_flags)); | 5545 arraysize(always_flags)); |
5546 RunParserSyncTest(strict_context_data, data, kSuccess, NULL, 0, always_flags, | 5546 RunParserSyncTest(strict_context_data, data, kSuccess, NULL, 0, always_flags, |
5547 arraysize(always_flags)); | 5547 arraysize(always_flags)); |
5548 RunParserSyncTest(strong_context_data, data, kError, NULL, 0, always_flags, | 5548 RunParserSyncTest(strong_context_data, data, kError, NULL, 0, always_flags, |
5549 arraysize(always_flags)); | 5549 arraysize(always_flags)); |
5550 } | 5550 } |
| 5551 |
| 5552 |
| 5553 TEST(StrongForIn) { |
| 5554 const char* sloppy_context_data[][2] = {{"", ""}, {NULL}}; |
| 5555 const char* strict_context_data[][2] = {{"'use strict';", ""}, {NULL}}; |
| 5556 const char* strong_context_data[][2] = {{"'use strong';", ""}, {NULL}}; |
| 5557 |
| 5558 const char* data[] = { |
| 5559 "for (x in []) {}", |
| 5560 "for (const x in []) {}", |
| 5561 NULL}; |
| 5562 |
| 5563 static const ParserFlag always_flags[] = { |
| 5564 kAllowStrongMode, kAllowHarmonyScoping |
| 5565 }; |
| 5566 RunParserSyncTest(sloppy_context_data, data, kSuccess, NULL, 0, always_flags, |
| 5567 arraysize(always_flags)); |
| 5568 RunParserSyncTest(strict_context_data, data, kSuccess, NULL, 0, always_flags, |
| 5569 arraysize(always_flags)); |
| 5570 RunParserSyncTest(strong_context_data, data, kError, NULL, 0, always_flags, |
| 5571 arraysize(always_flags)); |
| 5572 } |
OLD | NEW |