Global

Members

console :Console

console is an instance of Console class in the global scope. With it, users can output messages to the debugging console, that is, cMT Diagnoser.

Type:
Example
console.log("Hello world!");

net

The net namespace provides classes and functions for users to do network-related operations. Currently only web requests (cURL) are supported.

window :Object

window is THE global object.

Note:

  • All JS objects designated in the same (EBpro) window share one JS context, that is, share the same memory heap and global object.
Type:
  • Object

Methods

cancelAnimationFrame(requestID)

See:

Cancels an animation frame request previously scheduled through a call to requestAnimationFrame().

Parameters:
Name Type Description
requestID Object

The ID value returned by the call to requestAnimationFrame() that requested the callback.

clearInterval(intervalID)

See:

Cancels a timed, repeating action which was previously established by a call to setInterval().

Parameters:
Name Type Description
intervalID Object

The identifier of the repeated action you want to cancel. This ID was returned by the corresponding call to setInterval().

clearTimeout(timeoutID)

See:

Cancels a timeout previously established by calling setTimeout().

Parameters:
Name Type Description
timeoutID Object

The identifier of the timeout you want to cancel. This ID was returned by the corresponding call to setTimeout().

requestAnimationFrame(callback) → {Object}

See:

Tell the system that you wish to perform an animation and request that the system calls a specified function to update an animation before the next repaint. The method takes a callback as an argument to be invoked before the repaint.

You should call this method whenever you're ready to update your animation on screen. This will request that your animation function be called before the system performs the next repaint.

The callback method is passed a single argument, a 64-bit integer, which indicates the current time (based on the number of milliseconds since time origin).

Parameters:
Name Type Description
callback function

The function to call when it's time to update your animation for the next repaint. The callback function is passed one single argument, a 64-bit integer, which indicates the current time (based on the number of milliseconds since time origin).

Returns:

An object, the request id, that uniquely identifies the entry in the callback list. You can pass this value to cancelAnimationFrame() to cancel the refresh callback request.

Type
Object

require(id) → {*}

Used to import modules. Modules can be imported using a relative path (e.g. ./, ./foo, ./bar/baz, ../foo).

Example
const myModule = require('/myModule.js');
Parameters:
Name Type Description
id String

Module name or path.

Returns:

Exported module content.

Type
*

setInterval(func, delay) → {Object}

See:

This method repeatedly calls a function or executes a code snippet, with a fixed time delay between each call. It returns an interval ID which uniquely identifies the interval, so you can remove it later by calling clearInterval().

Parameters:
Name Type Description
func function

A function to be executed every delay milliseconds. The function is not passed any arguments, and no return value is expected.

delay Number

The time, in milliseconds, the timer should delay in between executions of the specified function or code.

Returns:

An object, which identifies the timer created by the call to setInterval(); this value can be passed to clearInterval() to cancel the timeout.

Type
Object

setTimeout(func, delayopt) → {Object}

See:

This method sets a timer which executes a function or specified piece of code once the timer expires.

Parameters:
Name Type Attributes Default Description
func function

A function to be executed after the timer expires.

delay Number <optional>
0

The time, in milliseconds, the timer should wait before the specified function or code is executed. If this parameter is omitted, a value of 0 is used, meaning execute "immediately", or more accurately, the next event cycle.

Returns:

An object, which identifies the timer created by the call to setTimeout(); this value can be passed to clearTimeout() to cancel the timeout.

Type
Object