From 5ed2ee74bc933baefd7d00ba7b49e232db7d5cc4 Mon Sep 17 00:00:00 2001 From: player-03 Date: Fri, 6 Dec 2024 16:14:31 -0500 Subject: [PATCH] Check for `@:autoBuild` only after checking for embed data. If we ever decide to handle the case of the embed functions being called for non-classes (meaning `getLocalClass()` would return null), we'd handle it in `embedData()`. Therefore `embedData()` should happen first. --- src/lime/_internal/macros/AssetsMacro.hx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lime/_internal/macros/AssetsMacro.hx b/src/lime/_internal/macros/AssetsMacro.hx index 0323d9ed53..a5b403ee86 100644 --- a/src/lime/_internal/macros/AssetsMacro.hx +++ b/src/lime/_internal/macros/AssetsMacro.hx @@ -28,6 +28,9 @@ class AssetsMacro macro public static function embedBytes():Array { + var fields = embedData(":file"); + if (fields == null) return null; + for (autoBuild in Context.getLocalClass().get().meta.extract(":autoBuild")) { switch (autoBuild.params[0]) @@ -38,9 +41,6 @@ class AssetsMacro } } - var fields = embedData(":file"); - if (fields == null) return null; - var superCall = Context.defined("html5") ? macro super(bytes.b.buffer) : Context.defined("hl") ? macro super(bytes.b, bytes.length) : macro super(bytes.length, bytes.b);