emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master bb6c388 06/31: ES6 yield is followed by AssignmentExpressi


From: Dmitry Gutov
Subject: [elpa] master bb6c388 06/31: ES6 yield is followed by AssignmentExpression
Date: Fri, 21 Jul 2017 09:04:54 -0400 (EDT)

branch: master
commit bb6c388181352dcaeeb8d1f192c708c28beb337f
Author: Carl Lei <address@hidden>
Commit: Carl Lei <address@hidden>

    ES6 yield is followed by AssignmentExpression
---
 js2-mode.el     | 4 +++-
 tests/parser.el | 3 +++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/js2-mode.el b/js2-mode.el
index 1e7d2be..d18455d 100644
--- a/js2-mode.el
+++ b/js2-mode.el
@@ -9388,7 +9388,9 @@ but not BEFORE."
       (setq yield-star-p t))
     ;; This is ugly, but we don't want to require a semicolon.
     (unless (memq (js2-peek-token-or-eol) js2-parse-return-stmt-enders)
-      (setq e (js2-parse-expr)
+      (setq e (if (eq gen-type 'STAR)
+                  (js2-parse-assign-expr)
+                (js2-parse-expr))
             end (js2-node-end e)))
     (cond
      ((eq tt js2-RETURN)
diff --git a/tests/parser.el b/tests/parser.el
index de97343..ead7a88 100644
--- a/tests/parser.el
+++ b/tests/parser.el
@@ -456,6 +456,9 @@ the test."
 
 (js2-deftest-parse harmony-generator-yield-star "(function*(a) {  yield* 
a;\n});")
 
+(js2-deftest-parse harmony-generator-yield-assign-expr
+  "(function*() {  return {a: yield a, b: yield b, c: yield c};\n});")
+
 ;;; Comprehensions
 
 (js2-deftest-parse parse-legacy-array-comp-loop-with-filter



reply via email to

[Prev in Thread] Current Thread [Next in Thread]