exprReturn

This commit is contained in:
HEIHUAa
2026-04-01 23:56:02 +08:00
parent 04dc3ad1ba
commit 7abbdcce3a
+23 -24
View File
@@ -568,34 +568,33 @@ class Interp {
function exprReturn(e):Dynamic {
try {
try {
return expr(e);
} catch (e:Stop) {
switch (e) {
case SBreak:
throw "Invalid break";
case SContinue:
throw "Invalid continue";
case SReturn:
var v = returnValue;
returnValue = null;
return v;
}
} catch(e) {
if(printCallStack)
error(ECustom('${e.toString()}\n${CallStack.toString(CallStack.exceptionStack(true))}'));
else
error(ECustom(e.toString()));
return null;
return expr(e);
} catch (e:Stop) {
switch (e) {
case SBreak:
throw "Invalid break";
case SContinue:
throw "Invalid continue";
case SReturn:
var v = returnValue;
returnValue = null;
return v;
}
} catch(e:Error) {
if (errorHandler != null)
} catch (e:Error) {
if (errorHandler != null) {
errorHandler(e);
else
} else {
throw e;
}
return null;
} catch (e:Dynamic) {
if (printCallStack) {
var stack = CallStack.exceptionStack(true);
error(ECustom(Std.string(e) + "\n" + CallStack.toString(stack)));
} else {
error(ECustom(Std.string(e)));
}
return null;
} catch(e) {
trace(e);
}
return null;
}