diff options
author | Ms2ger <ms2ger@gmail.com> | 2014-04-18 11:37:56 +0200 |
---|---|---|
committer | Ms2ger <ms2ger@gmail.com> | 2014-04-18 11:37:56 +0200 |
commit | 5ac5ba246896778ebeaba396687135efc72aead9 (patch) | |
tree | 719fbe5ba1fcef25c0ee3369024daedfa577bd93 /src | |
parent | b31fdf12efa8797240d04c83861105a859f44c3e (diff) | |
download | servo-5ac5ba246896778ebeaba396687135efc72aead9.tar.gz servo-5ac5ba246896778ebeaba396687135efc72aead9.zip |
Support nullable strings in dictionaries.
We copy the string in all cases, so there's no need to handle the isMember
case differently.
Diffstat (limited to 'src')
-rw-r--r-- | src/components/script/dom/bindings/codegen/CodegenRust.py | 7 | ||||
-rw-r--r-- | src/components/script/dom/webidls/TestBinding.webidl | 14 |
2 files changed, 14 insertions, 7 deletions
diff --git a/src/components/script/dom/bindings/codegen/CodegenRust.py b/src/components/script/dom/bindings/codegen/CodegenRust.py index 8d89fe1b879..0746613d80c 100644 --- a/src/components/script/dom/bindings/codegen/CodegenRust.py +++ b/src/components/script/dom/bindings/codegen/CodegenRust.py @@ -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(): diff --git a/src/components/script/dom/webidls/TestBinding.webidl b/src/components/script/dom/webidls/TestBinding.webidl index 23504dd2c44..1e7a36cb253 100644 --- a/src/components/script/dom/webidls/TestBinding.webidl +++ b/src/components/script/dom/webidls/TestBinding.webidl @@ -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 { |