runtime
The JavaScript object model and coercion engine: property get/set with prototype-chain walking, arrays, functions, key ordering, `instanceof`, and the `toNumber`/`toStringJs`/`toBoolean`/equality operations the interpreter evaluates against.
runtime
The JavaScript object model and coercion engine: property get/set with prototype-chain walking, arrays, functions, key ordering, instanceof, and the toNumber/toStringJs/toBoolean/equality operations the interpreter evaluates against.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2strict
isObject(v: any) → boolean
| arg | type | description |
|---|---|---|
| v | any |
arrayIndex(key: string) → number
An array-index key is a canonical unsigned integer string < 2^32-1.
| arg | type | description |
|---|---|---|
| key | string |
numberToString(n: number) → string
JS number formatting. Integer-valued magnitudes below 2^53 render without a decimal point; other finite numbers use the shortest %g that round-trips. Integers in [2^53, 1e21) render in %g exponent form here (e.g. "1e+16") where JS renders the full decimal digits.
| arg | type | description |
|---|---|---|
| n | number |
stringToNumber(s: string) → number
ECMAScript StringToNumber for the trimmed numeric grammar: empty is 0, 0x/0o/0b prefixes are integer bases, Infinity is recognised, else a decimal parse; anything left over yields NaN.
| arg | type | description |
|---|---|---|
| s | string |
new( ) → Realm
rawNewObject(proto: any, class: string) → JSObject
| arg | type | description |
|---|---|---|
| proto | any | |
| class | string |
protoFor(name: string) → JSObject
| arg | type | description |
|---|---|---|
| name | string |
newObject(proto: any?) → JSObject
| arg | type | description |
|---|---|---|
| proto | any? |
isArray(v: any) → boolean
| arg | type | description |
|---|---|---|
| v | any |
arrayLength(arr: JSObject) → number
| arg | type | description |
|---|---|---|
| arr | JSObject |
rawSet(obj: JSObject, key: string, value: any) → void
Own-property write that maintains the insertion-ordered key list. Never triggers accessors; used internally where JS assignment semantics do not apply (array element seeding, length bookkeeping).
| arg | type | description |
|---|---|---|
| obj | JSObject | |
| key | string | |
| value | any |
markNonEnumRaw(obj: any, key: string) → void
`nonEnum` allocates lazily: most objects never own a non-enumerable property, so the table exists only from the first mark on.
| arg | type | description |
|---|---|---|
| obj | any | |
| key | string |
rawDelete(obj: JSObject, key: string) → void
| arg | type | description |
|---|---|---|
| obj | JSObject | |
| key | string |
setLengthProp(arr: JSObject, n: number) → void
Write the array's JS length, keeping "length" present in the key list so `hasOwn` and the descriptor machinery still see it. The value is stored in props like any own property; array enumeration skips it (see ownKeys).
| arg | type | description |
|---|---|---|
| arr | JSObject | |
| n | number |
absorbSparse(arr: JSObject) → void
After an append extends the dense boundary, pull any contiguous sparse index properties (a[2] set before a[0]/a[1]) back into the dense region so an out-of-order fill collapses to dense storage.
| arg | type | description |
|---|---|---|
| arr | JSObject |
setArrayLength(arr: JSObject, newLen: number) → void
Apply `arr.length = newLen`. Shrinking drops every element at or above the new length from both the dense region and the sparse tail; growing only moves the length marker (the new tail is holes).
| arg | type | description |
|---|---|---|
| arr | JSObject | |
| newLen | number |
arraySeed(arr: JSObject, values: { any }) → void
Seed a fresh, empty array object with `values` in one pass, filling the dense region directly — O(1) per element.
| arg | type | description |
|---|---|---|
| arr | JSObject | |
| values | { any } |
newArray(luauArr: { any }?) → JSObject
| arg | type | description |
|---|---|---|
| luauArr | { any }? |
newFunction(def: FunctionDef) → JSObject
| arg | type | description |
|---|---|---|
| def | FunctionDef |
defineNative(target: JSObject, name: string, fn: NativeFn, opts: { length: number?, enumerable: boolean? }?) → JSObject
Create a native method from a Luau function and install it on `target`. The method carries own "name"/"length" props and no ".prototype" object, and is non-enumerable unless `opts.enumerable` opts in.
| arg | type | description |
|---|---|---|
| target | JSObject | |
| name | string | |
| fn | NativeFn | |
| opts | { length: number?, enumerable: boolean? }? |
defineGetter(target: JSObject, name: string, fn: NativeFn) → void
Install a non-enumerable accessor whose getter is a native function.
| arg | type | description |
|---|---|---|
| target | JSObject | |
| name | string | |
| fn | NativeFn |
markAccessors(target: any) → void
Accessor bookkeeping consumed by the compiled tier's constructor write fast path: `hasAccessors` marks an object that owns at least one accessor entry, and `accGen` counts every accessor install and every prototype-chain mutation realm-wide. A constructor samples the chain and the generation once at entry; any bump mid-body sends its remaining field writes down the full runtime path.
| arg | type | description |
|---|---|---|
| target | any |
bumpAccGen( ) → void
setIterator(target: any, fn: IteratorFactory) → void
Store an iterator factory on `target` under the internal iterator key, non-enumerably. The factory produces a step function yielding (done, value) pairs.
| arg | type | description |
|---|---|---|
| target | any | |
| fn | IteratorFactory |
getIterator(v: any) → IteratorFactory
Resolve the iterator factory for `v` along its proto chain, or nil when none is present. This is internal plumbing, so a Luau nil result is fine.
| arg | type | description |
|---|---|---|
| v | any |
findEntry(obj: JSObject, key: string) → any
Find the descriptor or value for key along the proto chain, returning the raw stored entry (which may be an accessor descriptor) or nil when absent.
| arg | type | description |
|---|---|---|
| obj | JSObject | |
| key | string |
isAccessor(entry: any) → boolean
| arg | type | description |
|---|---|---|
| entry | any |
get(obj: any, key: string) → any
| arg | type | description |
|---|---|---|
| obj | any | |
| key | string |
set(obj: any, key: string, value: any) → void
| arg | type | description |
|---|---|---|
| obj | any | |
| key | string | |
| value | any |
iget(obj: any, idx: number) → any
Integer-indexed element read. A canonical in-range dense hit returns in one hop with no string-key round trip; a hole or a miss defers to the string path so the prototype chain and named-property fallback still apply.
| arg | type | description |
|---|---|---|
| obj | any | |
| idx | number |
iset(obj: any, idx: number, value: any) → void
Integer-indexed element write. A canonical index at or below the dense boundary stays on the dense fast path; a gap above it, or a non-array / non-integer target, defers to the string-keyed set.
| arg | type | description |
|---|---|---|
| obj | any | |
| idx | number | |
| value | any |
hasOwn(obj: any, key: string) → boolean
| arg | type | description |
|---|---|---|
| obj | any | |
| key | string |
has(obj: any, key: string) → boolean
| arg | type | description |
|---|---|---|
| obj | any | |
| key | string |
deleteKey(obj: any, key: string) → boolean
| arg | type | description |
|---|---|---|
| obj | any | |
| key | string |
rawDelete(obj: any, key: string) → void
Remove an own key and its non-enumerable mark without JS delete semantics, so a later re-add of the same key is a fresh enumerable own property.
| arg | type | description |
|---|---|---|
| obj | any | |
| key | string |
ownKeys(obj: JSObject) → void
| arg | type | description |
|---|---|---|
| obj | JSObject |
enumerableOwnKeys(obj: JSObject) → void
The own keys of `obj` that are enumerable — `ownKeys` minus any marked non-enumerable. This drives for-in enumeration and the own-enumerable copy performed by object rest and object spread.
| arg | type | description |
|---|---|---|
| obj | JSObject |
markNonEnum(obj: any, key: string) → void
Mark an existing own key of `obj` as non-enumerable. The key stays in the insertion-ordered key list and remains readable via `get`.
| arg | type | description |
|---|---|---|
| obj | any | |
| key | string |
setNonEnum(obj: any, key: string, value: any) → void
Own-property write that marks the key non-enumerable in one step. Used where JS defines a non-enumerable own property (function "name"/"length"/ "prototype", prototype "constructor", class methods and accessors).
| arg | type | description |
|---|---|---|
| obj | any | |
| key | string | |
| value | any |
jsTypeof(v: any) → string
| arg | type | description |
|---|---|---|
| v | any |
toBoolean(v: any) → boolean
| arg | type | description |
|---|---|---|
| v | any |
defaultPrimitive(o: JSObject) → string
The class-based default string used when no callable valueOf/toString is found. Arrays join their elements; other classes use their tag form.
| arg | type | description |
|---|---|---|
| o | JSObject |
toPrimitive(v: any, hint: string) → any
| arg | type | description |
|---|---|---|
| v | any | |
| hint | string |
toNumber(v: any) → number
| arg | type | description |
|---|---|---|
| v | any |
numberToString(n: number) → string
| arg | type | description |
|---|---|---|
| n | number |
toStringJs(v: any) → string
| arg | type | description |
|---|---|---|
| v | any |
toPropertyKey(v: any) → string
| arg | type | description |
|---|---|---|
| v | any |
strictEquals(a: any, b: any) → boolean
| arg | type | description |
|---|---|---|
| a | any | |
| b | any |
looseEquals(a: any, b: any) → boolean
| arg | type | description |
|---|---|---|
| a | any | |
| b | any |
nowMs( ) → number
Read wall-clock epoch milliseconds. Combines the integer-second epoch anchor captured at module load with the elapsed monotonic delta from getTime(), which carries sub-microsecond fractional resolution, to produce a millisecond-precision timestamp.
instanceOf(v: any, ctor: any) → boolean
| arg | type | description |
|---|---|---|
| v | any | |
| ctor | any |
Accessor = {JSObject = {FunctionDef = {NativeFn = (rt: Realm, thisVal: any, args: { any }) -> anyIteratorFactory = (obj: any) -> (() -> (boolean, any))Realm = {Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.