| 143 | } |
| 144 | |
| 145 | void JSDebuggerConnection::setTargetList(const Valdi::StringBox& message) { |
| 146 | auto convertedValue = Valdi::jsonToValue(message.toStringView()); |
| 147 | |
| 148 | if (!convertedValue) { |
| 149 | VALDI_ERROR( |
| 150 | Valdi::ConsoleLogger::getLogger(), "[JSDebugger] Failed to parse message: {}", convertedValue.error()); |
| 151 | return; |
| 152 | } |
| 153 | |
| 154 | auto* items = convertedValue.value().getArray(); |
| 155 | if (items == nullptr || items->empty()) { |
| 156 | _targetId = 0; |
| 157 | return; |
| 158 | } |
| 159 | |
| 160 | // TODO(simon): This is hardcoded to expose just a single target. |
| 161 | // If we wanted to support multiple targets, we would have to make |
| 162 | // the external proxy protocol aware of target ids. |
| 163 | _targetId = (*items)[0].getMapValue("targetID").toInt(); |
| 164 | } |
| 165 | |
| 166 | int JSDebuggerConnection::getTargetId() const { |
| 167 | return _targetId; |
nothing calls this directly
no test coverage detected