Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Excerpt

Indicates a native global was removed...

 

Notes

A define with state Define.REMOVED was originally a native but has since been removed by a script.

Removed defines are immutable. This state is mainly used to forcibly remove deprecated JS API features.

Examples

Code Block
themeRDark
languagejavascript
titleChecking a specific state
linenumberstrue
// always use strict equality checks
if (Define.stateOf("chat") === Define.REMOVED) {
	// chat function was native, but has since been removed by a sript
}
Code Block
themeRDark
languagejavascript
titleUsing a switch statement to check state
linenumberstrue
// when using switch, order of cases is vitally important
switch (Define.stateOf("chat")) {
	case Define.MISSING : return "chat() is missing";
	case Define.REMOVED : return "chat() was removed by script";
	case Define.ADDED   : return "chat() was added by script";
	case Define.REPLACED: return "chat() was overridden by script";
	case Define.NATIVE  : return "chat() function is native";
	default: return "Status of chat() is unknown";
}
Div
classbox
Availability
Status
colourGreen
titleStable

Requires:

Div
classbox
Contents

Jump to:

Table of Contents
maxLevel5

Div
classbox

Define API

Topics:

Child pages (Children Display)
alltrue
depthall
pageDefine API
excerpttrue