haxe
haxe copied to clipboard
Generate ES6 arrows without `this` temp vars
Removes this temp vars for ES6 mode, functions that need function-scope this can be marked with
callback(@:js.function function() { // generate `function` in js instead of `() => {}`
// uses js.Lib.nativeThis, js.Syntax.code, etc
});
This is also port of pf_can_capture_this branch, so this capturing state is:
js-es5/python not supported
js-es6/php works
eval/lua/jvm/hl/cpp requires additional fixes, currently disabled
Closes https://github.com/HaxeFoundation/haxe/issues/10352 See https://github.com/HaxeFoundation/haxe/issues/9773