Skip to content

Commit

Permalink
avm2: Add stub notices for reusing Loader
Browse files Browse the repository at this point in the history
  • Loading branch information
Lord-McSweeney authored and Lord-McSweeney committed Jun 30, 2024
1 parent a5554d6 commit 34f864f
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions core/src/avm2/globals/flash/display/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,17 @@ pub fn load<'gc>(

let loader_info_object = loader_info.as_loader_info_object().unwrap();

if loader_info_object.init_event_fired() {
// FIXME: When calling load/loadBytes, then calling load/loadBytes again
// before the `init` event is fired, the first load is cancelled.
avm2_stub_method!(
activation,
"flash.display.Loader",
"load",
"reusing a Loader"
);
}

// Unload the loader, in case something was already loaded.
loader_info_object.unload(activation);

Expand Down Expand Up @@ -229,6 +240,17 @@ pub fn load_bytes<'gc>(

let loader_info_object = loader_info.as_loader_info_object().unwrap();

if loader_info_object.init_event_fired() {
// FIXME: When calling load/loadBytes, then calling load/loadBytes again
// before the `init` event is fired, the first load is cancelled.
avm2_stub_method!(
activation,
"flash.display.Loader",
"loadBytes",
"reusing a Loader"
);
}

// Unload the loader, in case something was already loaded.
loader_info_object.unload(activation);

Expand Down

0 comments on commit 34f864f

Please sign in to comment.