Skip to content

Commit

Permalink
Check for @:autoBuild only after checking for embed data.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
player-03 authored Dec 6, 2024
1 parent 57e936c commit 5ed2ee7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lime/_internal/macros/AssetsMacro.hx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ class AssetsMacro

macro public static function embedBytes():Array<Field>
{
var fields = embedData(":file");
if (fields == null) return null;

for (autoBuild in Context.getLocalClass().get().meta.extract(":autoBuild"))
{
switch (autoBuild.params[0])
Expand All @@ -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);
Expand Down

0 comments on commit 5ed2ee7

Please sign in to comment.