fix: JS backend compiles print() to console.log()
Bare `print()` calls in Lux now emit `console.log()` in JS output instead of undefined `print()`. Fixes BUG-006. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1066,6 +1066,10 @@ impl JsBackend {
|
||||
let arg = self.emit_expr(&args[0])?;
|
||||
return Ok(format!("String({})", arg));
|
||||
}
|
||||
if ident.name == "print" {
|
||||
let arg = self.emit_expr(&args[0])?;
|
||||
return Ok(format!("console.log({})", arg));
|
||||
}
|
||||
}
|
||||
|
||||
let arg_strs: Result<Vec<_>, _> = args.iter().map(|a| self.emit_expr(a)).collect();
|
||||
|
||||
Reference in New Issue
Block a user