-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent Uncaught Exception from ThinEngine.runRenderLoop
when window.SetTimeout
in not defined
#13401
Conversation
...r/src/components/actionTabs/tabs/propertyGrids/materials/textures/textureEditorComponent.tsx
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I am not sure why you opted in to use window.clearTimeout
instead of removing all window
references in one place, but otherwise - this is a great change.
...r/src/components/actionTabs/tabs/propertyGrids/materials/textures/textureEditorComponent.tsx
Show resolved
Hide resolved
And another possible change would be to use |
Well the difficulty here is that actually |
let's leave it this way then. |
@bghgary could you check it would be ok with Native ??? |
@barroij would be great if you can fix lint and format ? |
@sebavan formatting done ! |
I'll wait for @bghgary before merging just to be sure. |
Weird, I thought I replied, but maybe I forgot to actually send. :) Anyways, in native, we put the setTimeout/clearTimeout functions on both |
I am having an uncaught exception when using BaylonJs in a NodeJs environment because of a call to
window.setTimeout
.It is not very clear in the code what is the standard, as sometime we call the global
setTimeout
and sometime we callwindow.setTimeout
.My take on this is that it should be ok to always call the globals
setTimeout
/clearTimeout
as they are bound to be defined and are the very same functions aswindow.setTimeout
/window.clearTimeout
in most cases.Though this PR do not change them all. I just make some 2 files more consistent where we used to use a mix of both, and I updated the
ThinEngine.QueueNewFrame
to NOT callwindow.setTimeout
, but to fall back on the globalsetTimeout
.To really be "environment independant", we should never call a function that is "environment dependant" directly, and put them all behind a configurable callback registry. This registry would be initialized with default values, and could be customizes by the user depending on its needs. But I'm not sure how it is doable, and anyway that's another story :)