Module xs.bindings.macros

Implements macros from xs.h as idiomatic D.

Functions

NameDescription
fxPop(the) Pop a slot off the stack.
fxPush(the, slot) Push a slot onto the stack.
xsAggregateErrorPrototype() Returns a reference to the AggregateError prototype instance created by the XS runtime.
xsArrayBuffer(the, buffer, size) Returns an ArrayBuffer slot.
xsArrayBufferPrototype() Returns a reference to the ArrayBuffer prototype instance created by the XS runtime.
xsArrayPrototype() Returns a reference to the Array prototype instance created by the XS runtime.
xsBoolean(the, value) Returns a Boolean slot
xsBooleanPrototype() Returns a reference to the Boolean prototype instance created by the XS runtime.
xsCall(the, this_, id, params) Call a Function.
xsCall_noResult(the, this_, id, params) Call a Function, ignoring its result.
xsCallFunction(the, function_, this_, params)
xsCloneMachine(creation, machine, name, context) Clone a xsMachine.
xsCreateMachine(creation, name, context) Returns a machine if successful, otherwise null.
xsDataViewPrototype() Returns a reference to the DataView prototype instance created by the XS runtime.
xsDatePrototype() Returns a reference to the Date prototype instance created by the XS runtime.
xsDebugger(the)
xsDefine(the, this_, id, slot, attributes) For theAttributes, specify the constants corresponding to the attributes you want to set (the others being cleared).
xsDefineAt(the, this_, key, slot, attributes)
xsDelete(the, this_, key) Delete a property or item of an instance.
xsDeleteAt(the, this_, key) Delete a property or item of an instance by key.
xsDeleteMachine(the) Free a xsMachine.
xsErrorPrototype() Returns a reference to the Error prototype instance created by the XS runtime.
xsEvalError(the, message)
xsEvalErrorPrototype() Returns a reference to the EvalError prototype instance created by the XS runtime.
xsFalse(the) Returns a false slot
xsFindID(the, name)
xsFunctionPrototype() Returns a reference to the Function prototype instance created by the XS runtime.
xsGet(the, this_, id) Get a property or item of an instance.
xsGetArrayBufferData(the, theSlot, offset, buffer, size) Get the data of an ArrayBuffer.
xsGetArrayBufferLength(the, theSlot) Returns the size of the ArrayBuffer in bytes.
xsGetAt(the, this_, key) Get a property or item of an array instance with a specified name, index or symbol.
xsGetContext(the) Returns a context.
xsGlobal(the)
xsHas(the, this_, id) Tests whether an instance has a property corresponding to a particular ECMAScript property name.
xsHasAt(the, this_, key) Tests whether an instance has a property corresponding to a particular ECMAScript property key.
xsHostPrototype() Returns a reference to the Host prototype instance created by the XS runtime.
xsHostZone(the) Used to set up and clean up a stack frame, so that you can use all the macros of XS in C in between, provided in lieu of xsBeginHost and xsEndHost.
xsID(the, name)
xsInteger(the, value) Returns a Number slot given an int.
xsIsID(the, name)
xsIsInstanceOf(the, instance, prototype) Tests whether an instance has a particular prototype, directly or indirectly (that is, one or more levels up in the prototype hierarchy).
xsMapPrototype() Returns a reference to the Map prototype instance created by the XS runtime.
xsName(the, id)
xsNew(the, this_, constructor, params)
xsNewArray(the, length) Creates an array instance, and returns a reference to the new array instance.
xsNewObject(the) Creates an object instance, and returns a reference to the new object instance.
xsNull(the) Returns a null slot
xsNumber(the, value) Returns a Number slot given a double.
xsNumberPrototype() Returns a reference to the Number prototype instance created by the XS runtime.
xsObjectPrototype() Returns a reference to the Object prototype instance created by the XS runtime.
xsOverflow(the, count)
xsPromisePrototype() Returns a reference to the Promise prototype instance created by the XS runtime.
xsProxyPrototype() Returns a reference to the Proxy prototype instance created by the XS runtime.
xsRangeError(the, message)
xsRangeErrorPrototype() Returns a reference to the RangeError prototype instance created by the XS runtime.
xsReferenceError(the, message)
xsReferenceErrorPrototype() Returns a reference to the ReferenceError prototype instance created by the XS runtime.
xsRegExpPrototype() Returns a reference to the RegExp prototype instance created by the XS runtime.
xsSet(the, this_, id, slot) Set a property or item of an instance.
xsSetArrayBufferData(the, theSlot, offset, buffer) Copies bytes into the ArrayBuffer.
xsSetArrayBufferLength(the, theSlot, length) Set the length of an ArrayBuffer.
xsSetAt(the, this_, key, slot) Set a property or item of an array instance by key.
xsSetContext(the, context) Sets a context.
xsSetPrototype() Returns a reference to the Set prototype instance created by the XS runtime.
xsShareMachine(the)
xsString(the, value) Returns a String slot given a string.
xsStringBuffer(the, buffer) Returns a StringBuffer slot given a string.
xsStringBuffer(the, buffer, size) Returns a StringBuffer slot given a char*.
xsStringPrototype() Returns a reference to the String prototype instance created by the XS runtime.
xsSymbolPrototype() Returns a reference to the Symbol prototype instance created by the XS runtime.
xsSyntaxError(the, message)
xsSyntaxErrorPrototype() Returns a reference to the SyntaxError prototype instance created by the XS runtime.
xsToArrayBuffer(the, theSlot) Returns a pointer to the ArrayBuffer data.
xsToBoolean(the, theSlot) Convert a slot to a Boolean value
xsToID(the, slot)
xsToInteger(the, theSlot) Convert a slot to a Number value represented as an int.
xsToNumber(the, theSlot) Convert a slot to a Number value.
xsToString(the, theSlot) Convert a slot to a String value.
xsToStringBuffer(the, theSlot, buffer) Convert a slot to a StringBuffer value given a string.
xsToStringBuffer(the, theSlot, buffer, size) Convert a slot to a StringBuffer value given a char*.
xsToUnsigned(the, theSlot) Convert a slot to a Number value represented as an uint.
xsTrace(the, string_)
xsTrue(the) Returns a true slot
xsTypedArrayPrototype() Returns a reference to the TypedArray prototype instance created by the XS runtime.
xsTypeError(the, message)
xsTypeErrorPrototype() Returns a reference to the TypeError prototype instance created by the XS runtime.
xsTypeOf(the, theSlot) Returns the Type of a slot.
xsUndefined(the) Returns an undefined slot
xsUnknownError(the, message)
xsUnsigned(the, value) Returns a Number slot given an uint.
xsURIError(the, message)
xsURIErrorPrototype() Returns a reference to the URIError prototype instance created by the XS runtime.
xsWeakMapPrototype() Returns a reference to the WeakMap prototype instance created by the XS runtime.
xsWeakSetPrototype() Returns a reference to the WeakSet prototype instance created by the XS runtime.

Manifest constants

NameTypeDescription
isCallableAsHostZone Detect whether T is callable as a Host zone, in lieu of xsBeginHost and xsEndHost.
isXsMachine Detect whether T is the xsMachine struct.
isXsMachinePtr Detect whether T is a pointer to the xsMachine struct.
prototypesStackIndex Index of standard JavaScript prototypes on a xsMachine's stack.
XS_FRAME_COUNT
XS_NO_ID