(e)
| 215 | } |
| 216 | |
| 217 | function onCodeInput(e) { |
| 218 | const key = e.key; |
| 219 | isFocused = true; |
| 220 | if (key === "Enter") { |
| 221 | const regex = /[\[|{\(\)\}\]]/g; |
| 222 | let code = this.value.trim(); |
| 223 | let isOdd = (code.length - code.replace(regex, "").length) % 2; |
| 224 | |
| 225 | if (!code || isOdd) return; |
| 226 | e.preventDefault(); |
| 227 | e.stopPropagation(); |
| 228 | e.stopImmediatePropagation(); |
| 229 | |
| 230 | log("code", {}, code); |
| 231 | $input.value = ""; |
| 232 | const res = execute(code); |
| 233 | if (res.type === "error") { |
| 234 | log("error", getStack(new Error()), res.value); |
| 235 | } else { |
| 236 | log("log", getStack(new Error()), res.value); |
| 237 | } |
| 238 | } |
| 239 | } |
| 240 | |
| 241 | function getBody(obj, ...keys) { |
| 242 | if (obj instanceof Promise && !("[[PromiseStatus]]" in obj)) |
nothing calls this directly
no test coverage detected