Diff
Modified: trunk/JSTests/ChangeLog (262637 => 262638)
--- trunk/JSTests/ChangeLog 2020-06-05 18:51:08 UTC (rev 262637)
+++ trunk/JSTests/ChangeLog 2020-06-05 19:06:05 UTC (rev 262638)
@@ -1,3 +1,14 @@
+2020-06-05 Devin Rousso <drou...@apple.com>
+
+ Logical Assignment: perform NamedEvaluation of anonymous functions
+ https://bugs.webkit.org/show_bug.cgi?id=212679
+
+ Reviewed by Ross Kirsling.
+
+ * stress/logical-assignment-operator-and.js:
+ * stress/logical-assignment-operator-coalesce.js:
+ * stress/logical-assignment-operator-or.js:
+
2020-06-05 Caitlin Potter <ca...@igalia.com>
[JSC] Add support for private class fields
Modified: trunk/JSTests/stress/logical-assignment-operator-and.js (262637 => 262638)
--- trunk/JSTests/stress/logical-assignment-operator-and.js 2020-06-05 18:51:08 UTC (rev 262637)
+++ trunk/JSTests/stress/logical-assignment-operator-and.js 2020-06-05 19:06:05 UTC (rev 262638)
@@ -1680,3 +1680,23 @@
shouldThrowSyntaxError(`{} &&= 42`);
shouldThrowSyntaxError(`[] &&= 42`);
+
+
+
+shouldBe(function() {
+ let x = true;
+ x &&= function() {};
+ return x.name;
+}, "x");
+
+shouldBe(function() {
+ let x = true;
+ x &&= () => {};
+ return x.name;
+}, "x");
+
+shouldBe(function() {
+ let x = true;
+ x &&= class {};
+ return x.name;
+}, "x");
Modified: trunk/JSTests/stress/logical-assignment-operator-coalesce.js (262637 => 262638)
--- trunk/JSTests/stress/logical-assignment-operator-coalesce.js 2020-06-05 18:51:08 UTC (rev 262637)
+++ trunk/JSTests/stress/logical-assignment-operator-coalesce.js 2020-06-05 19:06:05 UTC (rev 262638)
@@ -1695,3 +1695,23 @@
shouldThrowSyntaxError(`{} ??= 42`);
shouldThrowSyntaxError(`[] ??= 42`);
+
+
+
+shouldBe(function() {
+ let x = null;
+ x ??= function() {};
+ return x.name;
+}, "x");
+
+shouldBe(function() {
+ let x = null;
+ x ??= () => {};
+ return x.name;
+}, "x");
+
+shouldBe(function() {
+ let x = null;
+ x ??= class {};
+ return x.name;
+}, "x");
Modified: trunk/JSTests/stress/logical-assignment-operator-or.js (262637 => 262638)
--- trunk/JSTests/stress/logical-assignment-operator-or.js 2020-06-05 18:51:08 UTC (rev 262637)
+++ trunk/JSTests/stress/logical-assignment-operator-or.js 2020-06-05 19:06:05 UTC (rev 262638)
@@ -1681,3 +1681,23 @@
shouldThrowSyntaxError(`{} ||= 42`);
shouldThrowSyntaxError(`[] ||= 42`);
+
+
+
+shouldBe(function() {
+ let x = false;
+ x ||= function() {};
+ return x.name;
+}, "x");
+
+shouldBe(function() {
+ let x = false;
+ x ||= () => {};
+ return x.name;
+}, "x");
+
+shouldBe(function() {
+ let x = false;
+ x ||= class {};
+ return x.name;
+}, "x");
Modified: trunk/Source/_javascript_Core/ChangeLog (262637 => 262638)
--- trunk/Source/_javascript_Core/ChangeLog 2020-06-05 18:51:08 UTC (rev 262637)
+++ trunk/Source/_javascript_Core/ChangeLog 2020-06-05 19:06:05 UTC (rev 262638)
@@ -1,3 +1,13 @@
+2020-06-05 Devin Rousso <drou...@apple.com>
+
+ Logical Assignment: perform NamedEvaluation of anonymous functions
+ https://bugs.webkit.org/show_bug.cgi?id=212679
+
+ Reviewed by Ross Kirsling.
+
+ * parser/ASTBuilder.h:
+ (JSC::ASTBuilder::makeAssignNode):
+
2020-06-05 Yusuke Suzuki <ysuz...@apple.com>
DOM constructor should only accept Ref<> / ExceptionOr<Ref<>> for creation to ensure toJSNewlyCreated is always returning object
Modified: trunk/Source/_javascript_Core/parser/ASTBuilder.h (262637 => 262638)
--- trunk/Source/_javascript_Core/parser/ASTBuilder.h 2020-06-05 18:51:08 UTC (rev 262637)
+++ trunk/Source/_javascript_Core/parser/ASTBuilder.h 2020-06-05 19:06:05 UTC (rev 262638)
@@ -1577,8 +1577,14 @@
return node;
}
- if (op == Operator::CoalesceEq || op == Operator::OrEq || op == Operator::AndEq)
+ if (op == Operator::CoalesceEq || op == Operator::OrEq || op == Operator::AndEq) {
+ if (expr->isBaseFuncExprNode()) {
+ auto metadata = static_cast<BaseFuncExprNode*>(expr)->metadata();
+ metadata->setEcmaName(resolve->identifier());
+ } else if (expr->isClassExprNode())
+ static_cast<ClassExprNode*>(expr)->setEcmaName(resolve->identifier());
return new (m_parserArena) ShortCircuitReadModifyResolveNode(location, resolve->identifier(), op, expr, exprHasAssignments, divot, start, end);
+ }
return new (m_parserArena) ReadModifyResolveNode(location, resolve->identifier(), op, expr, exprHasAssignments, divot, start, end);
}