summaryrefslogtreecommitdiffstats
path: root/js/src/frontend/FoldConstants.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-08-18 16:25:15 +0200
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-08-18 16:26:16 +0200
commit202296d02aa99afa90581333ab059c050b9c3ade (patch)
tree6ed8a1289bed1bb06d2703ea77cba5fccd3bdffa /js/src/frontend/FoldConstants.cpp
parent1530f48c27fb13d7cbd2708c9f0fcf2dabc6ed6a (diff)
parentab6242a93b849b0a3c7525b16bc01dd3172fc167 (diff)
downloadUXP-202296d02aa99afa90581333ab059c050b9c3ade.tar
UXP-202296d02aa99afa90581333ab059c050b9c3ade.tar.gz
UXP-202296d02aa99afa90581333ab059c050b9c3ade.tar.lz
UXP-202296d02aa99afa90581333ab059c050b9c3ade.tar.xz
UXP-202296d02aa99afa90581333ab059c050b9c3ade.zip
Pull Basilisk-release forward.
Diffstat (limited to 'js/src/frontend/FoldConstants.cpp')
-rw-r--r--js/src/frontend/FoldConstants.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/js/src/frontend/FoldConstants.cpp b/js/src/frontend/FoldConstants.cpp
index 6f62ffac6..689fa02b4 100644
--- a/js/src/frontend/FoldConstants.cpp
+++ b/js/src/frontend/FoldConstants.cpp
@@ -378,6 +378,7 @@ ContainsHoistedDeclaration(ExclusiveContext* cx, ParseNode* node, bool* result)
case PNK_TRUE:
case PNK_FALSE:
case PNK_NULL:
+ case PNK_RAW_UNDEFINED:
case PNK_THIS:
case PNK_ELISION:
case PNK_NUMBER:
@@ -468,6 +469,7 @@ IsEffectless(ParseNode* node)
node->isKind(PNK_TEMPLATE_STRING) ||
node->isKind(PNK_NUMBER) ||
node->isKind(PNK_NULL) ||
+ node->isKind(PNK_RAW_UNDEFINED) ||
node->isKind(PNK_FUNCTION) ||
node->isKind(PNK_GENEXP);
}
@@ -492,6 +494,7 @@ Boolish(ParseNode* pn)
case PNK_FALSE:
case PNK_NULL:
+ case PNK_RAW_UNDEFINED:
return Falsy;
case PNK_VOID: {
@@ -1342,15 +1345,8 @@ FoldElement(ExclusiveContext* cx, ParseNode** nodePtr, Parser<FullParseHandler>&
if (!name)
return true;
- // Also don't optimize if the name doesn't map directly to its id for TI's
- // purposes.
- if (NameToId(name) != IdToTypeId(NameToId(name)))
- return true;
-
// Optimization 3: We have expr["foo"] where foo is not an index. Convert
// to a property access (like expr.foo) that optimizes better downstream.
- // Don't bother with this for names that TI considers to be indexes, to
- // simplify downstream analysis.
ParseNode* dottedAccess = parser.handler.newPropertyAccess(expr, name, node->pn_pos.end);
if (!dottedAccess)
return false;
@@ -1643,6 +1639,7 @@ Fold(ExclusiveContext* cx, ParseNode** pnp, Parser<FullParseHandler>& parser, bo
case PNK_TRUE:
case PNK_FALSE:
case PNK_NULL:
+ case PNK_RAW_UNDEFINED:
case PNK_ELISION:
case PNK_NUMBER:
case PNK_DEBUGGER: