Title: [246333] trunk
- Revision
- 246333
- Author
- [email protected]
- Date
- 2019-06-11 14:42:41 -0700 (Tue, 11 Jun 2019)
Log Message
Error message for non-callable Proxy `construct` trap is misleading
https://bugs.webkit.org/show_bug.cgi?id=198637
Patch by Alexey Shvayka <[email protected]> on 2019-06-11
Reviewed by Saam Barati.
JSTests:
* stress/proxy-construct.js:
Source/_javascript_Core:
Just like other traps, Proxy `construct` trap is invoked with [[Call]], not [[Construct]].
* runtime/ProxyObject.cpp:
(JSC::performProxyConstruct): Tweak error message.
Modified Paths
Diff
Modified: trunk/JSTests/ChangeLog (246332 => 246333)
--- trunk/JSTests/ChangeLog 2019-06-11 21:06:45 UTC (rev 246332)
+++ trunk/JSTests/ChangeLog 2019-06-11 21:42:41 UTC (rev 246333)
@@ -1,3 +1,12 @@
+2019-06-11 Alexey Shvayka <[email protected]>
+
+ Error message for non-callable Proxy `construct` trap is misleading
+ https://bugs.webkit.org/show_bug.cgi?id=198637
+
+ Reviewed by Saam Barati.
+
+ * stress/proxy-construct.js:
+
2019-06-10 Tadeu Zagallo <[email protected]>
AI BitURShift's result should not be unsigned
Modified: trunk/JSTests/stress/proxy-construct.js (246332 => 246333)
--- trunk/JSTests/stress/proxy-construct.js 2019-06-11 21:06:45 UTC (rev 246332)
+++ trunk/JSTests/stress/proxy-construct.js 2019-06-11 21:42:41 UTC (rev 246333)
@@ -15,7 +15,7 @@
new proxy;
} catch(e) {
threw = true;
- assert(e.toString() === "TypeError: 'construct' property of a Proxy's handler should be constructible");
+ assert(e.toString() === "TypeError: 'construct' property of a Proxy's handler should be callable");
}
assert(threw);
}
@@ -33,7 +33,7 @@
new proxy;
} catch(e) {
threw = true;
- assert(e.toString() === "TypeError: 'construct' property of a Proxy's handler should be constructible");
+ assert(e.toString() === "TypeError: 'construct' property of a Proxy's handler should be callable");
}
assert(threw);
}
Modified: trunk/Source/_javascript_Core/ChangeLog (246332 => 246333)
--- trunk/Source/_javascript_Core/ChangeLog 2019-06-11 21:06:45 UTC (rev 246332)
+++ trunk/Source/_javascript_Core/ChangeLog 2019-06-11 21:42:41 UTC (rev 246333)
@@ -1,3 +1,15 @@
+2019-06-11 Alexey Shvayka <[email protected]>
+
+ Error message for non-callable Proxy `construct` trap is misleading
+ https://bugs.webkit.org/show_bug.cgi?id=198637
+
+ Reviewed by Saam Barati.
+
+ Just like other traps, Proxy `construct` trap is invoked with [[Call]], not [[Construct]].
+
+ * runtime/ProxyObject.cpp:
+ (JSC::performProxyConstruct): Tweak error message.
+
2019-06-10 Tadeu Zagallo <[email protected]>
AI BitURShift's result should not be unsigned
Modified: trunk/Source/_javascript_Core/runtime/ProxyObject.cpp (246332 => 246333)
--- trunk/Source/_javascript_Core/runtime/ProxyObject.cpp 2019-06-11 21:06:45 UTC (rev 246332)
+++ trunk/Source/_javascript_Core/runtime/ProxyObject.cpp 2019-06-11 21:42:41 UTC (rev 246333)
@@ -571,7 +571,7 @@
JSObject* handler = jsCast<JSObject*>(handlerValue);
CallData callData;
CallType callType;
- JSValue constructMethod = handler->getMethod(exec, callData, callType, makeIdentifier(vm, "construct"), "'construct' property of a Proxy's handler should be constructible"_s);
+ JSValue constructMethod = handler->getMethod(exec, callData, callType, makeIdentifier(vm, "construct"), "'construct' property of a Proxy's handler should be callable"_s);
RETURN_IF_EXCEPTION(scope, encodedJSValue());
JSObject* target = proxy->target();
if (constructMethod.isUndefined()) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes