mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Support nullable strings in dictionaries.
We copy the string in all cases, so there's no need to handle the isMember case differently.
This commit is contained in:
parent
b31fdf12ef
commit
5ac5ba2468
2 changed files with 14 additions and 7 deletions
|
@ -702,13 +702,6 @@ def getJSToNativeConversionTemplate(type, descriptorProvider, failureCode=None,
|
|||
|
||||
return handleDefault(conversionCode, default)
|
||||
|
||||
if isMember:
|
||||
# We have to make a copy, because our jsval may well not
|
||||
# live as long as our string needs to.
|
||||
declType = CGGeneric("DOMString")
|
||||
return ("%s\n" % getConversionCode(),
|
||||
declType, None, isOptional, None)
|
||||
|
||||
declType = "DOMString"
|
||||
initialValue = None
|
||||
if type.nullable():
|
||||
|
|
|
@ -36,6 +36,20 @@ dictionary TestDictionaryDefaults {
|
|||
// double doubleValue = 7.0;
|
||||
DOMString stringValue = "";
|
||||
// TestEnum enumValue = "bar";
|
||||
|
||||
// boolean? nullableBooleanValue = false;
|
||||
// byte? nullableByteValue = 7;
|
||||
// octet? nullableOctetValue = 7;
|
||||
short? nullableShortValue = 7;
|
||||
unsigned short? nullableUnsignedShortValue = 7;
|
||||
long? nullableLongValue = 7;
|
||||
unsigned long? nullableUnsignedLongValue = 7;
|
||||
// long long? nullableLongLongValue = 7;
|
||||
// unsigned long long? nullableUnsignedLongLongValue = 7;
|
||||
// float? nullableFloatValue = 7.0;
|
||||
// double? nullableDoubleValue = 7.0;
|
||||
DOMString? nullableStringValue = "";
|
||||
// TestEnum? nullableEnumValue = "bar";
|
||||
};
|
||||
|
||||
interface TestBinding {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue