chore: formatting updates

This commit is contained in:
James George 2026-04-28 00:50:16 +05:30
parent 50fd27564e
commit bb1c9a9fe9
3 changed files with 15 additions and 25 deletions

View file

@ -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>

View file

@ -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 {

View file

@ -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)