Skip to content

Commit 5f4b079

Browse files
chirsz-everMugen87
andauthored
Animation: Fix ReferenceError in non-broswer environment (#30835)
* Animation: Fix ReferenceError in Node.js environment Node.js do not support `self`. * Update Animation.js --------- Co-authored-by: Michael Herzog <[email protected]>
1 parent b4ca470 commit 5f4b079

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/renderers/common/Animation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ class Animation {
3232
* A reference to the context from `requestAnimationFrame()` can
3333
* be called (usually `window`).
3434
*
35-
* @type {Window|XRSession}
35+
* @type {?(Window|XRSession)}
3636
*/
37-
this._context = self;
37+
this._context = typeof self !== 'undefined' ? self : null;
3838

3939
/**
4040
* The user-defined animation loop.

0 commit comments

Comments
 (0)