Skip to content

fix: add parameter count validation to directionalLight() and pointLight() (fixes #8581)#8582

Open
MASTERsj01 wants to merge 1 commit intoprocessing:mainfrom
MASTERsj01:fix/webgl-light-param-validation
Open

fix: add parameter count validation to directionalLight() and pointLight() (fixes #8581)#8582
MASTERsj01 wants to merge 1 commit intoprocessing:mainfrom
MASTERsj01:fix/webgl-light-param-validation

Conversation

@MASTERsj01
Copy link

Summary

Adds parameter count validation to directionalLight() and pointLight() in src/webgl/light.js, completing the @TODO: check parameters number that was left in the code.

Resolves #8581

Changes

Function What Changed
directionalLight() Added argument count check (2, 4, or 6 expected) with FES warning + early return
pointLight() Same argument count check with FES warning + early return
Both Removed orphaned @TODO comments

Notes

  • All existing tests pass
  • 1 file changed: 21 insertions, 4 deletions

…ght()

- Add argument count checks (2, 4, or 6 expected) with FES warnings
  for both directionalLight() and pointLight()
- Invalid argument counts now show a friendly error listing accepted
  calling forms and return early to prevent runtime errors
- Remove orphaned @todo comments
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.

WebGL: add parameter count validation to directionalLight() and pointLight()

1 participant