diff --git a/packages/hoppscotch-common/src/components/http/InheritedScriptsModal.vue b/packages/hoppscotch-common/src/components/http/InheritedScriptsModal.vue index b7f4d33f..3e3b8c28 100644 --- a/packages/hoppscotch-common/src/components/http/InheritedScriptsModal.vue +++ b/packages/hoppscotch-common/src/components/http/InheritedScriptsModal.vue @@ -46,10 +46,7 @@ class="!absolute right-2 top-2 z-10" @click="copyScriptContent(displayedScript)" /> -
+
diff --git a/packages/hoppscotch-common/src/helpers/RequestRunner.ts b/packages/hoppscotch-common/src/helpers/RequestRunner.ts index 2252b421..299d2f83 100644 --- a/packages/hoppscotch-common/src/helpers/RequestRunner.ts +++ b/packages/hoppscotch-common/src/helpers/RequestRunner.ts @@ -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 { diff --git a/packages/hoppscotch-js-sandbox/src/cage-modules/scripting-modules.ts b/packages/hoppscotch-js-sandbox/src/cage-modules/scripting-modules.ts index 9be183f4..342b497b 100644 --- a/packages/hoppscotch-js-sandbox/src/cage-modules/scripting-modules.ts +++ b/packages/hoppscotch-js-sandbox/src/cage-modules/scripting-modules.ts @@ -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).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)