Another variant of export added - export {Name}. (#1737)
This commit is contained in:
committed by
Alex Lam S.L
parent
66e9039350
commit
a729c43e87
45
lib/parse.js
45
lib/parse.js
@@ -2294,26 +2294,35 @@ function parse($TEXT, options) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (exported_names) {
|
if (exported_names) {
|
||||||
expect_token("name", "from");
|
if (is("name", "from")) {
|
||||||
|
next();
|
||||||
|
|
||||||
var mod_str = S.token;
|
var mod_str = S.token;
|
||||||
if (mod_str.type !== 'string') {
|
if (mod_str.type !== 'string') {
|
||||||
unexpected();
|
unexpected();
|
||||||
|
}
|
||||||
|
next();
|
||||||
|
|
||||||
|
return new AST_Export({
|
||||||
|
start: start,
|
||||||
|
is_default: is_default,
|
||||||
|
exported_names: exported_names,
|
||||||
|
module_name: new AST_String({
|
||||||
|
start: mod_str,
|
||||||
|
value: mod_str.value,
|
||||||
|
quote: mod_str.quote,
|
||||||
|
end: mod_str,
|
||||||
|
}),
|
||||||
|
end: prev(),
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
return new AST_Export({
|
||||||
|
start: start,
|
||||||
|
is_default: is_default,
|
||||||
|
exported_names: exported_names,
|
||||||
|
end: prev(),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
next();
|
|
||||||
|
|
||||||
return new AST_Export({
|
|
||||||
start: start,
|
|
||||||
is_default: is_default,
|
|
||||||
exported_names: exported_names,
|
|
||||||
module_name: new AST_String({
|
|
||||||
start: mod_str,
|
|
||||||
value: mod_str.value,
|
|
||||||
quote: mod_str.quote,
|
|
||||||
end: mod_str,
|
|
||||||
}),
|
|
||||||
end: prev(),
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var is_definition =
|
var is_definition =
|
||||||
|
|||||||
@@ -204,8 +204,9 @@ export_module_statement: {
|
|||||||
export * from "a.js";
|
export * from "a.js";
|
||||||
export {A} from "a.js";
|
export {A} from "a.js";
|
||||||
export {A, B} 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: {
|
import_statement_mangling: {
|
||||||
|
|||||||
Reference in New Issue
Block a user