Enable dictionaries in WebIDL sequences. Fixes #10282.

This commit is contained in:
Josh Matthews 2016-03-30 11:07:37 -04:00
parent 803f39df19
commit 042883eac2
2 changed files with 9 additions and 0 deletions

View file

@ -5186,6 +5186,14 @@ class CGDictionary(CGThing):
" }\n" " }\n"
"}\n" "}\n"
"\n" "\n"
"impl FromJSValConvertible for ${selfName} {\n"
" type Config = ();\n"
" unsafe fn from_jsval(cx: *mut JSContext, value: HandleValue, _option: ())\n"
" -> Result<${selfName}, ()> {\n"
" ${selfName}::new(cx, value)\n"
" }\n"
"}\n"
"\n"
"impl ToJSValConvertible for ${selfName} {\n" "impl ToJSValConvertible for ${selfName} {\n"
" unsafe fn to_jsval(&self, cx: *mut JSContext, rval: MutableHandleValue) {\n" " unsafe fn to_jsval(&self, cx: *mut JSContext, rval: MutableHandleValue) {\n"
" let obj = RootedObject::new(cx, JS_NewObject(cx, ptr::null()));\n" " let obj = RootedObject::new(cx, JS_NewObject(cx, ptr::null()));\n"

View file

@ -29,6 +29,7 @@ dictionary TestDictionary {
any anyValue; any anyValue;
object objectValue; object objectValue;
TestDictionaryDefaults dict; TestDictionaryDefaults dict;
sequence<TestDictionaryDefaults> seqDict;
}; };
dictionary TestDictionaryDefaults { dictionary TestDictionaryDefaults {