mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-25 22:34:56 +00:00
code: nextjs,frontends,with (2 files)
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import type { LuaExecutionContext, LuaExecutionResult } from '../types'
|
||||
import type { SandboxedLuaEngine } from '../../sandboxed-lua-engine'
|
||||
import type { SandboxedLuaEngineState } from './types'
|
||||
|
||||
/**
|
||||
* Execute Lua code with a timeout guard
|
||||
*/
|
||||
export function executeWithTimeout(
|
||||
this: SandboxedLuaEngine,
|
||||
this: SandboxedLuaEngineState,
|
||||
code: string,
|
||||
context: LuaExecutionContext
|
||||
): Promise<LuaExecutionResult> {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import * as fengari from 'fengari-web'
|
||||
import type { SandboxedLuaEngine } from '../../sandboxed-lua-engine'
|
||||
import type { SandboxedLuaEngineState } from './types'
|
||||
|
||||
const lua = fengari.lua
|
||||
|
||||
/**
|
||||
* Replace globals with a safe sandbox environment
|
||||
*/
|
||||
export function setupSandboxedEnvironment(this: SandboxedLuaEngine): void {
|
||||
export function setupSandboxedEnvironment(this: SandboxedLuaEngineState): void {
|
||||
if (!this.engine) return
|
||||
|
||||
const { L } = this.engine
|
||||
|
||||
Reference in New Issue
Block a user