Skip to content
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

Fix addLightNode in case of anonymizing classes #26858

Merged
merged 9 commits into from
Sep 27, 2023
Merged
Changes from 1 commit
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: 2 additions & 2 deletions examples/jsm/nodes/lighting/LightsNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ export const lightsWithoutWrap = nodeProxy( LightsNode );
export function addLightNode( lightClass, lightNodeClass ) {

if ( LightNodes.has( lightClass ) ) throw new Error( `Redefinition of light node ${ lightNodeClass.name }` );
LeviPesin marked this conversation as resolved.
Show resolved Hide resolved
if ( typeof lightClass !== 'function' || ! lightClass.name ) throw new Error( `Light ${ lightClass.name } is not a class` );
if ( typeof lightNodeClass !== 'function' || ! lightNodeClass.name ) throw new Error( `Light node ${ lightNodeClass.name } is not a class` );
if ( typeof lightClass !== 'function' ) throw new Error( `Light ${ lightClass.name } is not a class` );
if ( typeof lightNodeClass !== 'function' ) throw new Error( `Light node ${ lightNodeClass.name } is not a class` );

LightNodes.set( lightClass, lightNodeClass );

Expand Down