DescriptionThrow exception on null pointers in raw toNative
Currently, all of the different variants of toNative will
convert a Dart_Null to a null pointer without throwing an
error. This is incorrect: for non nullable types, many of
the underlying blink implementations will crash if given a
null pointer (see for example https://code.google.com/p/dart/issues/detail?id=19948).
This CL is a first cut a correcting this. I've changed
the template generator for the wrappers to produce code
which throws an error if given Dart_Null in the non
WithNullCheck cases. I think this code should actually be
substantially refactored - the naming convention is quite
confusing at the moment - but for the time being this
addresses the immediate bug and makes things less likely to
crash on bad inputs. Some custom code had to be updated
to use toNativeWithNullCheck (corresponding to
toNativeWithTypeCheck in the V8 case).
BUG=http://dartbug.com/19948
R=vsm@google.com
Committed: https://src.chromium.org/viewvc/blink/branches/dart/dartium?view=rev&revision=180097
Patch Set 1 #
Messages
Total messages: 4 (0 generated)
|