Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(258)

Side by Side Diff: test/cctest/test-parsing.cc

Issue 1295883002: Sloppy-mode let parsing (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Replace array with direct ivars Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/token.h ('k') | test/mjsunit/harmony/block-let-contextual-sloppy.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « src/token.h ('k') | test/mjsunit/harmony/block-let-contextual-sloppy.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698