DescriptionAdd null-correctness checking to [StrictTypeChecking] methods
As part of the SVG bindings rewrite, we'd like [StrictTypeChecking]
on a method to verify null-correctness (i.e., throw an error if null is
passed to a non-nullable parameter), so that we don't need to have this
code in Blink.
This changes the CG to add this check, replacing isUndefinedOrNull(...)
with ...->isUndefined() for non-nullable parameters.
This is a conservative change:
only SVG generated bindings are changed (per Kouhei):
*no* changes to non-SVG generated bindings.
This is done by explicitly marking existing interface type parameters
of [StrictTypeChecking] methods as nullable, matching the actual behavior.
(SVG test expectations are updated, since there are some tests for null values currently, which are now caught by bindings, not Blink.)
Outside of SVG, there are only 4 IDL files that have [StrictTypeChecking]
on methods:
* RTCPeerConnection
* OESVertexArrayObject
* WebGLDebugShaders
* WebGLRenderingContext
The first 3 only have 1-3 methods with [StrictTypeChecking].
The last one, WebGLRenderingContext,
uses [StrictTypeChecking] on all its methods, and further,
4 methods have parameters marked as nullable:
bufferData, bufferSubData, texImage2D, texSubImage2D,
but this currently does nothing.
8 SVG IDLs files have [StrictTypeChecking] on methods; these will be
handled by Kouhei during the rewrite,
and per Kouhei, it's ok for them to add null checks.
I'll followup with developers of the individual interfaces to ask them
to verify null-correctness.
Also:
* There are also 2 interface type attributes with [StrictTypeChecking],
but changing these to nullable would require Blink changes, so I'll
do those in a separate CL.
* Add support for nullable interface type attributes to Python CG (just a .release())
BUG=249598
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=165306
Patch Set 1 #
Total comments: 15
Patch Set 2 : Unmodify SVG idls #Patch Set 3 : Unmodify SVG idls #Patch Set 4 : Update SVG test expectations #Patch Set 5 : Last test #Messages
Total messages: 14 (0 generated)
|