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

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

Issue 1315673009: Sloppy-mode let parsing (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: clarify comment Created 5 years, 3 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 6994 matching lines...) Expand 10 before | Expand all | Expand 10 after
7005 NULL}; 7005 NULL};
7006 7006
7007 static const ParserFlag always_flags[] = { 7007 static const ParserFlag always_flags[] = {
7008 kAllowHarmonyArrowFunctions, kAllowHarmonyDefaultParameters, 7008 kAllowHarmonyArrowFunctions, kAllowHarmonyDefaultParameters,
7009 kAllowHarmonyDestructuring, kAllowHarmonyRestParameters, 7009 kAllowHarmonyDestructuring, kAllowHarmonyRestParameters,
7010 kAllowHarmonySloppy, kAllowStrongMode 7010 kAllowHarmonySloppy, kAllowStrongMode
7011 }; 7011 };
7012 RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags, 7012 RunParserSyncTest(context_data, data, kError, NULL, 0, always_flags,
7013 arraysize(always_flags)); 7013 arraysize(always_flags));
7014 } 7014 }
7015
7016
7017 TEST(LetSloppyOnly) {
7018 // clang-format off
7019 const char* context_data[][2] = {
7020 {"", ""},
7021 {"{", "}"},
7022 {NULL, NULL}
7023 };
7024
7025 const char* data[] = {
7026 "let let",
7027 "let",
7028 "let let = 1",
7029 "let = 1",
7030 "for (let let = 1; let < 1; let++) {}",
7031 "for (let = 1; let < 1; let++) {}",
7032 "for (let let in {}) {}",
7033 "for (let let of []) {}",
7034 "for (let in {}) {}",
7035 NULL
7036 };
7037 // clang-format on
7038
7039 static const ParserFlag always_flags[] = {kAllowHarmonySloppy,
7040 kAllowHarmonySloppyLet};
7041 RunParserSyncTest(context_data, data, kSuccess, NULL, 0, always_flags,
7042 arraysize(always_flags));
7043 }
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