Package: purescript-lua-console
File: src/Effect/Console.lua
Function: error
Class: semantics Severity: low
Upstream purescript-console maps error :: String -> Effect Unit to console.error, which writes to stderr in Node. The Lua FFI routes it through print, which writes to stdout. Consumers that separate stdout/stderr (the normal reason to call error rather than log) will see error output mixed into stdout, losing the only behavioral distinction error has from log in this port. Confirmed under Lua 5.1: C.error("err-msg")() emits to stdout, not stderr.
Current (Lua):
error = (function(s) return function() print(s) end end),
Expected: console.error writes to stderr; the Lua equivalent is io.stderr:write(s .. "\n"). print() unconditionally targets stdout.
Proposed fix:
error = (function(s) return function() io.stderr:write(tostring(s) .. "\n") end end),
Found by the FFI audit; reproduced under Lua 5.1.
Package: purescript-lua-console
File:
src/Effect/Console.luaFunction:
errorClass: semantics Severity: low
Upstream purescript-console maps
error :: String -> Effect Unittoconsole.error, which writes to stderr in Node. The Lua FFI routes it throughprint, which writes to stdout. Consumers that separate stdout/stderr (the normal reason to callerrorrather thanlog) will see error output mixed into stdout, losing the only behavioral distinctionerrorhas fromlogin this port. Confirmed under Lua 5.1:C.error("err-msg")()emits to stdout, not stderr.Current (Lua):
Expected: console.error writes to stderr; the Lua equivalent is io.stderr:write(s .. "\n"). print() unconditionally targets stdout.
Proposed fix:
Found by the FFI audit; reproduced under Lua 5.1.