diff options
author | Martok <martok@martoks-place.de> | 2022-07-01 17:36:42 +0200 |
---|---|---|
committer | Martok <martok@martoks-place.de> | 2022-07-01 20:25:05 +0200 |
commit | 9221d442071a8320d0b8e3610adc8aeb4d6323f2 (patch) | |
tree | 46a3ca6b3def06a815c5e2c5ab8c7dab413ad881 /js/src/proxy/ScriptedProxyHandler.cpp | |
parent | 4bf20fc91ed7517339f0cedec98ca2db6aff9f8f (diff) | |
download | uxp-9221d442071a8320d0b8e3610adc8aeb4d6323f2.tar.gz |
Issue #1952 - m-c 1440468: Proxied functions can't be passed to Function.prototype.toString.call()
Diffstat (limited to 'js/src/proxy/ScriptedProxyHandler.cpp')
-rw-r--r-- | js/src/proxy/ScriptedProxyHandler.cpp | 6 |
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 |