haxe icon indicating copy to clipboard operation
haxe copied to clipboard

Generate ES6 arrows without `this` temp vars

Open RblSb opened this issue 6 months ago • 1 comments

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

RblSb avatar May 12 '25 22:05 RblSb