mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
Fixes #612 - Compile error when class method has empty return
This commit is contained in:
parent
80628146ad
commit
a4032b7e95
@ -8,7 +8,6 @@ function parseExpression(src, builder, isExpression) {
|
||||
ok(builder, '"builder" is required');
|
||||
|
||||
function convert(node) {
|
||||
|
||||
if (Array.isArray(node)) {
|
||||
let nodes = node;
|
||||
for (let i=0; i<nodes.length; i++) {
|
||||
@ -203,9 +202,13 @@ function parseExpression(src, builder, isExpression) {
|
||||
return builder.property(key, value);
|
||||
}
|
||||
case 'ReturnStatement': {
|
||||
let argument = convert(node.argument);
|
||||
if (!argument) {
|
||||
return null;
|
||||
var argument = node.argument;
|
||||
|
||||
if (argument != null) {
|
||||
argument = convert(node.argument);
|
||||
if (!argument) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return builder.returnStatement(argument);
|
||||
|
||||
@ -0,0 +1 @@
|
||||
TBD
|
||||
@ -0,0 +1,8 @@
|
||||
class {
|
||||
test(e) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
<div class="test">
|
||||
</div>
|
||||
Loading…
x
Reference in New Issue
Block a user