From fb5d64dc79f076a1d9e325c2e42130c87fe0ab50 Mon Sep 17 00:00:00 2001 From: andresa88 Date: Mon, 17 Apr 2023 10:06:24 -0700 Subject: [PATCH] Fixed an HTML Image issue when using the genes library to compile ES modules. Need to explicitly use: new window.Image() --- src/lime/_internal/backend/html5/HTML5HTTPRequest.hx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lime/_internal/backend/html5/HTML5HTTPRequest.hx b/src/lime/_internal/backend/html5/HTML5HTTPRequest.hx index cbbe9bbf2..94c3f2b59 100644 --- a/src/lime/_internal/backend/html5/HTML5HTTPRequest.hx +++ b/src/lime/_internal/backend/html5/HTML5HTTPRequest.hx @@ -444,7 +444,11 @@ class HTML5HTTPRequest private static function __loadImage(uri:String, promise:Promise, options:Int):Void { + #if (openfljs || genes) + var image:JSImage = untyped #if haxe4 js.Syntax.code #else __js__ #end ('new window.Image ()'); + #else var image = new JSImage(); + #end if (!__isSameOrigin(uri)) {