summaryrefslogtreecommitdiff
path: root/ext/webidl
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-02-20 01:11:56 +0100
committerGitHub <noreply@github.com>2023-02-20 01:11:56 +0100
commita1cd2a5915c13f6a9b8eafa3807e143a02616bc1 (patch)
treef99a6983e790797abb143d333ca3551d0b414552 /ext/webidl
parenta01af067d79e78ea8e2c21cf0ef92d86d425f8eb (diff)
refactor(core): definition of "ExtensionFileSource" (#17823)
This commit changes definition of "ExtensionFileSource", by changing "code" field to being "ExtensionFileSourceCode" enum. Currently the enum has only a single variant "IncludedInBinary". It is done in preparation to allow embedders to decide if they want to include the source code in the binary when snapshotting (in most cases they shouldn't do that). In the follow up commit we'll add more variants to "ExtensionFileSourceCode". "include_js_files_dir!" macro was removed in favor "include_js_files!" macro which can now accept "dir" option.
Diffstat (limited to 'ext/webidl')
-rw-r--r--ext/webidl/benches/dict.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/webidl/benches/dict.rs b/ext/webidl/benches/dict.rs
index 00bef4935..df0844fce 100644
--- a/ext/webidl/benches/dict.rs
+++ b/ext/webidl/benches/dict.rs
@@ -7,6 +7,7 @@ use deno_bench_util::bencher::Bencher;
use deno_core::Extension;
use deno_core::ExtensionFileSource;
+use deno_core::ExtensionFileSourceCode;
fn setup() -> Vec<Extension> {
vec![
@@ -14,7 +15,9 @@ fn setup() -> Vec<Extension> {
Extension::builder("deno_webidl_bench")
.esm(vec![ExtensionFileSource {
specifier: "internal:setup".to_string(),
- code: include_str!("dict.js"),
+ code: ExtensionFileSourceCode::IncludedInBinary(include_str!(
+ "dict.js"
+ )),
}])
.build(),
]