Nasal library/debug: Difference between revisions

Jump to navigation Jump to search
→‎Functions: Doc backtrace() and bt()
(→‎Functions: Doc backtrace() and bt())
Line 37: Line 37:


=== backtrace() ===
=== backtrace() ===
{{Nasal doc
|syntax = debug.backtrace([desc]);
|text = When called, this function prints the {{wikipedia|backtrace}}, also printing the local variables at each level.
|param1 = desc
|param1text = Optional extra description to add.
|example1 = var myFunc = func(a){
    multiply(a, 2);
}
var multiply = func(x, y){
    debug.backtrace();
}
myFunc(2);
|example2 = var myFunc = func(a){
    multiply(a, 2);
}
var multiply = func(x, y){
    debug.backtrace("multiply() function");
}
myFunc(2);
}}
=== bt() ===
=== bt() ===
{{Nasal doc
|syntax = debug.bt([desc]);
|text = Shortcut for {{func link|backtrace()|page=this}}. See doc there
}}
=== benchmark() ===
=== benchmark() ===
=== benchmark_time() ===
=== benchmark_time() ===

Navigation menu