Skip to content

Commit

Permalink
Fixed #33
Browse files Browse the repository at this point in the history
  • Loading branch information
HairyRabbit committed Dec 28, 2017
1 parent 001f2ca commit 00b0582
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js2-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -12163,8 +12163,8 @@ When `js2-is-in-destructuring' is t, forms like {a, b, c} will be permitted."
(= (js2-peek-token) js2-COLON))
(js2-node-set-prop key :type-annotation (js2-parse-type-annotation)))
;; parse type params for class method prop
(when (and class-p
(= (js2-peek-token) js2-LT))
;; TODO(rabbit): object method also has this feature
(when (= (js2-peek-token) js2-LT)
(setq type-params (js2-parse-type-params)))
(cond
;; method definition: {f() {...}}
Expand Down
3 changes: 3 additions & 0 deletions tests/flow.el
Original file line number Diff line number Diff line change
Expand Up @@ -1062,3 +1062,6 @@ switch (a) {
case b:
break;
}")

(js2-deftest-parse object-method-with-type-params
"var a = {b<c>() {}};")

0 comments on commit 00b0582

Please sign in to comment.