aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/bindings/utils.rs
diff options
context:
space:
mode:
authorbors-servo <servo-ops@mozilla.com>2020-06-04 20:55:08 -0400
committerGitHub <noreply@github.com>2020-06-04 20:55:08 -0400
commitbce6eccced1428df44c803ba81d7011abbd120ac (patch)
treef3af16a1a4a3884471c636e5caea2f1ff30f7781 /components/script/dom/bindings/utils.rs
parent98fe3603906f4b76bc2fc1f8a23db5b2e73556ff (diff)
parenta5d0e0b1c12b3bd60d1ad3e71139de2c6b493e50 (diff)
downloadservo-bce6eccced1428df44c803ba81d7011abbd120ac.tar.gz
servo-bce6eccced1428df44c803ba81d7011abbd120ac.zip
Auto merge of #26790 - jdm:fewer-generics, r=SimonSapin
Reduce scope of generic code in script Combined, these changes account for almost 100k lines of generated code in a debug build for the script crate. --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] There are tests for these changes
Diffstat (limited to 'components/script/dom/bindings/utils.rs')
-rw-r--r--components/script/dom/bindings/utils.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/components/script/dom/bindings/utils.rs b/components/script/dom/bindings/utils.rs
index 80217fea8fb..be513aa0244 100644
--- a/components/script/dom/bindings/utils.rs
+++ b/components/script/dom/bindings/utils.rs
@@ -7,7 +7,9 @@
use crate::dom::bindings::codegen::InterfaceObjectMap;
use crate::dom::bindings::codegen::PrototypeList;
use crate::dom::bindings::codegen::PrototypeList::{MAX_PROTO_CHAIN_LENGTH, PROTO_OR_IFACE_LENGTH};
-use crate::dom::bindings::conversions::{jsstring_to_str, private_from_proto_check};
+use crate::dom::bindings::conversions::{
+ jsstring_to_str, private_from_proto_check, PrototypeCheck,
+};
use crate::dom::bindings::error::throw_invalid_this;
use crate::dom::bindings::inheritance::TopTypeId;
use crate::dom::bindings::str::DOMString;
@@ -507,9 +509,8 @@ unsafe fn generic_call(
} else {
GetNonCCWObjectGlobal(JS_CALLEE(cx, vp).to_object_or_null())
});
- let depth = (*info).__bindgen_anon_3.depth;
- let proto_check =
- |class: &'static DOMClass| class.interface_chain[depth as usize] as u16 == proto_id;
+ let depth = (*info).__bindgen_anon_3.depth as usize;
+ let proto_check = PrototypeCheck::Depth { depth, proto_id };
let this = match private_from_proto_check(obj.get(), cx, proto_check) {
Ok(val) => val,
Err(()) => {