Skip to content

Commit

Permalink
apacheGH-30863: [JS] Use a singleton StructRow proxy handler
Browse files Browse the repository at this point in the history
  • Loading branch information
swallez committed Oct 2, 2024
1 parent 60f29e9 commit 71590cd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion js/src/row/struct.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class StructRow<T extends TypeMap = any> {
constructor(parent: Data<Struct<T>>, rowIndex: number) {
this[kParent] = parent;
this[kRowIndex] = rowIndex;
return new Proxy(this, new StructRowProxyHandler());
return new Proxy(this, structRowProxyHandler);
}

public toArray() { return Object.values(this.toJSON()); }
Expand Down Expand Up @@ -157,3 +157,5 @@ class StructRowProxyHandler<T extends TypeMap = any> implements ProxyHandler<Str
return false;
}
}

const structRowProxyHandler = new StructRowProxyHandler();

0 comments on commit 71590cd

Please sign in to comment.