Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: remove eval #1492

Merged
merged 1 commit into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;