mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Support enumerations in dictionaries.
This commit is contained in:
parent
7e310d1949
commit
6d619f484c
2 changed files with 3 additions and 3 deletions
|
@ -686,7 +686,7 @@ def getJSToNativeConversionTemplate(type, descriptorProvider, failureCode=None,
|
||||||
"yet")
|
"yet")
|
||||||
enum = type.inner.identifier.name
|
enum = type.inner.identifier.name
|
||||||
if invalidEnumValueFatal:
|
if invalidEnumValueFatal:
|
||||||
handleInvalidEnumValueCode = "return 0;"
|
handleInvalidEnumValueCode = exceptionCode
|
||||||
else:
|
else:
|
||||||
handleInvalidEnumValueCode = "return 1;"
|
handleInvalidEnumValueCode = "return 1;"
|
||||||
|
|
||||||
|
@ -696,7 +696,7 @@ def getJSToNativeConversionTemplate(type, descriptorProvider, failureCode=None,
|
||||||
" Ok(None) => { %(handleInvalidEnumValueCode)s },\n"
|
" Ok(None) => { %(handleInvalidEnumValueCode)s },\n"
|
||||||
" Ok(Some(index)) => {\n"
|
" Ok(Some(index)) => {\n"
|
||||||
" //XXXjdm need some range checks up in here.\n"
|
" //XXXjdm need some range checks up in here.\n"
|
||||||
" cast::transmute(index)\n"
|
" unsafe { cast::transmute(index) }\n"
|
||||||
" },\n"
|
" },\n"
|
||||||
"}" % { "values" : enum + "Values::strings",
|
"}" % { "values" : enum + "Values::strings",
|
||||||
"exceptionCode" : exceptionCode,
|
"exceptionCode" : exceptionCode,
|
||||||
|
|
|
@ -35,7 +35,7 @@ dictionary TestDictionaryDefaults {
|
||||||
// float floatValue = 7.0;
|
// float floatValue = 7.0;
|
||||||
// double doubleValue = 7.0;
|
// double doubleValue = 7.0;
|
||||||
DOMString stringValue = "";
|
DOMString stringValue = "";
|
||||||
// TestEnum enumValue = "bar";
|
TestEnum enumValue = "bar";
|
||||||
any anyValue = null;
|
any anyValue = null;
|
||||||
|
|
||||||
boolean? nullableBooleanValue = false;
|
boolean? nullableBooleanValue = false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue