summaryrefslogtreecommitdiff
path: root/js/src/proxy/BaseProxyHandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/proxy/BaseProxyHandler.cpp')
-rw-r--r--js/src/proxy/BaseProxyHandler.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/js/src/proxy/BaseProxyHandler.cpp b/js/src/proxy/BaseProxyHandler.cpp
index 516ecd79d8..6cd526d059 100644
--- a/js/src/proxy/BaseProxyHandler.cpp
+++ b/js/src/proxy/BaseProxyHandler.cpp
@@ -319,8 +319,9 @@ BaseProxyHandler::fun_toString(JSContext* cx, HandleObject proxy, bool isToSourc
{
if (proxy->isCallable())
return JS_NewStringCopyZ(cx, "function () {\n [native code]\n}");
- RootedValue v(cx, ObjectValue(*proxy));
- ReportIsNotFunction(cx, v);
+
+ JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_INCOMPATIBLE_PROTO,
+ js_Function_str, js_toString_str, "object");
return nullptr;
}