k8-1.0 (r124)
The previous version of k8, v0.2.5, was built on top of v8-3.16.4 released on
2013-01-11. This version updates v8 to v8-10.2.154.26 released on 2023-01-23,
ten years later. It brings ES6 features including but not limited to the "let"
keyword to define local variables, Java-like classes and back-tick strings.
Due to the lack of the SetIndexedPropertiesToExternalArrayData() API in v8, it
is not possible to keep full backward compatibility with older k8 versions.
Nonetheless, we have tried to retain commonly used methods such that the
several popular k8 scripts can mostly work.
New functions:
k8_version()
: get the k8 versionBytes.buffer
: get ArrayBuffer
Improved:
load()
: search the script pathprint()
: print to stdout. Support ArrayBuffer. Faster for Bytes.warn()
: print to stderr. Support ArrayBuffer. Faster for Bytes.
Mostly unchanged:
exit()
: exitBytes.length
: get/set Bytes lengthBytes.capacity
: get/set Bytes capacitynew File()
: open a fileFile.prototype.close()
: close the file handlerFile.prototype.read()
: read a byte or bytesFile.prototype.readline()
: read a lineFile.prototype.write()
: write to a plain file
Changed functions (BREAKING):
new Bytes()
- Bytes only supportsuint8_t
nowBytes.prototype.set()
- Bytes only supportsuint8_t
Removed functions (BREAKING):
Map
- JavaScript hasMap
and works betterBytes.prototype.cast()
- Bytes only supportsuint8_t
Bytes[]
- not possible to implement. UseBytes.buffer
as a partial remedy
(1.0: 10 August 2023, r124)