Function xsHas
Tests whether an instance has a property corresponding to a particular ECMAScript property name.
bool xsHas
(
scope xs .bindings .xsMachineRecord* the,
const(xs .bindings .xsSlotRecord) this_,
int id
);
This macro is similar to the ECMAScript in keyword.
Parameters
| Name | Description |
|---|---|
| the | A machine |
| this_ | A reference to the instance to test |
| id | The identifier of the property to test |
Returns
true if the instance has the property, false otherwise
Examples
In ECMAScript:
if ("foo" in this)
In D:
if (xsHas(xsThis, xsID_foo));