Editing and debugging JavaScript

To validate JavaScript code, select Debug | Start. The result of the validation appears in the Tasks tab

The JavaScript Editor offers efficient features to trace the execution of a script. You can step through a code line-by-line or step through from one breakpoint to another. At any time, you can check the current value of a variable.

NoteA comment line starts with two forward slashes // at the beginning of the line.

StepsStepping through the code

NoteThe JavaScript Editor and Debugger works without input data at the input port of the component. However, for best results, populate the input port with data before using the debugging features.

  1. Validate the script or switch to the debug mode.

    A green arrow, pointing initially to line 1, indicates the progress of the execution while stepping.

  2. Make sure the result message in the Task tab displays “Successful compilation”.

  3. To move to the next line, click the Step icon on the toolbar.

    At any point during stepping you can inspect the variable name and the current value. To do so, select the variable in the Navigator and right-click.

StepsAdd and removing breakpoints

Rather than stepping through the procedure line-by-line, include Breakpoints at selected lines.

  1. To include or remove breakpoints, click the line where you want to set the Breakpoint.

  2. Right-click and select Add/Remove breakpoint.

StepsStepping to a breakpoint

  1. Click the Go icon on the toolbar for each step.

  2. Click the Go icon on the last breakpoint to execute the rest of the script.