DescriptionIDL: fix handling of non-decimal and unsigned default values
The operation Document.createNodeIterator() has the argument
optional unsigned long whatToShow = 0xFFFFFFFF
which exposes a few problems in the IDL scripts.
First, "0xFFFFFFFF" is rejected by int(x) in default_node_to_idl_literal().
Using int(x, base=0) solves this; int() then selects base 8, 10 or 16
automatically.
Second, for unsigned integer types, we should add a 'u' suffix to the
C++ integer literal, or it's not guaranteed to be valid, in particular not
in 32-bit builds. This is implemented by adding a utility function on
IdlType for converting an IdlLiteral to a C++ expression. This utility
function is also a natural place to add type compatibility checks in the
future, so include a FIXME about that.
BUG=258153
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=176926
Patch Set 1 #
Messages
Total messages: 6 (0 generated)
|