API-Version: 1.9

Function

new Function()

Standard javascript Function object with additional methods

Source:

Methods

debug(info)

Convenience method to print debug messages, wraps the function into a try/catch statement

Parameters:
Name Type Argument Description
info Object <optional>

Arguments passed to io.debug, the recommended argument is script

Source:
Example
 
//!javascript

function onNavigation() {
     var x = y;
};
Signal.connect("navigation", onNavigation.debug(script));

// Debug message:
==> DEBUG [FILE]       : /path/to/script.js
==> DEBUG [ERROR]      : Error in line 4: Can't find variable: y
==> DEBUG [STACK]      : [onNavigation] [[native code]] [value] [[native code]]
==> DEBUG [SOURCE]
    ...
    4 > function onNavigation( {
--> 5 >     var x = y;
    6 > }
    ...