Another variant of export added - export {Name}. (#1737)

This commit is contained in:
Ondřej Španěl
2017-03-31 11:51:27 +02:00
committed by Alex Lam S.L
parent 66e9039350
commit a729c43e87
2 changed files with 29 additions and 19 deletions

View File

@@ -2294,7 +2294,8 @@ function parse($TEXT, options) {
}
if (exported_names) {
expect_token("name", "from");
if (is("name", "from")) {
next();
var mod_str = S.token;
if (mod_str.type !== 'string') {
@@ -2314,6 +2315,14 @@ function parse($TEXT, options) {
}),
end: prev(),
});
} else {
return new AST_Export({
start: start,
is_default: is_default,
exported_names: exported_names,
end: prev(),
});
}
}
var is_definition =

View File

@@ -204,8 +204,9 @@ export_module_statement: {
export * from "a.js";
export {A} from "a.js";
export {A, B} from "a.js";
export {C};
}
expect_exact: 'export*from"a.js";export{A}from"a.js";export{A,B}from"a.js";'
expect_exact: 'export*from"a.js";export{A}from"a.js";export{A,B}from"a.js";export{C};'
}
import_statement_mangling: {