(info) This AI is still in early stages of development.

Define.REPLACED

Indicates a global was replaced by a script using the Define API.

 

Notes

A define with state Define.REPLACED was originally native, but has since been replaced using Define().

Replaced defines are immutable.

You can always access the native implementation of replaced properties by prefixing the name with Native (see example below).

Note: If the define wasn't originally native, the new define would have a state of Define.ADDED.

Examples

Checking a specific state
// always use strict equality checks
if (Define.stateOf("chat") === Define.REPLACED) {
	// native chat function existed, but was replaced by a script
	chat(me, "This is using the replacement chat function");

    // the native chat() function is still available via
	native.chat(me, "This is using the native chat function");
}
Availability STABLE

Requires:

Contents

Jump to:

Define API

Topics:

  • Define()Add, remove or redefine a property on the global scope, overriding any native property of the same name on the global object...
  • Define API DiagnosticsDiagnostic routines for Define API...
  • Define ScriptsA library of ready made scripts for the Define API...