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

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

Issue 2368613002: [modules] Simplify treatment of empty imports. (Closed)
Patch Set: Created 4 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/parsing/parser.cc ('k') | no next file » | 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 6156 matching lines...) Expand 10 before | Expand all | Expand 10 after
6167 if (entry->export_name->IsOneByteEqualTo("y")) { 6167 if (entry->export_name->IsOneByteEqualTo("y")) {
6168 CheckEntry(entry, "y", "x", nullptr, -1); 6168 CheckEntry(entry, "y", "x", nullptr, -1);
6169 entry = (++it)->second; 6169 entry = (++it)->second;
6170 CheckEntry(entry, "x", "x", nullptr, -1); 6170 CheckEntry(entry, "x", "x", nullptr, -1);
6171 } else { 6171 } else {
6172 CheckEntry(entry, "x", "x", nullptr, -1); 6172 CheckEntry(entry, "x", "x", nullptr, -1);
6173 entry = (++it)->second; 6173 entry = (++it)->second;
6174 CheckEntry(entry, "y", "x", nullptr, -1); 6174 CheckEntry(entry, "y", "x", nullptr, -1);
6175 } 6175 }
6176 6176
6177 CHECK_EQ(3, descriptor->special_imports().length()); 6177 CHECK_EQ(2, descriptor->namespace_imports().length());
6178 CheckEntry(descriptor->special_imports().at(0), nullptr, nullptr, nullptr, 3); 6178 CheckEntry(descriptor->namespace_imports().at(0), nullptr, "loo", nullptr, 4);
6179 CheckEntry(descriptor->special_imports().at(1), nullptr, "loo", nullptr, 4); 6179 CheckEntry(descriptor->namespace_imports().at(1), nullptr, "foob", nullptr,
6180 CheckEntry(descriptor->special_imports().at(2), nullptr, "foob", nullptr, 4); 6180 4);
6181 6181
6182 CHECK_EQ(4, descriptor->regular_imports().size()); 6182 CHECK_EQ(4, descriptor->regular_imports().size());
6183 entry = descriptor->regular_imports().find( 6183 entry = descriptor->regular_imports().find(
6184 declarations->at(1)->proxy()->raw_name())->second; 6184 declarations->at(1)->proxy()->raw_name())->second;
6185 CheckEntry(entry, nullptr, "z", "q", 0); 6185 CheckEntry(entry, nullptr, "z", "q", 0);
6186 entry = descriptor->regular_imports().find( 6186 entry = descriptor->regular_imports().find(
6187 declarations->at(2)->proxy()->raw_name())->second; 6187 declarations->at(2)->proxy()->raw_name())->second;
6188 CheckEntry(entry, nullptr, "n", "default", 1); 6188 CheckEntry(entry, nullptr, "n", "default", 1);
6189 entry = descriptor->regular_imports().find( 6189 entry = descriptor->regular_imports().find(
6190 declarations->at(9)->proxy()->raw_name())->second; 6190 declarations->at(9)->proxy()->raw_name())->second;
(...skipping 2137 matching lines...) Expand 10 before | Expand all | Expand 10 after
8328 const char* data[] = { 8328 const char* data[] = {
8329 "const arguments = 1", 8329 "const arguments = 1",
8330 "let arguments", 8330 "let arguments",
8331 "var arguments", 8331 "var arguments",
8332 NULL 8332 NULL
8333 }; 8333 };
8334 // clang-format on 8334 // clang-format on
8335 RunParserSyncTest(context_data, data, kSuccess); 8335 RunParserSyncTest(context_data, data, kSuccess);
8336 } 8336 }
8337 } 8337 }
OLDNEW
« no previous file with comments | « src/parsing/parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698