Reduce inlining verbosity

With debug info and source maps in place there is not much value anymore in emitting explicitly named blocks.
This commit is contained in:
dcodeIO
2018-11-12 14:54:08 +01:00
parent 04a0cb8de7
commit d62d84521e
18 changed files with 2626 additions and 3055 deletions

View File

@ -5492,7 +5492,11 @@ export class Compiler extends DiagnosticEmitter {
);
return module.createUnreachable();
}
return module.createBlock(returnLabel, body, returnType.toNativeType());
return flow.is(FlowFlags.RETURNS)
? module.createBlock(returnLabel, body, returnType.toNativeType())
: body.length > 1
? module.createBlock(null, body, returnType.toNativeType())
: body[0];
}
/** Gets the trampoline for the specified function. */