Merge 2aed51a95a into 569757d14d
This commit is contained in:
commit
fe11191808
|
|
@ -773,6 +773,7 @@ function OutputStream(options) {
|
||||||
|| p instanceof AST_Expansion // [...(a, b)]
|
|| p instanceof AST_Expansion // [...(a, b)]
|
||||||
|| p instanceof AST_ForOf && this === p.object // for (e of (foo, bar)) {}
|
|| p instanceof AST_ForOf && this === p.object // for (e of (foo, bar)) {}
|
||||||
|| p instanceof AST_Yield // yield (foo, bar)
|
|| p instanceof AST_Yield // yield (foo, bar)
|
||||||
|
|| p instanceof AST_Export // export default (foo, bar)
|
||||||
;
|
;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -844,7 +845,8 @@ function OutputStream(options) {
|
||||||
|
|
||||||
PARENS(AST_Call, function(output){
|
PARENS(AST_Call, function(output){
|
||||||
var p = output.parent(), p1;
|
var p = output.parent(), p1;
|
||||||
if (p instanceof AST_New && p.expression === this)
|
if (p instanceof AST_New && p.expression === this
|
||||||
|
|| p instanceof AST_Export && p.is_default && this.expression instanceof AST_Function)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// workaround for Safari bug.
|
// workaround for Safari bug.
|
||||||
|
|
|
||||||
|
|
@ -280,6 +280,13 @@ export_default_anonymous_function: {
|
||||||
expect_exact: "export default function(){foo()};"
|
expect_exact: "export default function(){foo()};"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export_default_seq: {
|
||||||
|
input: {
|
||||||
|
export default (1, 2)
|
||||||
|
}
|
||||||
|
expect_exact: "export default(1,2);"
|
||||||
|
}
|
||||||
|
|
||||||
export_default_arrow: {
|
export_default_arrow: {
|
||||||
options = {
|
options = {
|
||||||
reduce_vars: true,
|
reduce_vars: true,
|
||||||
|
|
@ -410,7 +417,7 @@ export_default_anonymous_function_not_call: {
|
||||||
export default function(){}(foo);
|
export default function(){}(foo);
|
||||||
}
|
}
|
||||||
// FIXME: should be `export default function(){};foo;`
|
// FIXME: should be `export default function(){};foo;`
|
||||||
expect_exact: "export default function(){}(foo);"
|
expect_exact: "export default(function(){}(foo));"
|
||||||
}
|
}
|
||||||
|
|
||||||
export_default_anonymous_generator_not_call: {
|
export_default_anonymous_generator_not_call: {
|
||||||
|
|
@ -444,3 +451,10 @@ export_default_anonymous_async_function_not_call: {
|
||||||
// agrees with `acorn` and `babylon 7`
|
// agrees with `acorn` and `babylon 7`
|
||||||
expect_exact: "export default async function(){};foo;"
|
expect_exact: "export default async function(){};foo;"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
issue_2977: {
|
||||||
|
input: {
|
||||||
|
export default (function () {})();
|
||||||
|
}
|
||||||
|
expect_exact: "export default(function(){}());"
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user