Bug 1622281 - Part 2: Replace a lookupDeclaredNameForAdd with plain lookupDeclaredName. r=mgaudet
authorAndré Bargull <andre.bargull@gmail.com>
Fri, 13 Mar 2020 16:43:06 +0000
changeset 518656 0e31c93e485920f17378b57c79a51cdd85e59048
parent 518655 dca8f30792c8dfd51296678404449fc9f343097c
child 518657 e22a21645cbf9e3937521261e495af747583f2e4
push id37213
push usershindli@mozilla.com
push dateFri, 13 Mar 2020 21:46:16 +0000
treeherdermozilla-central@8ef0a54d7715 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmgaudet
bugs1622281
milestone76.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 1622281 - Part 2: Replace a lookupDeclaredNameForAdd with plain lookupDeclaredName. r=mgaudet Depends on D66774 Differential Revision: https://phabricator.services.mozilla.com/D66775
js/src/frontend/ParseContext.cpp
--- a/js/src/frontend/ParseContext.cpp
+++ b/js/src/frontend/ParseContext.cpp
@@ -314,17 +314,17 @@ bool ParseContext::annexBAppliesToLexica
   if (!redeclaredKind && isFunctionBox()) {
     Scope& funScope = functionScope();
     if (&funScope != &varScope()) {
       // Annex B.3.3.1 disallows redeclaring parameter names. In the
       // presence of parameter expressions, parameter names are on the
       // function scope, which encloses the var scope. This means the
       // isVarRedeclaredInInnermostScope call above would not catch this
       // case, so test it manually.
-      if (AddDeclaredNamePtr p = funScope.lookupDeclaredNameForAdd(name)) {
+      if (DeclaredNamePtr p = funScope.lookupDeclaredName(name)) {
         DeclarationKind declaredKind = p->value()->kind();
         if (DeclarationKindIsParameter(declaredKind)) {
           redeclaredKind = Some(declaredKind);
         } else {
           MOZ_ASSERT(FunctionScope::isSpecialName(sc()->cx_, name));
         }
       }
     }