| 1 | name = "condition";
|
|---|
| 2 |
|
|---|
| 3 | group = "breakpoints";
|
|---|
| 4 |
|
|---|
| 5 | shortDescription = "Specify breakpoint condition";
|
|---|
| 6 |
|
|---|
| 7 | longDescription = "condition <breakpoint-id> <expression> : Specify that the breakpoint with the given id should only be triggered if the given expression evaluates to true.";
|
|---|
| 8 |
|
|---|
| 9 | argumentTypes = [ "breakpoint-id", "script" ];
|
|---|
| 10 |
|
|---|
| 11 | seeAlso = [ "ignore" ];
|
|---|
| 12 |
|
|---|
| 13 | function execute() {
|
|---|
| 14 | if (arguments.length == 0) {
|
|---|
| 15 | message("Missing arguments (breakpoint number and condition).");
|
|---|
| 16 | return;
|
|---|
| 17 | }
|
|---|
| 18 | var arg = arguments[0];
|
|---|
| 19 | var spaceIndex = arg.indexOf(' ');
|
|---|
| 20 | if (spaceIndex == -1)
|
|---|
| 21 | spaceIndex = arg.length;
|
|---|
| 22 | var id = parseInt(arg.slice(0, spaceIndex));
|
|---|
| 23 | if (isNaN(id)) {
|
|---|
| 24 | message("First argument must be a number (breakpoint id).");
|
|---|
|
|---|