Skip to content

Commit

Permalink
Remove caching of the error
Browse files Browse the repository at this point in the history
  • Loading branch information
hansl committed Apr 17, 2024
1 parent e8d9047 commit 3eb5eeb
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions core/interop/src/loaders/embedded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::collections::HashMap;
use std::path::Path;

use boa_engine::module::{ModuleLoader, Referrer};
use boa_engine::{Context, JsError, JsNativeError, JsResult, JsString, Module, Source};
use boa_engine::{Context, JsNativeError, JsResult, JsString, Module, Source};

/// Create a module loader that embeds files from the filesystem at build
/// time. This is useful for bundling assets with the binary.
Expand All @@ -32,7 +32,6 @@ macro_rules! embed_module {
enum EmbeddedModuleEntry {
Source(JsString, &'static [u8]),
Module(Module),
Error(JsError),
}

impl EmbeddedModuleEntry {
Expand All @@ -50,14 +49,13 @@ impl EmbeddedModuleEntry {
*self = Self::Module(module);
}
Err(err) => {
*self = Self::Error(err);
return Err(err);
}
}
};

match self {
Self::Module(module) => Ok(module),
Self::Error(err) => Err(err.clone()),
EmbeddedModuleEntry::Source(_, _) => unreachable!(),
}
}
Expand Down

0 comments on commit 3eb5eeb

Please sign in to comment.