Bug 1497784 - Drop support for lexical declaration in BinAST for now. r=Yoric
☠☠ backed out by 6e4537056d53 ☠ ☠
authorTooru Fujisawa <arai_a@mac.com>
Tue, 30 Oct 2018 09:49:41 +0900
changeset 499871 916db80793cbefc667b019edefeb83559c535b50
parent 499870 f2a70b31cc32e0e5b3fb358105ad660b4b9f42e6
child 499872 e37bf786b5fcbf048cefbea44a85783a68ce4339
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersYoric
bugs1497784
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1497784 - Drop support for lexical declaration in BinAST for now. r=Yoric
js/src/frontend/BinSource-auto.cpp
js/src/frontend/BinSource.yaml
js/src/jsapi-tests/binast/parser/multipart/unit/let_in_fun.binjs
js/src/jsapi-tests/binast/parser/multipart/unit/let_in_fun.js
--- a/js/src/frontend/BinSource-auto.cpp
+++ b/js/src/frontend/BinSource-auto.cpp
@@ -3626,20 +3626,26 @@ BinASTParser<Tok>::parseInterfaceForInOf
 
     BINJS_MOZ_TRY_DECL(kind_, parseVariableDeclarationKind());
 
     BINJS_MOZ_TRY_DECL(binding, parseBinding());
 
     // Restored by `kindGuard`.
     variableDeclarationKind_ = kind_;
     MOZ_TRY(checkBinding(binding->template as<NameNode>().atom()->asPropertyName()));
-    auto pnk =
-        kind_ == VariableDeclarationKind::Let
-            ? ParseNodeKind::Let
-            : ParseNodeKind::Var;
+    ParseNodeKind pnk;
+    switch (kind_) {
+      case VariableDeclarationKind::Var:
+        pnk = ParseNodeKind::Var;
+        break;
+      case VariableDeclarationKind::Let:
+        return raiseError("Let is not supported in this preview release");
+      case VariableDeclarationKind::Const:
+        return raiseError("Const is not supported in this preview release");
+    }
     BINJS_TRY_DECL(result, factory_.newDeclarationList(pnk, tokenizer_->pos(start)));
     factory_.addList(result, binding);
     return result;
 }
 
 template<typename Tok> JS::Result<ParseNode*>
 BinASTParser<Tok>::parseInterfaceForInStatement(const size_t start, const BinKind kind, const BinFields& fields)
 {
@@ -5002,21 +5008,19 @@ BinASTParser<Tok>::parseInterfaceVariabl
     }
 
     ParseNodeKind pnk;
     switch (kind_) {
       case VariableDeclarationKind::Var:
         pnk = ParseNodeKind::Var;
         break;
       case VariableDeclarationKind::Let:
-        pnk = ParseNodeKind::Let;
-        break;
+        return raiseError("Let is not supported in this preview release");
       case VariableDeclarationKind::Const:
-        pnk = ParseNodeKind::Const;
-        break;
+        return raiseError("Const is not supported in this preview release");
     }
     declarators->setKind(pnk);
     auto result = declarators;
     return result;
 }
 
 
 /*
--- a/js/src/frontend/BinSource.yaml
+++ b/js/src/frontend/BinSource.yaml
@@ -839,20 +839,26 @@ ExpressionStatement:
 
 ForInOfBinding:
     init:
         AutoVariableDeclarationKind kindGuard(this);
     build: |
         // Restored by `kindGuard`.
         variableDeclarationKind_ = kind_;
         MOZ_TRY(checkBinding(binding->template as<NameNode>().atom()->asPropertyName()));
-        auto pnk =
-            kind_ == VariableDeclarationKind::Let
-                ? ParseNodeKind::Let
-                : ParseNodeKind::Var;
+        ParseNodeKind pnk;
+        switch (kind_) {
+          case VariableDeclarationKind::Var:
+            pnk = ParseNodeKind::Var;
+            break;
+          case VariableDeclarationKind::Let:
+            return raiseError("Let is not supported in this preview release");
+          case VariableDeclarationKind::Const:
+            return raiseError("Const is not supported in this preview release");
+        }
         BINJS_TRY_DECL(result, factory_.newDeclarationList(pnk, tokenizer_->pos(start)));
         factory_.addList(result, binding);
 
 
 
 ForInStatement:
     init: |
         ParseContext::Statement stmt(parseContext_, StatementKind::ForInLoop);
@@ -1328,21 +1334,19 @@ VariableDeclaration:
         }
 
         ParseNodeKind pnk;
         switch (kind_) {
           case VariableDeclarationKind::Var:
             pnk = ParseNodeKind::Var;
             break;
           case VariableDeclarationKind::Let:
-            pnk = ParseNodeKind::Let;
-            break;
+            return raiseError("Let is not supported in this preview release");
           case VariableDeclarationKind::Const:
-            pnk = ParseNodeKind::Const;
-            break;
+            return raiseError("Const is not supported in this preview release");
         }
         declarators->setKind(pnk);
         auto result = declarators;
 
 VariableDeclarator:
     build: |
         ParseNode* result;
         if (binding->isKind(ParseNodeKind::Name)) {
deleted file mode 100644
index 5b6d505c434d6a64ca5239ca0ce4bdd67085bbb7..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/js/src/jsapi-tests/binast/parser/multipart/unit/let_in_fun.js
+++ /dev/null
@@ -1,3 +0,0 @@
-function test() {
-    let limit = 1;
-}