Skip to content

Conversation

@R32
Copy link
Contributor

@R32 R32 commented Jul 6, 2025

This gives the option to use the code generated by the compiler or not.

function rest( name : String, args : haxe.Rest<String> ) {
#if (js_es < 6)
	var args = js.Syntax.code("arguments"); // <-- overrides
	var i = 1;
#else
	var i = 0;
#end
    while(i < args.length)
        trace(name + " : " + args[i++]);
}

generated es5:

function rest(name) {
	var args = arguments;
	var i = 1;	
	while(i < args.length) console.log(name + " : " + args[i++]);
}

@skial skial mentioned this pull request Jul 26, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant