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

Unified Diff: test/cctest/test-parsing.cc

Issue 1589173002: [modules] Support parsing anonymous default exports (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add negative generator test Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/parsing/parser.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-parsing.cc
diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc
index 7269e2d5b239ab25ff0765250912735e04b47429..8573ce3391fa581fe60cfb5cf5e061027d93b3f5 100644
--- a/test/cctest/test-parsing.cc
+++ b/test/cctest/test-parsing.cc
@@ -5539,6 +5539,7 @@ TEST(ComputedPropertyNameShorthandError) {
TEST(BasicImportExportParsing) {
i::FLAG_harmony_modules = true;
+ // clang-format off
const char* kSources[] = {
"export let x = 0;",
"export var y = 0;",
@@ -5550,7 +5551,11 @@ TEST(BasicImportExportParsing) {
"var a, b, c; export { a, b as baz, c };",
"var d, e; export { d as dreary, e, };",
"export default function f() {}",
+ "export default function() {}",
+ "export default function*() {}",
"export default class C {}",
+ "export default class {}"
+ "export default class extends C {}"
"export default 42",
"var x; export default x = 7",
"export { Q } from 'somemodule.js';",
@@ -5577,6 +5582,7 @@ TEST(BasicImportExportParsing) {
"import { static as s } from 'm.js';",
"import { let as l } from 'm.js';",
};
+ // clang-format on
i::Isolate* isolate = CcTest::i_isolate();
i::Factory* factory = isolate->factory();
@@ -5633,6 +5639,7 @@ TEST(BasicImportExportParsing) {
TEST(ImportExportParsingErrors) {
i::FLAG_harmony_modules = true;
+ // clang-format off
const char* kErrorSources[] = {
"export {",
"var a; export { a",
@@ -5661,6 +5668,10 @@ TEST(ImportExportParsingErrors) {
"var a, b; export { a as c, b as c };",
"export default function f(){}; export default class C {};",
"export default function f(){}; var a; export { a as default };",
+ "export function() {}",
+ "export function*() {}",
+ "export class {}",
+ "export class extends C {}",
"import from;",
"import from 'm.js';",
@@ -5689,11 +5700,8 @@ TEST(ImportExportParsingErrors) {
"import * as x, * as y from 'm.js';",
"import {x}, {y} from 'm.js';",
"import * as x, {y} from 'm.js';",
-
- // TODO(ES6): These two forms should be supported
- "export default function() {};",
- "export default class {};"
};
+ // clang-format on
i::Isolate* isolate = CcTest::i_isolate();
i::Factory* factory = isolate->factory();
« 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