From 016449ab3c7629cd145259e35615efdeeea41aaf Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Fri, 10 Aug 2018 13:15:12 -0700 Subject: [PATCH] backend: when complaining about setter names, show the name we are complaining about --- crates/backend/src/ast.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/backend/src/ast.rs b/crates/backend/src/ast.rs index 57869a89..634e6e4e 100644 --- a/crates/backend/src/ast.rs +++ b/crates/backend/src/ast.rs @@ -346,7 +346,9 @@ impl ImportFunction { /// for a setter in javascript (in this case `xxx`, so you can write `obj.xxx = val`) fn infer_setter_property(&self) -> String { let name = self.function.name.to_string(); - assert!(name.starts_with("set_"), "setters must start with `set_`"); + if !name.starts_with("set_") { + panic!("error: setters must start with `set_`, found: {}", name); + } name[4..].to_string() }