mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-24 11:23:43 +01:00
vectorcraft-js gains Options::es2015, which reads and runs these ECMAScript 2015 forms: let and const with block scope and their temporal dead zone, a new let binding for each loop iteration, function declarations scoped to their block (with the Annex B.3.3 variable outside strict mode code), arrow functions, template literals and tagged templates, default and rest parameters, and spread in array literals, calls and new. Spread reads arrays, strings by code point and objects with a length, by index, and throws a TypeError for anything else until iterators are added. Eval code outside strict mode code cannot declare a var that clashes with a let or const around it, or with a parameter inside a default value. Spread, template objects and the new scopes take fuel and count against the heap limit, and nested arrows and templates count against the depth limit. script.run sets the option for a .js file; eval, Function, #include files, $.evalFile and a kept #targetengine read code the way the running script does. A .jsx file and a source string stay ES5.1. The test262 runner gains an ES2015 subset run, read without and with the option. docs/mcp.md and docs/target-app-parity.md describe the new forms.