jQueryExternForHaxe icon indicating copy to clipboard operation
jQueryExternForHaxe copied to clipboard

duplicate let typeofJQuery with Haxe 4.1.x

Open AlexHaxe opened this issue 5 years ago • 0 comments

compiling a project using jQueryExtern with Haxe 4.1.x and -dce no will result in a .js file containing the following snippet:

let typeofJQuery = typeof($);
if(typeofJQuery != "undefined" && $.fn != null) {
	$.fn.elements = function() {
		return new js_jquery_JqEltsIterator(this);
	};
}
let typeofJQuery = typeof($);
if(typeofJQuery != "undefined" && $.fn != null) {
	$.fn.iterator = function() {
		return new js_jquery_JqIterator(this);
	};
}

Which will raise a syntax error if you e.g. run it through closure for minification, because let typeofJQuery appears twice in the same scope. Haxe 4.0.5 would emit a var instead of a let, avoiding that issue.

AlexHaxe avatar May 23 '20 15:05 AlexHaxe