WebGL(2) context methods don't allow null for resource parameters #58200
Labels
Awaiting More Feedback
This means we'd like to hear from more people who would be helped by this feature
Suggestion
An idea for TypeScript
π Search Terms
WebGL2RenderingContext, attachShader, createShader, null
π Version & Regression Information
β― Playground Link
https://www.typescriptlang.org/play?target=99&jsx=0&ts=5.5.0-dev.20240415#code/KYDwDg9gTgLgBDAnmYcDKALAhgE2FAFWVQF44B1YAIwHEAZAJgCVgA7PKAS1YHMBhCKxigYAbQDkAMSYBBGgFkAogDkCAfTQAJGQBFFTcQF04AHwrV6zNh279BwkGPEA1fQUUANDdr0HDAbgAoQNBIWDgAMwBXVgBjGE5BOAAbCFxMXHwACh5kgC5zWkYWdnxbASERABo4AGcIKKhY4ALamC5eGqQUAoyOIhQASgLKIr78UzhWKOTkuABvQIBIWME2uuwOODJcgDpYqGAsYXGoLO7gQaDlgHobuE4IuEQGuBjVgFsPtngYDAhaqhktxgLUHvAAO7QADWYKoUXgPAgoLgWB4WG46z+qEOn2sx0SrDBxzgGBgMDAtTydwhtN20IwUEEAN20B4Nwh1FyHM40M4N00WHYwN4FQcMDoAJgAGIdIIAKSKBjygAcAAZ5QBOTUwNSxDDAWLQtQRaBqaazNSCPWHAmCYJLO4PJ5ZWqbCYkT1TGbJQYLW73JZ-JkQqbAUOKKBMs4AIjdmSgDzBFuSNReUXEADcgVK4KtKo4Y1cA3AAL7LPbxjhoBpNYCu91QGr1RrNYtLPafMCcZLAU4NhPF5b59a1KKxZq1ME7ZK7HjAGCnAAKWCgWG+wjOVfwNT2fAA8vIlwBJOiKDQEGQEACqaHbjzgrvHk9qfsWSyWhxgjVYGwTQSWcthzWCBe12fBoxyWd50XRtj1YU1JR4AcOEGds9jwXsTkbFD8HbL8f29WYglLIA
π» Code
π Actual behavior
Context methods that take in WebGL resources (shader, program, buffer...) report errors when provided with
null
butcreate*
methods return the resource (pointer) or null, and the spec says we should not check fornull
upon resource creation because all functions acceptnull
as a parameter (no-op).example :
π Expected behavior
Context methods taking resources as parameters should allow for
null
to be passed in. This would delineate from MDN's documentation but fit closer to the actual behavior of the API and the WebGL(2) spec.Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: