Skip to content

Identify Three.js types with instanceof - #446

Merged
dmarcos merged 1 commit into
sparkjsdev:mainfrom
oscarlorentzon:texture-instanceof-checks
Sep 21, 2026
Merged

dmarcos merged 1 commit into
sparkjsdev:mainfrom
oscarlorentzon:texture-instanceof-checks

Conversation

@oscarlorentzon

Copy link
Copy Markdown
Collaborator

Replaces #443.

Three.js types were identified two ways, instanceof in 20 places and the isTexture marker in two. The library now uses instanceof throughout, apart from the XR render target check, where a comment says why.

Two texture checks read the boolean marker Three.js sets on its own
objects while every other check uses instanceof. Both now use instanceof,
and a comment says why the XR render target check keeps the marker.
@dmarcos

dmarcos commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Sweet! Thanks!

@dmarcos
dmarcos merged commit 867d02e into sparkjsdev:main Sep 21, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants