Title: [264633] trunk
Revision
264633
Author
[email protected]
Date
2020-07-20 16:28:28 -0700 (Mon, 20 Jul 2020)

Log Message

[JSC] eval?.() should be indirect eval
https://bugs.webkit.org/show_bug.cgi?id=214568

Reviewed by Keith Miller.

JSTests:

* test262/expectations.yaml:
Mark two test cases as passing.

Source/_javascript_Core:

eval?.() is specified as indirect eval, but (virtually) all implementations assumed it should be direct eval.
I raised this topic in today's TC39 meeting and we've decided to keep the spec as it is.

* parser/ASTBuilder.h:
(JSC::ASTBuilder::makeFunctionCallNode):
Don't use EvalFunctionCallNode for optional call of eval.

Modified Paths

Diff

Modified: trunk/JSTests/ChangeLog (264632 => 264633)


--- trunk/JSTests/ChangeLog	2020-07-20 23:27:39 UTC (rev 264632)
+++ trunk/JSTests/ChangeLog	2020-07-20 23:28:28 UTC (rev 264633)
@@ -1,3 +1,13 @@
+2020-07-20  Ross Kirsling  <[email protected]>
+
+        [JSC] eval?.() should be indirect eval
+        https://bugs.webkit.org/show_bug.cgi?id=214568
+
+        Reviewed by Keith Miller.
+
+        * test262/expectations.yaml:
+        Mark two test cases as passing.
+
 2020-07-20  Keith Miller  <[email protected]>
 
         Turn on FinalizationRegistry test262 tests

Modified: trunk/JSTests/test262/expectations.yaml (264632 => 264633)


--- trunk/JSTests/test262/expectations.yaml	2020-07-20 23:27:39 UTC (rev 264632)
+++ trunk/JSTests/test262/expectations.yaml	2020-07-20 23:28:28 UTC (rev 264633)
@@ -2838,9 +2838,6 @@
   default: 'Test262Error: Expected SameValue(«outside», «inside») to be true'
 test/language/expressions/object/scope-setter-body-lex-distinc.js:
   default: 'Test262Error: Expected a SyntaxError to be thrown but no exception was thrown at all'
-test/language/expressions/optional-chaining/eval-optional-call.js:
-  default: 'Test262Error: fn() returns "global" value from indirect eval Expected SameValue(«local», «global») to be true'
-  strict mode: 'Test262Error: fn() returns "global" value from indirect eval Expected SameValue(«local», «global») to be true'
 test/language/expressions/postfix-decrement/S11.3.2_A5_T1.js:
   default: "ReferenceError: Can't find variable: x"
 test/language/expressions/postfix-decrement/S11.3.2_A5_T2.js:

Modified: trunk/Source/_javascript_Core/ChangeLog (264632 => 264633)


--- trunk/Source/_javascript_Core/ChangeLog	2020-07-20 23:27:39 UTC (rev 264632)
+++ trunk/Source/_javascript_Core/ChangeLog	2020-07-20 23:28:28 UTC (rev 264633)
@@ -1,3 +1,17 @@
+2020-07-20  Ross Kirsling  <[email protected]>
+
+        [JSC] eval?.() should be indirect eval
+        https://bugs.webkit.org/show_bug.cgi?id=214568
+
+        Reviewed by Keith Miller.
+
+        eval?.() is specified as indirect eval, but (virtually) all implementations assumed it should be direct eval.
+        I raised this topic in today's TC39 meeting and we've decided to keep the spec as it is. 
+
+        * parser/ASTBuilder.h:
+        (JSC::ASTBuilder::makeFunctionCallNode):
+        Don't use EvalFunctionCallNode for optional call of eval.
+
 2020-07-20  Adrian Perez de Castro  <[email protected]>
 
         Non unified build fixes, midsummer 2020 edition

Modified: trunk/Source/_javascript_Core/parser/ASTBuilder.h (264632 => 264633)


--- trunk/Source/_javascript_Core/parser/ASTBuilder.h	2020-07-20 23:27:39 UTC (rev 264632)
+++ trunk/Source/_javascript_Core/parser/ASTBuilder.h	2020-07-20 23:28:28 UTC (rev 264633)
@@ -1427,7 +1427,7 @@
     if (func->isResolveNode()) {
         ResolveNode* resolve = static_cast<ResolveNode*>(func);
         const Identifier& identifier = resolve->identifier();
-        if (identifier == m_vm.propertyNames->eval) {
+        if (identifier == m_vm.propertyNames->eval && !isOptionalCall) {
             usesEval();
             return new (m_parserArena) EvalFunctionCallNode(location, args, divot, divotStart, divotEnd);
         }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to