Skip to content

Commit

Permalink
Merge pull request #1492 from actnwit/fix/remove-eval
Browse files Browse the repository at this point in the history
fix: remove eval
  • Loading branch information
emadurandal authored Nov 29, 2024
2 parents fcf26d3 + a5b9f41 commit ec39161
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/webgl/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ const WebGL = Object.freeze({
export default WebGL;

export type RnWebGL = typeof WebGL;
(0, eval)('this').RnWebGL = WebGL;
const globalObj =
typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : this;
(globalObj as unknown as { RnWebGL: RnWebGL }).RnWebGL = WebGL;

export type VertexHandles = vertexHandles;
export type WebGLStrategy = webGLStrategy;
4 changes: 3 additions & 1 deletion src/webgpu/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ const WebGpu = Object.freeze({
export default WebGpu;

export type RnWebGpu = typeof WebGpu;
(0, eval)('this').RnWebGpu = WebGpu;
const globalObj =
typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : this;
(globalObj as unknown as { RnWebGpu: RnWebGpu }).RnWebGpu = WebGpu;
4 changes: 3 additions & 1 deletion src/xr/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ const XR = Object.freeze({
export default XR;

export type RnXR = typeof XR;
(0, eval)('this').RnXR = XR;
const globalObj =
typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : this;
(globalObj as unknown as { RnXR: RnXR }).RnXR = XR;

0 comments on commit ec39161

Please # to comment.