From c24481ab9c9a7e7e944c91673532578f8c121e0f Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Wed, 8 Apr 2020 23:13:59 -0700 Subject: [PATCH] Do not filter out platform objects when doing dictionary conversions https://heycam.github.io/webidl/#es-overloads In step 12, the platform object check is for substep 4, but importantly it only matters if `V` implements the matching interface. If not, it should be able to fall back to substep 10 and attempt conversion to a dictionary. --- components/script/dom/bindings/codegen/CodegenRust.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py index 96947d83ec7..d4b103cc21b 100644 --- a/components/script/dom/bindings/codegen/CodegenRust.py +++ b/components/script/dom/bindings/codegen/CodegenRust.py @@ -429,8 +429,8 @@ class CGMethodCall(CGThing): # Check for vanilla JS objects # XXXbz Do we need to worry about security wrappers? - pickFirstSignature("%s.get().is_object() && !is_platform_object(%s.get().to_object(), *cx)" % - (distinguishingArg, distinguishingArg), + pickFirstSignature("%s.get().is_object()" % + distinguishingArg, lambda s: (s[1][distinguishingIndex].type.isCallback() or s[1][distinguishingIndex].type.isCallbackInterface() or s[1][distinguishingIndex].type.isDictionary() or