[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/js2-mode 7f4ada4 49/61: start implementing NULLISH-COAL
From: |
Dmitry Gutov |
Subject: |
[elpa] externals/js2-mode 7f4ada4 49/61: start implementing NULLISH-COALESCING, likely incomplete |
Date: |
Sun, 20 Dec 2020 12:20:10 -0500 (EST) |
branch: externals/js2-mode
commit 7f4ada4c861f6748721ca644889b2b47cd8237ca
Author: babenhauserheide <arne.babenhauserheide@disy.net>
Commit: babenhauserheide <arne.babenhauserheide@disy.net>
start implementing NULLISH-COALESCING, likely incomplete
---
js2-mode.el | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/js2-mode.el b/js2-mode.el
index b91d583..66cbbaa 100644
--- a/js2-mode.el
+++ b/js2-mode.el
@@ -652,6 +652,7 @@ which doesn't seem particularly useful, but Rhino permits
it."
(defvar js2-HOOK 170) ; conditional (?:)
(defvar js2-OPTIONAL-CHAINING 171) ; optional chaining (?.prop obj?.[expr]
func?.())
(defvar js2-EXPON 172)
+(defvar js2-NULLISH-COALESCING 173) ; nullish coalescing (obj.value ??
obj.defaultValue ?? 0))
(defconst js2-num-tokens (1+ js2-EXPON))
@@ -3482,6 +3483,7 @@ The type field inherited from `js2-node' holds the
operator."
(cons js2-COLON ":")
(cons js2-OR "||")
(cons js2-AND "&&")
+ (cons js2-NULLISH-COALESCING "??")
(cons js2-INC "++")
(cons js2-DEC "--")
(cons js2-BITOR "|")
@@ -5134,7 +5136,8 @@ You should use `js2-print-tree' instead of this function."
((= tt js2-COMMA)
(js2-node-has-side-effects (js2-infix-node-right node)))
((or (= tt js2-AND)
- (= tt js2-OR))
+ (= tt js2-OR)
+ (= tt js2-NULLISH-COALESCING)
(or (js2-node-has-side-effects (js2-infix-node-right node))
(js2-node-has-side-effects (js2-infix-node-left node))))
((= tt js2-HOOK)
@@ -6095,7 +6098,9 @@ its relevant fields and puts it into `js2-ti-tokens'."
(??
(if (js2-match-char ?.)
(throw 'return js2-OPTIONAL-CHAINING)
- (throw 'return js2-HOOK)))
+ (if (js2-match-char ??)
+ (throw 'return js2-NULLISH-COALESCING)
+ (throw 'return js2-HOOK))))
(?:
(if (js2-match-char ?:)
js2-COLONCOLON
- [elpa] externals/js2-mode 710e430 33/61: Migrate remaining files to lexical binding, (continued)
- [elpa] externals/js2-mode 710e430 33/61: Migrate remaining files to lexical binding, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 124d4a3 35/61: Prefix an unused argument with an underscore., Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode c00a562 37/61: Add browser symbols from the jslint setup, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode d397cab 39/61: Merge pull request #553 from phst/lexical, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode ae2d021 40/61: Merge pull request #554 from phst/unused-var, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 3afdc05 42/61: move HTML element constructors to specific section, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode df9d74e 46/61: Improve a comment, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode b4ede70 47/61: Fix &rest syntax in cl-destructuring-bind., Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode db17df4 53/61: Fix nullish coalescing in cond exprs and add test with ternary op, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode c665ebe 55/61: Move '??' back between '?:' and '||', Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 7f4ada4 49/61: start implementing NULLISH-COALESCING, likely incomplete,
Dmitry Gutov <=
- [elpa] externals/js2-mode ffb7099 58/61: Merge pull request #563 from KevinBoyette/update-readme, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 90e1434 48/61: Merge pull request #558 from phst/edebug, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode eb3be7e 54/61: Fix misplaced paren, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode c1763ab 52/61: add failing tests, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 0f627a4 57/61: Update README.md, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 6740d34 50/61: fix tokencount + structure, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode f956476 60/61: Release new version, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode f7816bd 59/61: Support logical assignment operators, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode 40aab27 56/61: Update NEWS, Dmitry Gutov, 2020/12/20
- [elpa] externals/js2-mode b21e117 36/61: Add WindowOrWorkerGlobalScope symbols to js2-browser-externs, Dmitry Gutov, 2020/12/20