chore: formatting updates
This commit is contained in:
parent
50fd27564e
commit
bb1c9a9fe9
3 changed files with 15 additions and 25 deletions
|
|
@ -46,10 +46,7 @@
|
|||
class="!absolute right-2 top-2 z-10"
|
||||
@click="copyScriptContent(displayedScript)"
|
||||
/>
|
||||
<div
|
||||
ref="scriptEditor"
|
||||
class="flex-1 overflow-auto"
|
||||
></div>
|
||||
<div ref="scriptEditor" class="flex-1 overflow-auto"></div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -27,10 +27,7 @@ import { map } from "fp-ts/Either"
|
|||
import { runPreRequestScript, runTestScript } from "@hoppscotch/js-sandbox/web"
|
||||
import { useSetting } from "~/composables/settings"
|
||||
import { getService } from "~/modules/dioc"
|
||||
import {
|
||||
combineScriptsWithIIFE,
|
||||
hasActualScript,
|
||||
} from "~/helpers/scripting"
|
||||
import { combineScriptsWithIIFE, hasActualScript } from "~/helpers/scripting"
|
||||
import { createHoppFetchHook } from "~/helpers/hopp-fetch"
|
||||
import { KernelInterceptorService } from "~/services/kernel-interceptor.service"
|
||||
import {
|
||||
|
|
|
|||
|
|
@ -481,24 +481,20 @@ const createScriptingModule = (
|
|||
// calls cross the QuickJS boundary before the script returns, so the
|
||||
// host sees the error without relying on faraday-cage's loop behaviour.
|
||||
;(inputsObj as Record<string, unknown>).setScriptExecutionError =
|
||||
defineSandboxFn(
|
||||
ctx,
|
||||
"setScriptExecutionError",
|
||||
(error: unknown) => {
|
||||
if (!captureHook || captureHook.scriptExecutionError) return
|
||||
const err = (error ?? {}) as {
|
||||
name?: unknown
|
||||
message?: unknown
|
||||
stack?: unknown
|
||||
}
|
||||
captureHook.scriptExecutionError = {
|
||||
name: typeof err.name === "string" ? err.name : "",
|
||||
message:
|
||||
typeof err.message === "string" ? err.message : String(error),
|
||||
stack: typeof err.stack === "string" ? err.stack : "",
|
||||
}
|
||||
defineSandboxFn(ctx, "setScriptExecutionError", (error: unknown) => {
|
||||
if (!captureHook || captureHook.scriptExecutionError) return
|
||||
const err = (error ?? {}) as {
|
||||
name?: unknown
|
||||
message?: unknown
|
||||
stack?: unknown
|
||||
}
|
||||
)
|
||||
captureHook.scriptExecutionError = {
|
||||
name: typeof err.name === "string" ? err.name : "",
|
||||
message:
|
||||
typeof err.message === "string" ? err.message : String(error),
|
||||
stack: typeof err.stack === "string" ? err.stack : "",
|
||||
}
|
||||
})
|
||||
|
||||
const sandboxInputsObj = defineSandboxObject(ctx, inputsObj)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue