mirror of
https://github.com/centau/vide.git
synced 2026-10-20 17:34:08 +00:00
Merge a77c552658 into a4151bd41e
This commit is contained in:
commit
97a835aafc
2 changed files with 13 additions and 3 deletions
|
|
@ -21,10 +21,11 @@ export type Node<T> = {
|
||||||
|
|
||||||
local scopes = { n = 0 } :: { [number]: Node<any>, n: number } -- scopes stack
|
local scopes = { n = 0 } :: { [number]: Node<any>, n: number } -- scopes stack
|
||||||
|
|
||||||
local function efn(err: string)
|
local function efn(err: unknown)
|
||||||
local trace = debug.traceback(err, 2)
|
local message = tostring(err)
|
||||||
|
local trace = debug.traceback(message, 2)
|
||||||
|
|
||||||
if string.find(err, "^effect error stacktrace") then -- if effect error is nested
|
if string.find(message, "^effect error stacktrace") then -- if effect error is nested
|
||||||
trace = string.gsub(" " .. trace, "\n", function() -- indent entire error
|
trace = string.gsub(" " .. trace, "\n", function() -- indent entire error
|
||||||
return "\n "
|
return "\n "
|
||||||
end)
|
end)
|
||||||
|
|
|
||||||
|
|
@ -3047,6 +3047,15 @@ TEST("strict", wrap_root(function()
|
||||||
CHECK(not ok)
|
CHECK(not ok)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
do CASE "error with a non-string value"
|
||||||
|
local ok, err = pcall(effect, function()
|
||||||
|
error({})
|
||||||
|
end)
|
||||||
|
|
||||||
|
CHECK(not ok)
|
||||||
|
CHECK(string.find(err, "table: "))
|
||||||
|
end
|
||||||
|
|
||||||
do CASE "duplicate properties"
|
do CASE "duplicate properties"
|
||||||
local ok = pcall(function()
|
local ok = pcall(function()
|
||||||
create "TextLabel" {
|
create "TextLabel" {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue