mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Auto merge of #10288 - jdm:dictseq, r=nox
Enable dictionaries in WebIDL sequences. Fixes #10282. r? @nox <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10288) <!-- Reviewable:end -->
This commit is contained in:
commit
acaac52be7
2 changed files with 9 additions and 0 deletions
|
@ -5186,6 +5186,14 @@ class CGDictionary(CGThing):
|
|||
" }\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"
|
||||
" unsafe fn to_jsval(&self, cx: *mut JSContext, rval: MutableHandleValue) {\n"
|
||||
" let obj = RootedObject::new(cx, JS_NewObject(cx, ptr::null()));\n"
|
||||
|
|
|
@ -29,6 +29,7 @@ dictionary TestDictionary {
|
|||
any anyValue;
|
||||
object objectValue;
|
||||
TestDictionaryDefaults dict;
|
||||
sequence<TestDictionaryDefaults> seqDict;
|
||||
};
|
||||
|
||||
dictionary TestDictionaryDefaults {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue