mirror of
https://github.com/typst/typst
synced 2025-07-02 02:02:53 +08:00
fix local sink on call
warnings now get tracepoints
This commit is contained in:
parent
3823f560c5
commit
26ae1d3c27
@ -171,16 +171,16 @@ impl Eval for ast::FuncCall<'_> {
|
|||||||
// part of the call stack that led to the warning being raised,
|
// part of the call stack that led to the warning being raised,
|
||||||
// thus allowing suppression of the warning through this call.
|
// thus allowing suppression of the warning through this call.
|
||||||
let mut local_sink = Sink::new();
|
let mut local_sink = Sink::new();
|
||||||
let previous_sink =
|
let mut engine = Engine {
|
||||||
std::mem::replace(&mut vm.engine.sink, local_sink.track_mut());
|
sink: local_sink.track_mut(),
|
||||||
|
route: vm.engine.route.clone(),
|
||||||
|
..vm.engine
|
||||||
|
};
|
||||||
|
|
||||||
let call_result = func.call(&mut vm.engine, vm.context, args).trace(
|
let call_result =
|
||||||
vm.world(),
|
func.call(&mut engine, vm.context, args)
|
||||||
point,
|
.trace(vm.world(), point, span);
|
||||||
span,
|
|
||||||
);
|
|
||||||
|
|
||||||
std::mem::replace(&mut vm.engine.sink, previous_sink);
|
|
||||||
local_sink.trace_warnings(vm.world(), point, span);
|
local_sink.trace_warnings(vm.world(), point, span);
|
||||||
|
|
||||||
// Push the accumulated warnings and other fields back to the
|
// Push the accumulated warnings and other fields back to the
|
||||||
|
Loading…
x
Reference in New Issue
Block a user