Changelog
Features
- Binary Bytecode Evaluation: Implemented the ability to compile JavaScript source code into a portable bytecode format, which can then be evaluated. This works for both scripts and ES modules. It also includes automatic ES module detection during compilation and the option to load bytecode without immediate execution.
- ECMAScript Module (ESM) Enhancements:
- Added
import.meta
support, includingimport.meta.resolve()
and properties likeurl
,dir
,file
, andpath
. - Now supports import attributes (e.g.,
import json from './data.json' with { type: 'json' }
), enabling loading of module types like JSON modules. - Improved module loading and resolution callbacks for better control over module import behavior.
- Added
- Host Environment Module and Class Binding: Introduced a new interface allowing the WebAssembly host (which can be any language; "C module" is just an internal term for these bindings) to expose its own modules and classes directly to the JavaScript runtime.
- Module Builder: Provides functions to define modules with explicit exports, host-backed functions, and private values, and to register them with the runtime.
- Class Exports: Enables exporting JavaScript classes from the host, with support for custom constructors, instance methods, static methods, and finalizers for resource management.
- Static Class Initializers: Added support for ES6 static class initialization blocks.
- Optimized Type Checking: Implemented a spec-compliant integer mapping for optimized JavaScript type checking.
Error.isError()
Method: Added the staticisError()
method to the globalError
object for directly checking if a value is anError
instance.
Fixes and Improvements
- Memory Management & Leak Fixes:
- Resolved several memory leaks during runtime cleanup and function source handling.
- Fixed issues with value type allocations for JavaScript values in the WebAssembly environment.
- Improved WebAssembly instance memory import and management.
- Optional Chaining: Enhanced optional chaining implementation for better stability.
- Parsing: Corrected
peek_token
functionality and addressed identifier parsing edge cases.