| 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 6800 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 6811     "for (let x of []) {}", | 6811     "for (let x of []) {}", | 
| 6812     NULL | 6812     NULL | 
| 6813   }; | 6813   }; | 
| 6814   // clang-format on | 6814   // clang-format on | 
| 6815 | 6815 | 
| 6816   static const ParserFlag always_flags[] = {kAllowHarmonySloppy, | 6816   static const ParserFlag always_flags[] = {kAllowHarmonySloppy, | 
| 6817                                             kAllowHarmonySloppyLet}; | 6817                                             kAllowHarmonySloppyLet}; | 
| 6818   RunParserSyncTest(context_data, data, kSuccess, NULL, 0, always_flags, | 6818   RunParserSyncTest(context_data, data, kSuccess, NULL, 0, always_flags, | 
| 6819                     arraysize(always_flags)); | 6819                     arraysize(always_flags)); | 
| 6820 } | 6820 } | 
|  | 6821 | 
|  | 6822 | 
|  | 6823 TEST(LetSloppyOnly) { | 
|  | 6824   // clang-format off | 
|  | 6825   const char* context_data[][2] = { | 
|  | 6826     {"", ""}, | 
|  | 6827     {"{", "}"}, | 
|  | 6828     {NULL, NULL} | 
|  | 6829   }; | 
|  | 6830 | 
|  | 6831   const char* data[] = { | 
|  | 6832     "let let", | 
|  | 6833     "let", | 
|  | 6834     "let let = 1", | 
|  | 6835     "let = 1", | 
|  | 6836     "for (let let = 1; let < 1; let++) {}", | 
|  | 6837     "for (let = 1; let < 1; let++) {}", | 
|  | 6838     "for (let let in {}) {}", | 
|  | 6839     "for (let let of []) {}", | 
|  | 6840     "for (let in {}) {}", | 
|  | 6841     NULL | 
|  | 6842   }; | 
|  | 6843   // clang-format on | 
|  | 6844 | 
|  | 6845   static const ParserFlag always_flags[] = {kAllowHarmonySloppy, | 
|  | 6846                                             kAllowHarmonySloppyLet}; | 
|  | 6847   RunParserSyncTest(context_data, data, kSuccess, NULL, 0, always_flags, | 
|  | 6848                     arraysize(always_flags)); | 
|  | 6849 } | 
| OLD | NEW | 
|---|