From 54d0aa0930cff1fc6d7d764a9da532b92bc69a92 Mon Sep 17 00:00:00 2001 From: tdurieux Date: Tue, 7 Mar 2017 13:24:07 +0100 Subject: [PATCH] fixed files form Closure #89 --- .../89/com/google/javascript/jscomp/CollapseProperties.java | 3 +++ .../89/com/google/javascript/jscomp/GlobalNamespace.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/projects/Closure/89/com/google/javascript/jscomp/CollapseProperties.java b/projects/Closure/89/com/google/javascript/jscomp/CollapseProperties.java index 16d533d..ddccf0d 100644 --- a/projects/Closure/89/com/google/javascript/jscomp/CollapseProperties.java +++ b/projects/Closure/89/com/google/javascript/jscomp/CollapseProperties.java @@ -481,6 +481,9 @@ private void updateSimpleDeclaration(String alias, Name refName, Ref ref) { Node greatGramps = gramps.getParent(); Node greatGreatGramps = greatGramps.getParent(); + if (rvalue != null && rvalue.getType() == Token.FUNCTION) { + checkForHosedThisReferences(rvalue, refName.docInfo, refName); + } // Create the new alias node. Node nameNode = NodeUtil.newName( diff --git a/projects/Closure/89/com/google/javascript/jscomp/GlobalNamespace.java b/projects/Closure/89/com/google/javascript/jscomp/GlobalNamespace.java index 311e343..8268339 100644 --- a/projects/Closure/89/com/google/javascript/jscomp/GlobalNamespace.java +++ b/projects/Closure/89/com/google/javascript/jscomp/GlobalNamespace.java @@ -917,7 +917,7 @@ boolean canCollapseUnannotatedChildNames() { } // If this is aliased, then its properties can't be collapsed either. - if (type != Type.FUNCTION && aliasingGets > 0) { + if (aliasingGets > 0) { return false; }