01. About neqto.js
neqto.js is a JavaScript environment that runs on the NEQTO Engine.
neqto.js has the following features.
About standard objects
neqto.js is compatible with ECMAScript 5.1 Edition
.
Additionally, some key features of ArrayBuffer
, TypedArray
, and Template Literals
defined in ECMAScript 2015 (ES6) Edition
are available.
The system time uses GMT
format.
About extension objects
Extension objects provide an interface to easily control NEQTO device specific functions, external devices, and external sensors.
For the details of an extension, refer to the description page of each extension.
Limitations
The maximum code size is about
127K
bytes.
When the size limit is exceeded the device will enter safe mode.
At the same time an event message(Engine: error: Script too big
) is sent to NEQTO Console.Only one callback can be executed at a time.
It is not possible to wait for another callback in a callback process.It is recommended to execute callbacks quickly and to not perform long blocks during callback executions.
If the function call hierarchy (nested functions) becomes too deep, it may cause an unexpected system reset due to stack overflow. Be especially careful when using recursive functions. It is recommended that the function call hierarchy be within a few steps and that the implementation always behaves within expectations.
Explanatory notes
Legend for extension description pages.
{ }
Braces indicate an object.[ ]
Square brackets around an argument inside a method description indicate the argument is optional. If the option is the beginning of the argument, omit the delimiters','
.foo.func([opt1][,opt2]) - foo.func(); - foo.func(opt1); - foo.func(opt2); //Omit delimiter - foo.func(opt1,opt2);
Errata
It has been confirmed that depending on how the JavaScript code is written, the desired behavior may not be achieved.
If any of the following cases are applicable, please apply the appropriate workaround.
Errata 1
Affected Version: 02.01.00
or earlier
If the conditional expression of a while statement uses <
and is specified with a variable that is updated externally, the while loop will completely occupy the processing, and all other processes executed outside of the while loop will not function.
Example of event occurrence: cnt
is a variable that is updated externally.
var cnt = 0;
var tm = setInterval(function() {
print('Interval:' + cnt);
cnt++;
}, 1000);
while(cnt < 10) {
}
clearInterval(tm);
Workaround 1: Using an if-break within while.
var cnt = 0;
var tm = setInterval(function() {
print('Interval:' + cnt);
cnt++;
}, 1000);
while(1) {
if(cnt >= 10) break;
}
clearInterval(tm);
Workaround 2: Using an inequality sign other than <
in the conditional expression of the while statement.
var cnt = 0;
var tm = setInterval(function() {
print('Interval:' + cnt);
cnt++;
}, 1000);
while(cnt <= 9) {
}
clearInterval(tm);