Nucleus handler tools › Docs › Checks

A JavaScript function Nucleus doesn't have

Errormissing-builtinA Nucleus check · Nucleus fails: the handler doesn't load, or the session ends.

Why it matters

Jint 2.x only has ES5's built-in functions. Newer ones such as "…".includes(), [].find(), Object.assign or Array.from don't exist, so calling one ends the session.

Example

✗ Wrong

Game.Play = function () {
  var copy = Array.from([1, 2]);
};

✓ Right

Game.Play = function () {
  var copy = [1, 2].slice();
};

How to fix it

Use the ES5 way: indexOf(…) !== -1 for includes, a loop for find, slice() to copy a list. The quick fix rewrites the common ones.

Turn it off, or change how it shows

Each check can be shown as an error, warning, info or hint, or turned off. VS Code: "splitscreenme.lint.rules": { "missing-builtin": "off" } in your settings. Notepad++: Plugins › Nucleus Co-op handlers › Settings. Command line: ncdev lint --rule missing-builtin=off. Other editors: the lint.rules setting of ncdev lsp.

Is this right? Tell us what's wrong
Stuck, or not sure? Ask other handler authors: Discordr/nucleuscoop