[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master b6d9301 17/49: Merge pull request #377 from XeCycle/memfn-
From: |
Dmitry Gutov |
Subject: |
[elpa] master b6d9301 17/49: Merge pull request #377 from XeCycle/memfn-delete |
Date: |
Mon, 16 Jan 2017 15:35:47 +0000 (UTC) |
branch: master
commit b6d93015e865bfbd9c2d9846fc45ac039bcdc1d4
Merge: 2b32301 9b63a13
Author: Dmitry Gutov <address@hidden>
Commit: GitHub <address@hidden>
Merge pull request #377 from XeCycle/memfn-delete
Special methods should allow keywords as names
---
js2-mode.el | 6 +++---
tests/parser.el | 3 +++
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/js2-mode.el b/js2-mode.el
index fb3482c..3f18bc1 100644
--- a/js2-mode.el
+++ b/js2-mode.el
@@ -7734,14 +7734,14 @@ is only true until the node is added to its parent;
i.e., while parsing."
;; Tell cc-engine the bounds of the comment.
(js2-record-text-property beg (1- end) 'c-in-sws t)))))
-(defun js2-peek-token ()
+(defun js2-peek-token (&optional modifier)
"Return the next token type without consuming it.
If `js2-ti-lookahead' is positive, return the type of next token
from `js2-ti-tokens'. Otherwise, call `js2-get-token'."
(if (not (zerop js2-ti-lookahead))
(js2-token-type
(aref js2-ti-tokens (mod (1+ js2-ti-tokens-cursor) js2-ti-ntokens)))
- (let ((tt (js2-get-token-internal nil)))
+ (let ((tt (js2-get-token-internal modifier)))
(js2-unget-token)
tt)))
@@ -10805,7 +10805,7 @@ expression)."
(when (and (>= js2-language-version 200)
(= js2-NAME tt)
(member prop '("get" "set" "async"))
- (member (js2-peek-token)
+ (member (js2-peek-token 'KEYWORD_IS_NAME)
(list js2-NAME js2-STRING js2-NUMBER js2-LB)))
(setq previous-token (js2-current-token)
tt (js2-get-prop-name-token))))
diff --git a/tests/parser.el b/tests/parser.el
index a0e2c5a..f6345e1 100644
--- a/tests/parser.el
+++ b/tests/parser.el
@@ -497,6 +497,9 @@ the test."
(js2-deftest-parse async-method-in-object-literal
"({async f() {}});")
+(js2-deftest-parse async-method-kwname-in-object-literal
+ "({async delete() {}});")
+
(js2-deftest-parse async-method-in-class-body
"class C {\n async foo() {}\n}")
- [elpa] master 2b32301 15/49: Propertize regexp starting with /= correctly, (continued)
- [elpa] master 2b32301 15/49: Propertize regexp starting with /= correctly, Dmitry Gutov, 2017/01/16
- [elpa] master 68db1f5 05/49: Makefile: use -Q to avoid site-lisp loading, Dmitry Gutov, 2017/01/16
- [elpa] master 4e5babf 03/49: Merge pull request #345 from jacott/master, Dmitry Gutov, 2017/01/16
- [elpa] master 980eb3d 04/49: Support ES7 exponentiation, Dmitry Gutov, 2017/01/16
- [elpa] master 49f9761 08/49: js2-jsdoc-arg-tag-regexp: Recognize @module, Dmitry Gutov, 2017/01/16
- [elpa] master e45206b 11/49: js2-parse-class: Convert positions to relative for NAME and EXTENDS, too, Dmitry Gutov, 2017/01/16
- [elpa] master bea6942 13/49: Unbind js2-mode-show-node, Dmitry Gutov, 2017/01/16
- [elpa] master c0801b2 12/49: Propertize regexp literals like js-mode does, Dmitry Gutov, 2017/01/16
- [elpa] master 9a8aaa9 28/49: Fix length of name in namespace-import nodes, Dmitry Gutov, 2017/01/16
- [elpa] master 44c289f 24/49: Copy edits, Dmitry Gutov, 2017/01/16
- [elpa] master b6d9301 17/49: Merge pull request #377 from XeCycle/memfn-delete,
Dmitry Gutov <=
- [elpa] master 64ec0a2 14/49: Allow newline in globals declaration, Dmitry Gutov, 2017/01/16
- [elpa] master 2801681 26/49: Fix "pos" argument in template node constructors, Dmitry Gutov, 2017/01/16
- [elpa] master 712dfb0 29/49: Merge pull request #384 from mishoo/master, Dmitry Gutov, 2017/01/16
- [elpa] master df06798 23/49: Merge pull request #378 from JulianKniephoff/include-externs-locally, Dmitry Gutov, 2017/01/16
- [elpa] master 2a79649 33/49: Fix indentation after regexp in js2-old-indent.el, Dmitry Gutov, 2017/01/16
- [elpa] master f450de0 34/49: Handle destructuring assignments when classifying variables, Dmitry Gutov, 2017/01/16
- [elpa] master 90e37cd 45/49: Merge pull request #397 from lelit/issue393, Dmitry Gutov, 2017/01/16
- [elpa] master 9b63a13 16/49: Special methods should allow keywords as names, Dmitry Gutov, 2017/01/16
- [elpa] master 672e2da 07/49: js2-parse-mul-expr: Parse the right operand as exponentiation too, Dmitry Gutov, 2017/01/16
- [elpa] master a91e357 40/49: Create a separate scope for switch statements, Dmitry Gutov, 2017/01/16