Skip to content

Commit d4e3a90

Browse files
committed
engine/function: catch thread errors in finalizer
It appears that the JavaScript context cannot be called from a finalizer. For now, catch these errors.
1 parent d64b1ef commit d4e3a90

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lib/handlebars/engine/function.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ def call(*args)
1616

1717
def self.finalizer(context, name)
1818
proc {
19-
context.eval("delete #{name}")
19+
begin
20+
context.eval("delete #{name}")
21+
rescue ThreadError # rubocop:disable Lint/SuppressedException
22+
end
2023
}
2124
end
2225
end

0 commit comments

Comments
 (0)