Ensure that programs always return strings

Fixes #1838
This commit is contained in:
Nils Knappmeier
2023-08-06 17:22:32 +02:00
parent 520e1d5f08
commit b0c01541e2
2 changed files with 22 additions and 1 deletions
@@ -308,7 +308,7 @@ JavaScriptCompiler.prototype = {
if (appendOnly) {
if (bufferStart) {
bufferStart.prepend('return ');
bufferStart.prepend('return "" + ');
bufferEnd.add(';');
} else if (!sourceSeen) {
this.source.push('return "";');