Package: purescript-lua-exceptions
File: src/Effect/Exception.lua
Function: name
Class: semantics Severity: medium
PureScript name :: Error -> String returns the error's name, falling back to 'Error' (JS: e.name || "Error"). For an Error built with error msg, the JS result is the constant 'Error'. In this Lua FFI an Error is just the message string and there is no name field, but name is implemented as identity, so name (error "boom") returns 'boom' instead of 'Error'. This is a direct behavioural divergence from the documented contract ('Get the error name when defined, or fallback to Error').
Current (Lua):
name = (function(err) return err end)
Expected: name (error msg) should be the constant "Error" (the JS fallback), since the string Error model carries no distinct name.
Proposed fix:
Return the constant: `name = (function(_err) return "Error" end)`.
Found by the FFI audit; reproduced under Lua 5.1.
Package: purescript-lua-exceptions
File:
src/Effect/Exception.luaFunction:
nameClass: semantics Severity: medium
PureScript
name :: Error -> Stringreturns the error's name, falling back to 'Error' (JS:e.name || "Error"). For an Error built witherror msg, the JS result is the constant 'Error'. In this Lua FFI an Error is just the message string and there is no name field, butnameis implemented as identity, soname (error "boom")returns 'boom' instead of 'Error'. This is a direct behavioural divergence from the documented contract ('Get the error name when defined, or fallback to Error').Current (Lua):
Expected: name (error msg) should be the constant "Error" (the JS fallback), since the string Error model carries no distinct name.
Proposed fix:
Found by the FFI audit; reproduced under Lua 5.1.