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

NameDescription
theA machine
this_A reference to the instance to test
idThe 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));