Versions Compared
compared with
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Comment:
Migrated to Confluence 5.3
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, causing errors in your scripts should you still be using them (so you can detect where you need to update your code).
You can still access removed properties by prefixing them with Native (see example).
Note: If you remove something that doesn't exist, nothing will happen. The property name will have a state of Define.MISSING.
Examples
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
// always use strict equality checks
if (Define.stateOf("chat") === Define.REMOVED) {
// chat function was native, but has since been removed by a sript
}
// if you try accessing it, you get an error
chat(ALLIES, "Anyone there?"); // Error |
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
// whenalways usinguse switch,strict orderequality ofchecks cases is vitally important switch if (Define.stateOf("chatorderDroidStatsLoc")) { case=== Define.MISSING : return "chat(REMOVED) 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"; // we can still get to it... native.orderDroidStatsLoc; // the native function // but we should really be using... orderDroidBuild; // its replacement } |
Div | ||||||
---|---|---|---|---|---|---|
| ||||||
Availability
Requires:
|
Div | ||||
---|---|---|---|---|
| ||||
ContentsJump to:
|
Div | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
Define APITopics:
|