diff --git a/examples/jsm/nodes/transpiler/TSLEncoder.js b/examples/jsm/nodes/transpiler/TSLEncoder.js index bbe6af694c730c..0427705fb11702 100644 --- a/examples/jsm/nodes/transpiler/TSLEncoder.js +++ b/examples/jsm/nodes/transpiler/TSLEncoder.js @@ -241,7 +241,11 @@ class TSLEncoder { for ( const statement of body ) { code += this.emitExtraLine( statement ); - code += this.tab + this.emitExpression( statement ) + ';\n'; + code += this.tab + this.emitExpression( statement ) + + if ( code.slice( - 1 ) !== '}' ) code += ';'; + + code += '\n'; this.setLastStatement( statement );