summaryrefslogtreecommitdiff
path: root/js/src/proxy/ScriptedProxyHandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/proxy/ScriptedProxyHandler.cpp')
-rw-r--r--js/src/proxy/ScriptedProxyHandler.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/js/src/proxy/ScriptedProxyHandler.cpp b/js/src/proxy/ScriptedProxyHandler.cpp
index 19d4b67850..5a219e2e3f 100644
--- a/js/src/proxy/ScriptedProxyHandler.cpp
+++ b/js/src/proxy/ScriptedProxyHandler.cpp
@@ -1259,9 +1259,9 @@ ScriptedProxyHandler::className(JSContext* cx, HandleObject proxy) const
JSString*
ScriptedProxyHandler::fun_toString(JSContext* cx, HandleObject proxy, bool isToSource) const
{
- JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_INCOMPATIBLE_PROTO,
- js_Function_str, js_toString_str, "object");
- return nullptr;
+ // The BaseProxyHandler has the desired behavior: Throw for non-callable,
+ // otherwise return [native code].
+ return BaseProxyHandler::fun_toString(cx, proxy, isToSource);
}
bool