mirror of
https://github.com/centau/vide.git
synced 2026-10-20 17:34:08 +00:00
Merge branch 'main' of https://github.com/vvacillator/vide
This commit is contained in:
commit
0727ea91bc
2 changed files with 10 additions and 23 deletions
|
|
@ -97,26 +97,6 @@ export type Instances = {
|
|||
ViewportFrame: ViewportFrame,
|
||||
Camera: Camera,
|
||||
WorldModel: WorldModel,
|
||||
|
||||
-- interaction
|
||||
ProximityPrompt: ProximityPrompt,
|
||||
|
||||
-- value objs
|
||||
BoolValue: BoolValue,
|
||||
IntValue: IntValue,
|
||||
NumberValue: NumberValue,
|
||||
StringValue: StringValue,
|
||||
ObjectValue: ObjectValue,
|
||||
ColorValue: Color3Value,
|
||||
VectorValue: Vector3Value,
|
||||
CFrameValue: CFrameValue,
|
||||
|
||||
-- styling
|
||||
StyleSheet: StyleSheet,
|
||||
StyleRule: StyleRule,
|
||||
StyleDerive: StyleDerive,
|
||||
StyleLink: StyleLink,
|
||||
StyleQuery: StyleQuery,
|
||||
}
|
||||
|
||||
export type function Properties(instance: type?)
|
||||
|
|
|
|||
|
|
@ -31,7 +31,14 @@ local function efn(err: string)
|
|||
end
|
||||
|
||||
trace ..= "\nsource update stacktrace:"
|
||||
return trace
|
||||
return trace
|
||||
end
|
||||
|
||||
local function effect_traceback(err: unknown): string
|
||||
local message = tostring(err)
|
||||
-- Nested effect error already has full thread stack
|
||||
if string.find(message, "^effect error:\n") then return message end
|
||||
return `effect error:\n{debug.traceback(message, 2)}`
|
||||
end
|
||||
|
||||
local function ycall<T, U>(fn: (T) -> U, arg: T): (boolean, string|U)
|
||||
|
|
@ -181,13 +188,13 @@ local function evaluate_node<T>(node: Node<T>)
|
|||
destroy_owned(node)
|
||||
|
||||
push_scope(node)
|
||||
local ok, new_value = pcall(node.effect :: (T) -> T, node.cache)
|
||||
local ok, new_value = xpcall(node.effect :: (T) -> T, effect_traceback, node.cache)
|
||||
pop_scope()
|
||||
|
||||
if not ok then
|
||||
table.clear(update_queue)
|
||||
update_queue.n = 0
|
||||
error(`effect error:\n{new_value}\n`, 0)
|
||||
error(new_value, 0)
|
||||
end
|
||||
|
||||
node.cache = new_value
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue