-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generated attribute setters for nullable types fail when passing null.
https://bugs.webkit.org/show_bug.cgi?id=259947 rdar://113591277 Reviewed by Chris Dumez. We aren't allowing `null` as an attribute value in the setter for nullable enum attributes. This change will check if the attribute is nullable in the code generator and if so generate C++ code which will call the native implementation of the setter with `std::nullopt` when passed `null` in the JS code. Preserves the existing behavior for non-nullable attributes. * Source/WebCore/bindings/scripts/CodeGeneratorJS.pm: (GenerateAttributeSetterBodyDefinition): * Source/WebCore/bindings/scripts/test: Added an attribute to TestObj to check the output of the generator for nullable enum type attributes. Canonical link: https://commits.webkit.org/266726@main
- Loading branch information
Showing
3 changed files
with
75 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters