allow export { default } from "foo"
This commit is contained in:
parent
98691e5b80
commit
f48a921e24
2
acorn.js
2
acorn.js
@ -2524,7 +2524,7 @@
|
||||
} else first = false;
|
||||
|
||||
var node = startNode();
|
||||
node.id = parseIdent();
|
||||
node.id = parseIdent(tokType === _default);
|
||||
if (tokType === _name && tokVal === "as") {
|
||||
next();
|
||||
node.name = parseIdent(true);
|
||||
|
||||
@ -5064,6 +5064,59 @@ test("export { encrypt, decrypt as dec }", {
|
||||
locations: true
|
||||
});
|
||||
|
||||
test("export { default } from \"other\"", {
|
||||
type: "Program",
|
||||
body: [{
|
||||
type: "ExportDeclaration",
|
||||
declaration: null,
|
||||
specifiers: [
|
||||
{
|
||||
type: "ExportSpecifier",
|
||||
id: {
|
||||
type: "Identifier",
|
||||
name: "default",
|
||||
loc: {
|
||||
start: {line: 1, column: 9},
|
||||
end: {line: 1, column: 16}
|
||||
}
|
||||
},
|
||||
name: null,
|
||||
loc: {
|
||||
start: {line: 1, column: 9},
|
||||
end: {line: 1, column: 16}
|
||||
}
|
||||
}
|
||||
],
|
||||
source: {
|
||||
type: "Literal",
|
||||
loc: {
|
||||
start: {
|
||||
line: 1,
|
||||
column: 24
|
||||
},
|
||||
end: {
|
||||
line: 1,
|
||||
column: 31
|
||||
}
|
||||
},
|
||||
value: "other",
|
||||
raw: "\"other\""
|
||||
},
|
||||
loc: {
|
||||
start: {line: 1, column: 0},
|
||||
end: {line: 1, column: 31}
|
||||
}
|
||||
}],
|
||||
loc: {
|
||||
start: {line: 1, column: 0},
|
||||
end: {line: 1, column: 31}
|
||||
}
|
||||
}, {
|
||||
ecmaVersion: 6,
|
||||
ranges: true,
|
||||
locations: true
|
||||
});
|
||||
|
||||
test("import \"jquery\"", {
|
||||
type: "Program",
|
||||
body: [{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user