From 80a82c78d892fdf4742d335559f0a722aa330fa9 Mon Sep 17 00:00:00 2001 From: Andy Leiserson Date: Wed, 17 Sep 2025 16:49:58 -0400 Subject: [PATCH] [deno] Remove kludge for `type` properties Fixes #7778 --- deno_webgpu/01_webgpu.js | 14 -------------- deno_webgpu/query_set.rs | 5 ++--- deno_webgpu/shader.rs | 5 ++--- 3 files changed, 4 insertions(+), 20 deletions(-) diff --git a/deno_webgpu/01_webgpu.js b/deno_webgpu/01_webgpu.js index c958f189e1..8c5ce5c593 100644 --- a/deno_webgpu/01_webgpu.js +++ b/deno_webgpu/01_webgpu.js @@ -625,13 +625,6 @@ ObjectDefineProperty(GPUCompilationMessage, privateCustomInspect, { }, }); const GPUCompilationMessagePrototype = GPUCompilationMessage.prototype; -// Naming it `type` or `r#type` in Rust does not work. -// https://github.com/gfx-rs/wgpu/issues/7778 -ObjectDefineProperty(GPUCompilationMessage.prototype, "type", { - get() { - return this.ty; - } -}); class GPUShaderStage { constructor() { @@ -845,13 +838,6 @@ ObjectDefineProperty(GPUQuerySetPrototype, privateCustomInspect, { ); }, }); -// Naming it `type` or `r#type` in Rust does not work. -// https://github.com/gfx-rs/wgpu/issues/7778 -ObjectDefineProperty(GPUQuerySet.prototype, "type", { - get() { - return this.ty; - } -}); // Converters diff --git a/deno_webgpu/query_set.rs b/deno_webgpu/query_set.rs index c726ad6059..2190eeb6cc 100644 --- a/deno_webgpu/query_set.rs +++ b/deno_webgpu/query_set.rs @@ -60,11 +60,10 @@ impl GPUQuerySet { Ok(()) } - // Naming this `type` or `r#type` does not work. - // https://github.com/gfx-rs/wgpu/issues/7778 #[getter] #[string] - fn ty(&self) -> &'static str { + #[rename("type")] + fn r#type(&self) -> &'static str { self.r#type.as_str() } diff --git a/deno_webgpu/shader.rs b/deno_webgpu/shader.rs index 2718826f51..49a81a83c9 100644 --- a/deno_webgpu/shader.rs +++ b/deno_webgpu/shader.rs @@ -96,11 +96,10 @@ impl GPUCompilationMessage { self.message.clone() } - // Naming this `type` or `r#type` does not work. - // https://github.com/gfx-rs/wgpu/issues/7778 #[getter] #[string] - fn ty(&self) -> &'static str { + #[rename("type")] + fn r#type(&self) -> &'static str { self.r#type.as_str() }