(breakpoint, x, y)
| 49 | } from "piu/Switches"; |
| 50 | |
| 51 | export function EditBreakpoint(breakpoint, x, y) { |
| 52 | const $ = { |
| 53 | breakpoint, x, y, |
| 54 | enabled: { |
| 55 | get value() { |
| 56 | return breakpoint.enabled; |
| 57 | }, |
| 58 | set value(it) { |
| 59 | if (breakpoint.path) |
| 60 | model.doEnableDisableBreakpoint(breakpoint.path, breakpoint.line); |
| 61 | else |
| 62 | breakpoint.enabled = it; |
| 63 | } |
| 64 | }, |
| 65 | name: { |
| 66 | get value() { |
| 67 | return breakpoint.path ?? ""; |
| 68 | }, |
| 69 | set value(name) { |
| 70 | if (breakpoint.path) |
| 71 | model.doRemoveBreakpoint(breakpoint); |
| 72 | breakpoint.path = breakpoint.name = name; |
| 73 | if (breakpoint.path) { |
| 74 | const former = model.breakpoints.items.find(it => (it.line == 0) && (it.path == name)); |
| 75 | if (former) |
| 76 | model.doRemoveBreakpoint(former); |
| 77 | model.doAddBreakpoint(breakpoint); |
| 78 | } |
| 79 | $.CLEAR.visible = breakpoint.path ? true : false; |
| 80 | } |
| 81 | }, |
| 82 | condition: { |
| 83 | get value() { |
| 84 | return breakpoint.condition ?? ""; |
| 85 | }, |
| 86 | set value(it) { |
| 87 | breakpoint.condition = it; |
| 88 | if (breakpoint.enabled && breakpoint.path) |
| 89 | model.doSetBreakpoint(breakpoint); |
| 90 | application.distribute("onBreakpointsChanged"); |
| 91 | } |
| 92 | }, |
| 93 | hitCount: { |
| 94 | get value() { |
| 95 | return breakpoint.hitCount ?? ""; |
| 96 | }, |
| 97 | set value(it) { |
| 98 | breakpoint.hitCount = it; |
| 99 | if (breakpoint.enabled && breakpoint.path) |
| 100 | model.doSetBreakpoint(breakpoint); |
| 101 | application.distribute("onBreakpointsChanged"); |
| 102 | } |
| 103 | }, |
| 104 | trace: { |
| 105 | get value() { |
| 106 | return breakpoint.trace ?? ""; |
| 107 | }, |
| 108 | set value(it) { |
no test coverage detected