mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-28 09:21:55 +01:00
With Options::es2015, vectorcraft-js reads and runs for-of loops and array and object destructuring (ECMA-262 11th edition, sections 13.7.5, 12.15.5 and 13.3.3) in var, let and const declarations, assignments, function and arrow parameters and catch clauses, with defaults, holes and rest elements. Object literals take shorthand and computed names. for-of, spread and array patterns use the iterator protocol and call the iterator's return method when a loop or pattern stops early. Destructuring undefined or null throws a TypeError. Object rest properties (ECMAScript 2018) stay syntax errors. A realm switched to ES2015 without Symbol.iterator walks arrays, arguments objects and strings by index. Each step takes fuel, a rest element or spread reserves the whole size of each new element against the heap limit, and nested patterns count against Options::max_depth. The test262 runner reads the for-of and dstr folders: 609 of 617 runs pass (529 before).