[Top][All Lists]

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

[elpa] master 68b4abd 02/45: Add ES6 class externs

From: Dmitry Gutov
Subject: [elpa] master 68b4abd 02/45: Add ES6 class externs
Date: Mon, 02 Feb 2015 03:18:32 +0000

branch: master
commit 68b4abd7c4eb823301d53a8684e26ef40d02b35c
Author: Stephen Hicks <address@hidden>
Commit: Stephen Hicks <address@hidden>

    Add ES6 class externs
    These are delineated in ยง18.3 of the draft spec, Constructor Properties of 
the Global Object: 
 js2-mode.el |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/js2-mode.el b/js2-mode.el
index db625ca..15e132a 100644
--- a/js2-mode.el
+++ b/js2-mode.el
@@ -203,6 +203,12 @@ Set `js2-include-node-externs' to t to include them.")
 in node.js >= 0.6. If `js2-include-node-externs' or 
 are enabled, these will also be included.")
+(defvar js2-harmony-externs
+  (mapcar 'symbol-name
+          '(Map Promise Proxy Reflect Set Symbol WeakMap WeakSet))
+  "ES6 externs.  If `js2-include-browser-externs' is enabled and
+`js2-language-version' is sufficiently high, these will be included.")
 ;;; Variables
 (defun js2-mark-safe-local (name pred)
@@ -6608,6 +6614,8 @@ it is considered declared."
   (setq js2-default-externs
         (append js2-ecma-262-externs
                 (if js2-include-browser-externs js2-browser-externs)
+                (if (and js2-include-browser-externs
+                         (>= js2-language-version 200)) js2-harmony-externs)
                 (if js2-include-rhino-externs js2-rhino-externs)
                 (if js2-include-node-externs js2-node-externs)
                 (if (or js2-include-browser-externs js2-include-node-externs)

reply via email to

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