Major update introducing modern JavaScript operators, arrow functions, IIFE support, and comprehensive array higher-order methods.
- Full arrow function support with lambda generation
- Lexical
thisbinding with capture modes - Single expression and block body syntax
- Type inference for arrow function parameters
- Proper return type deduction
- Computed Property Names - Dynamic object keys (
{[key]: value}) - IIFE Support - Immediately Invoked Function Expressions with lambda wrappers
- instanceof operator - Runtime type checking with prototype chain traversal
- in operator - Property existence checking for objects and arrays
- delete operator - Property deletion with boolean return values
forEach()- Execute function for each elementfind()- Find first element matching predicatefindIndex()- Find index of first matching elementsome()- Test if at least one element matchesevery()- Test if all elements matchincludes()- Check if array contains value- Enhanced
map(),filter(),reduce()with js::any support
- Object rest properties (
const { a, ...rest } = obj) - Array rest elements (
const [first, ...rest] = arr) - Lambda-wrapped rest object generation for global scope
- Proper entries() method for object iteration
- Array spread in array literals (
[...arr1, ...arr2]) - Concatenation support for spread operations
- Empty array handling with explicit type specification
- C++ reserved keywords now properly escaped with underscore suffix
- Variable names checked against full C++ keyword list
- Fixed object rest properties at global scope using lambda wrappers
- Corrected === and !== operator mapping to == and !=
- Added computed property name generation (
{[expr]: value}) - IIFE lambda wrapper generation for immediate execution
- Runtime helper function calls for instanceof, in, and delete operators
- Added missing arithmetic operators to js::any (*, /, -, %)
- Added comparison operators to js::any (>, <, >=, <=, ==, !=)
- Added operator overloads for js::any with js::number
- Enhanced js::any to delegate array methods to underlying arrays
- Added entries() method to js::object for iteration
- Better array method detection in code generator
- Improved identifier mapping for reserved words
- More comprehensive operator support in runtime
- Cleaner lambda generation for complex patterns
// New array methods in js::array<T>
template<typename Func> void forEach(Func&& func) const;
template<typename Func> T find(Func&& func) const;
template<typename Func> int findIndex(Func&& func) const;
template<typename Func> bool some(Func&& func) const;
template<typename Func> bool every(Func&& func) const;
bool includes(const T& value) const;
// New operators in js::any
any operator*(const number& other) const;
any operator/(const number& other) const;
any operator-(const number& other) const;
any operator%(const number& other) const;
bool operator>(const number& other) const;
bool operator<(const number& other) const;
bool operator>=(const number& other) const;
bool operator<=(const number& other) const;
bool operator==(const number& other) const;
bool operator!=(const number& other) const;
// New runtime helper functions
bool js_instanceof(const js::any& obj, const js::any& constructor);
bool js_in(const std::string& prop, const js::any& obj);
bool js_delete(js::any& obj, const std::string& prop);
// Enhanced object methods
std::vector<std::pair<std::string, js::any>> entries() const;None - All changes are additive or bug fixes.
- Lambda functions cannot be directly stored as js::any (need std::function wrapper)
- Some complex arrow function patterns may require manual adjustment
- Object rest iteration requires C++17 structured bindings
No migration required. Existing code continues to work with enhanced functionality available.
This release represents significant progress in JavaScript feature parity, bringing modern array operations, arrow functions, IIFE support, and essential JavaScript operators (instanceof, in, delete) to the C++ transpilation. With computed property names and comprehensive operator support, v0.7.0 enables more dynamic and idiomatic JavaScript patterns in C++ output.