fix clippy warnings in codegen (#33781)

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
This commit is contained in:
Gae24 2024-10-10 18:15:05 +02:00 committed by GitHub
parent f9a06d62a2
commit c6d305fbb3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2761,7 +2761,7 @@ class CGAbstractMethod(CGThing):
if self.returnType == "void":
pre = "wrap_panic(&mut || {\n"
post = "\n})"
elif "return" not in body.define():
elif "return" not in body.define() or self.name.startswith("_constructor"):
pre = (
"let mut result = false;\n"
"wrap_panic(&mut || result = {\n"
@ -6254,7 +6254,7 @@ let global = GlobalScope::from_object(JS_CALLEE(*cx, vp).to_object());
]
else:
args = [
"&global",
"global",
"Some(desired_proto.handle())",
"CanGc::note()"
]