mirror of
https://github.com/Samsung/escargot.git
synced 2026-06-22 10:01:50 +00:00
4.1 KiB
4.1 KiB
Specification
Escargot is lightweight JavaScript engine used in Pando. Escargot implements full of ECMAScript 5.1 specification and part of ECMAScript 6.0 specification.
ES5
ES5 specification is fully supported with Escargot.
ES6
supported
| Object type | Implemented Feature | Property Type | Note |
|---|---|---|---|
| TypedArray Objects | TypedArray () | constructor | Currently it works expectedly only with arraylength less than 210000000 |
| TypedArray (length) | constructor | ||
| TypedArray (buffer [, byteOffset [, length]]) | constructor | ||
| TypedArray.prototype.indexOf (searchElement [, fromIndex]) | method | ||
| TypedArray.prototype.lastIndexOf (searchElement [, fromIndex]) | method | ||
| TypedArray.prototype.set (array [, offset]) | method | ||
| TypedArray.prototype.set (typedArray [, offset]) | method | ||
| TypedArray.prototype.subarray ([begin [, end]]) | method | ||
| TypedArray.BYTES_PER_ELEMENT | data property | ||
| TypedArray.prototype.BYTES_PER_ELEMENT | data property | ||
| TypedArray.prototype.constructor | data property | ||
| TypedArray.prototype.copyWithin (target, start [, end]) | method | ||
| TypedArray.prototype.every (callbackfn [, thisArg]) | method | ||
| getter of TypedArray.prototype.byteLength | accessor property | ||
| getter of TypedArray.prototype.byteOffset | accessor property | ||
| getter of TypedArray.prototype.length | accessor property | ||
| getter of TypedArray.prototype.buffer | accessor property | ||
| ArrayBuffer Objects | ArrayBuffer (length) | constructor | |
| ArrayBuffer.isView (arg) | function | ||
| getter of ArrayBuffer.prototype.byteLength | accessor property | ||
| ArrayBuffer.prototype.constructor | data property | ||
| ArrayBuffer.prototype.slice (start, end) | method | ||
| DataView Objects | DataView (buffer [, byteOffset [, byteLength]]) | constructor | |
| getter of DataView.prototype.buffer | accessor property | ||
| getter of DataView.prototype.byteLength | accessor property | ||
| getter of DataView.prototype.byteOffset | accessor property | ||
| DataView.prototype.constructor | data property | ||
| DataView.prototype.[get | set][Float32 | Float64 | Int8 | Int16 | Int32 | Uint8 | Uint16 | Uint32] (byteOffset [, littleEndian)) | method | ||
| Promise Objects | Promise (executor) | constructor | |
| Promise.all (iterable) | function | ||
| Promise.race (iterable) | function | ||
| Promise.reject (r) | function | ||
| Promise.resolve (x) | function | ||
| Promise.prototype.catch (onRejected) | method | ||
| Promise.prototype.then (onFulfilled, onRejected) | method |
Etc.
Even though the features below are not included in ES5 or ES6 specification, Escargot supports them for your usability.
Legacy features
| Implemented Feature | Note |
|---|---|
| Object.prototype.__proto__ | |
| Object.prototype.__defineGetter__ (prop, func) | |
| Object.prototype.__defineSetter__ (prop, func) | |
| Object.prototype.__lookupGetter__ (prop) | |
| Object.prototype.__lookupSetter__ (prop) | |
| escape (str) | |
| unescape (str) |
Escargot-specific features
| Implemented Feature | Function | Note |
|---|---|---|
| print (arg) | prints arg on stdout |
standalone binary only |
| load (fileName) | opens a file named fileName and executes the contents as source code |
standalone binary only |
| read (fileName) | opens a file named fileName and returns the contents as string |
standalone binary only |
| run (fileName) | opens a file named fileName, executes the contents as source code, and returns the time spent to execute the code |
standalone binary only |
| gc() | invokes garbage collector |