summaryrefslogtreecommitdiff
path: root/ext/webgpu/00_init.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/webgpu/00_init.js')
-rw-r--r--ext/webgpu/00_init.js37
1 files changed, 3 insertions, 34 deletions
diff --git a/ext/webgpu/00_init.js b/ext/webgpu/00_init.js
index b7014bd45..0f10847ce 100644
--- a/ext/webgpu/00_init.js
+++ b/ext/webgpu/00_init.js
@@ -1,38 +1,7 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
-import { op_lazy_load_esm } from "ext:core/ops";
+import { core } from "ext:core/mod.js";
-let webgpu;
+const loadWebGPU = core.createLazyLoader("ext:deno_webgpu/01_webgpu.js");
-function webGPUNonEnumerable(getter) {
- let valueIsSet = false;
- let value;
-
- return {
- get() {
- loadWebGPU();
-
- if (valueIsSet) {
- return value;
- } else {
- return getter();
- }
- },
- set(v) {
- loadWebGPU();
-
- valueIsSet = true;
- value = v;
- },
- enumerable: false,
- configurable: true,
- };
-}
-
-function loadWebGPU() {
- if (!webgpu) {
- webgpu = op_lazy_load_esm("ext:deno_webgpu/01_webgpu.js");
- }
-}
-
-export { loadWebGPU, webgpu, webGPUNonEnumerable };
+export { loadWebGPU };