mirror of
https://github.com/denoland/deno.git
synced 2025-09-30 14:11:14 +00:00
refactor(extensions): reintroduce builder (#10412)
This commit is contained in:
parent
e63c533154
commit
e89295b176
12 changed files with 141 additions and 112 deletions
|
@ -95,22 +95,22 @@ impl Resource for WebGpuQuerySet {
|
|||
}
|
||||
|
||||
pub fn init(unstable: bool) -> Extension {
|
||||
Extension::with_ops(
|
||||
include_js_files!(
|
||||
Extension::builder()
|
||||
.js(include_js_files!(
|
||||
prefix "deno:op_crates/webgpu",
|
||||
"01_webgpu.js",
|
||||
"02_idl_types.js",
|
||||
),
|
||||
declare_webgpu_ops(),
|
||||
Some(Box::new(move |state| {
|
||||
))
|
||||
.ops(declare_webgpu_ops())
|
||||
.state(move |state| {
|
||||
// TODO: check & possibly streamline this
|
||||
// Unstable might be able to be OpMiddleware
|
||||
// let unstable_checker = state.borrow::<super::UnstableChecker>();
|
||||
// let unstable = unstable_checker.unstable;
|
||||
state.put(Unstable(unstable));
|
||||
Ok(())
|
||||
})),
|
||||
)
|
||||
})
|
||||
.build()
|
||||
}
|
||||
|
||||
pub fn get_declaration() -> PathBuf {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue