diff --git a/boa/src/vm/mod.rs b/boa/src/vm/mod.rs index 670fdb1795..4bee56fef1 100644 --- a/boa/src/vm/mod.rs +++ b/boa/src/vm/mod.rs @@ -459,8 +459,9 @@ impl Context { let exists = self.global_bindings_mut().contains_key(&key); if !exists && (self.strict() || self.vm.frame().code.strict) { - return self - .throw_reference_error(format!("binding already exists: {key}")); + return self.throw_reference_error(format!( + "assignment to undeclared variable {key}" + )); } let success = crate::object::internal_methods::global::global_set_no_receiver(