Skip to content

Commit 5b194ec

Browse files
[deno] Remove kludge for type properties (#8262)
1 parent a2547f8 commit 5b194ec

File tree

3 files changed

+4
-20
lines changed

3 files changed

+4
-20
lines changed

deno_webgpu/01_webgpu.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -625,13 +625,6 @@ ObjectDefineProperty(GPUCompilationMessage, privateCustomInspect, {
625625
},
626626
});
627627
const GPUCompilationMessagePrototype = GPUCompilationMessage.prototype;
628-
// Naming it `type` or `r#type` in Rust does not work.
629-
// https://github.com/gfx-rs/wgpu/issues/7778
630-
ObjectDefineProperty(GPUCompilationMessage.prototype, "type", {
631-
get() {
632-
return this.ty;
633-
}
634-
});
635628

636629
class GPUShaderStage {
637630
constructor() {
@@ -845,13 +838,6 @@ ObjectDefineProperty(GPUQuerySetPrototype, privateCustomInspect, {
845838
);
846839
},
847840
});
848-
// Naming it `type` or `r#type` in Rust does not work.
849-
// https://github.com/gfx-rs/wgpu/issues/7778
850-
ObjectDefineProperty(GPUQuerySet.prototype, "type", {
851-
get() {
852-
return this.ty;
853-
}
854-
});
855841

856842
// Converters
857843

deno_webgpu/query_set.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,10 @@ impl GPUQuerySet {
6161
Ok(())
6262
}
6363

64-
// Naming this `type` or `r#type` does not work.
65-
// https://github.com/gfx-rs/wgpu/issues/7778
6664
#[getter]
6765
#[string]
68-
fn ty(&self) -> &'static str {
66+
#[rename("type")]
67+
fn r#type(&self) -> &'static str {
6968
self.r#type.as_str()
7069
}
7170

deno_webgpu/shader.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,10 @@ impl GPUCompilationMessage {
9696
self.message.clone()
9797
}
9898

99-
// Naming this `type` or `r#type` does not work.
100-
// https://github.com/gfx-rs/wgpu/issues/7778
10199
#[getter]
102100
#[string]
103-
fn ty(&self) -> &'static str {
101+
#[rename("type")]
102+
fn r#type(&self) -> &'static str {
104103
self.r#type.as_str()
105104
}
106105

0 commit comments

Comments
 (0)