Skip to content

API Host ScriptProxy

Liu.Yandong.Hanks edited this page Aug 21, 2026 · 3 revisions

ScriptProxy

Runtime proxy object that delegates get/set/delete behavior to script closure handlers.

Namespace: AuroraScript.Runtime.Types. Kind: class.

Back to .NET Host API Reference

Overview

Runtime proxy object that delegates get/set/delete behavior to script closure handlers.

The options object expects script closures named get, set, or unset.

Quick Reference

A minimal use of ScriptProxy.

@module(MAIN);

export func run() {
    var target = { value: 42 };
    return new Proxy(target, {
        get: (obj, key) => obj[key]
    });
}

Constructors

ScriptProxy(ScriptObject target, ScriptObject options)

Creates a ScriptProxy instance.

ScriptProxy(ScriptObject target, ScriptObject options)

Parameters

Name Type Required Description
target ScriptObject Yes Object whose operations are intercepted.
options ScriptObject Yes Initial options copied into the new instance.

Returns

A new ScriptProxy instance.

Methods

Define

void Define(string key, ScriptObject value, bool writeable = true, bool enumerable = true)
void Define(string key, ScriptDatum value, bool writeable = true, bool enumerable = true)
  • void Define(string key, ScriptObject value, bool writeable = true, bool enumerable = true)
  • void Define(string key, ScriptDatum value, bool writeable = true, bool enumerable = true)

Parameters

Name Type Required Description
key string Yes Key to look up or store.
value ScriptObject / ScriptDatum Yes Property value to define on the proxy.
writeable bool No The bool parameter required by the signature.
enumerable bool No Whether the member participates in enumeration.

Returns

None.

Clone this wiki locally