[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 590db34 37/45: js2-parse-class-stmt: Define the class in t
From: |
Dmitry Gutov |
Subject: |
[elpa] master 590db34 37/45: js2-parse-class-stmt: Define the class in the current scope |
Date: |
Mon, 02 Feb 2015 03:18:48 +0000 |
branch: master
commit 590db346d9b81903c437761ba5f9b218871813b9
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
js2-parse-class-stmt: Define the class in the current scope
Fixes #204
---
js2-mode.el | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/js2-mode.el b/js2-mode.el
index 599e608..9802005 100644
--- a/js2-mode.el
+++ b/js2-mode.el
@@ -10248,9 +10248,16 @@ If ONLY-OF-P is non-nil, only the 'for (foo of bar)'
form is allowed."
pn))
(defun js2-parse-class-stmt ()
- (let ((pos (js2-current-token-beg)))
- (js2-must-match-name "msg.unnamed.class.stmt")
- (js2-parse-class pos 'CLASS_STATEMENT (js2-create-name-node t))))
+ (let ((pos (js2-current-token-beg))
+ (_ (js2-must-match-name "msg.unnamed.class.stmt"))
+ (name (js2-create-name-node t)))
+ (js2-set-face (js2-node-pos name) (js2-node-end name)
+ 'font-lock-function-name-face 'record)
+ (let ((node (js2-parse-class pos 'CLASS_STATEMENT name)))
+ (js2-define-symbol js2-FUNCTION
+ (js2-name-node-name name)
+ node)
+ node)))
(defun js2-parse-class-expr ()
(let ((pos (js2-current-token-beg))
@@ -10262,9 +10269,6 @@ If ONLY-OF-P is non-nil, only the 'for (foo of bar)'
form is allowed."
(defun js2-parse-class (pos form name)
;; class X [extends ...] {
(let (pn elems extends)
- (when name
- (js2-set-face (js2-node-pos name) (js2-node-end name)
- 'font-lock-function-name-face 'record))
(if (js2-match-token js2-EXTENDS)
(if (= (js2-peek-token) js2-LC)
(js2-report-error "msg.missing.extends")
- [elpa] master ab82544 23/45: Do not declare fn expression's name in the enclosing scope, (continued)
- [elpa] master ab82544 23/45: Do not declare fn expression's name in the enclosing scope, Dmitry Gutov, 2015/02/01
- [elpa] master e6dc986 24/45: Limit the scope of `with-silent-modifications', Dmitry Gutov, 2015/02/01
- [elpa] master 6a4e84b 26/45: js2-parse-for: Reword docstring and comments, Dmitry Gutov, 2015/02/01
- [elpa] master 8088e75 21/45: Add js2-language-version check for template literals, Dmitry Gutov, 2015/02/01
- [elpa] master 395d4ae 29/45: Highlight methods with font-lock-function-name-face, Dmitry Gutov, 2015/02/01
- [elpa] master a117465 32/45: Handle "arguments" specially, Dmitry Gutov, 2015/02/01
- [elpa] master 3c4367f 25/45: Make catch-node inherit from scope, Dmitry Gutov, 2015/02/01
- [elpa] master 65bd910 35/45: `js2-time' remove unused variable., Dmitry Gutov, 2015/02/01
- [elpa] master e109213 36/45: Merge pull request #203 from cheunghy/master, Dmitry Gutov, 2015/02/01
- [elpa] master b0ea681 33/45: Add animationFrame functions, Dmitry Gutov, 2015/02/01
- [elpa] master 590db34 37/45: js2-parse-class-stmt: Define the class in the current scope,
Dmitry Gutov <=
- [elpa] master ba564b7 38/45: Handle arrowfun empty-args in js2-parse-paren-expr-or-generator-comp, Dmitry Gutov, 2015/02/01
- [elpa] master 874cf77 31/45: js2-get-token-internal-1: Reindent, Dmitry Gutov, 2015/02/01
- [elpa] master 58c6636 27/45: Support ES6 module syntax, Dmitry Gutov, 2015/02/01
- [elpa] master b91f874 34/45: Merge pull request #202 from brianloveswords/add-browser-externs, Dmitry Gutov, 2015/02/01
- [elpa] master f0935fa 42/45: Add top-level heading, Dmitry Gutov, 2015/02/01
- [elpa] master 7558a96 44/45: Bump the version and update NEWS, Dmitry Gutov, 2015/02/01
- [elpa] master bc42697 40/45: Fix free variable references, Dmitry Gutov, 2015/02/01
- [elpa] master a018a79 43/45: Highlight JS snippets, Dmitry Gutov, 2015/02/01
- [elpa] master 66d69cb 39/45: js2-test-parse-string: Compare the first syntax error, Dmitry Gutov, 2015/02/01
- [elpa] master b67d97b 41/45: Move the news from the wiki to the repo, Dmitry Gutov, 2015/02/01