From 01e0480cd8d6eaca46f738e84e876a217fed525f Mon Sep 17 00:00:00 2001 From: Steven nguyen Date: Wed, 19 Jan 2022 19:34:27 +0000 Subject: [PATCH] Copy/paste fix in Proxy error message (#1787) (Really small self-explanatory change - maybe the commit message could be better) It changes the following: When calling `new Proxy(undefined, {})` the error message now refers to the target `undefined` instead of the handler `{}` --- boa/src/builtins/proxy/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boa/src/builtins/proxy/mod.rs b/boa/src/builtins/proxy/mod.rs index 14df5cb9da..7ee80b1150 100644 --- a/boa/src/builtins/proxy/mod.rs +++ b/boa/src/builtins/proxy/mod.rs @@ -96,7 +96,7 @@ impl Proxy { fn create(target: &JsValue, handler: &JsValue, context: &mut Context) -> JsResult { // 1. If Type(target) is not Object, throw a TypeError exception. let target = target.as_object().ok_or_else(|| { - context.construct_type_error("Proxy constructor called with non-object handler") + context.construct_type_error("Proxy constructor called with non-object target") })?; // 2. If Type(handler) is not Object, throw a TypeError exception.