IJSEmitter: no longer has pushSourceMapName() and popSourceMapName() because 
they were confusing Chrome and they don't appear to be necessary


Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/838a0fcd
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/838a0fcd
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/838a0fcd

Branch: refs/heads/develop
Commit: 838a0fcd6925c38ec5927ae0c385e9561da22cff
Parents: 626b617
Author: Josh Tynjala <joshtynj...@gmail.com>
Authored: Mon Oct 17 14:18:36 2016 -0700
Committer: Josh Tynjala <joshtynj...@gmail.com>
Committed: Mon Oct 17 14:18:36 2016 -0700

----------------------------------------------------------------------
 .../flex/compiler/codegen/js/IJSEmitter.java    |  3 --
 .../compiler/internal/codegen/js/JSEmitter.java | 49 +-------------------
 .../internal/codegen/js/jx/ClassEmitter.java    |  3 --
 .../internal/codegen/js/jx/MethodEmitter.java   |  2 -
 .../codegen/js/jx/PackageFooterEmitter.java     |  1 -
 .../codegen/js/jx/PackageHeaderEmitter.java     |  2 -
 6 files changed, 1 insertion(+), 59 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/838a0fcd/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/IJSEmitter.java
----------------------------------------------------------------------
diff --git 
a/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/IJSEmitter.java 
b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/IJSEmitter.java
index eb0d748..b686a3a 100644
--- 
a/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/IJSEmitter.java
+++ 
b/compiler-jx/src/main/java/org/apache/flex/compiler/codegen/js/IJSEmitter.java
@@ -66,9 +66,6 @@ public interface IJSEmitter extends IASEmitter
      * Commits a mapping to the source map.
      */
     void endMapping(ISourceLocation node);
-
-    void pushSourceMapName(ISourceLocation node);
-    void popSourceMapName();
     
     void emitSourceMapDirective(ITypeNode node);
     

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/838a0fcd/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSEmitter.java
----------------------------------------------------------------------
diff --git 
a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSEmitter.java
 
b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSEmitter.java
index 7824a87..94155df 100644
--- 
a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSEmitter.java
+++ 
b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSEmitter.java
@@ -132,8 +132,6 @@ public class JSEmitter extends ASEmitter implements 
IJSEmitter
     
     private SourceMapMapping lastMapping;
     
-    private Stack<String> nameStack = new Stack<String>();
-    
     private List<SourceMapMapping> sourceMapMappings;
     
     public List<SourceMapMapping> getSourceMapMappings()
@@ -382,45 +380,6 @@ public class JSEmitter extends ASEmitter implements 
IJSEmitter
         blockCloseEmitter.emit(node);
     }
 
-    public void pushSourceMapName(ISourceLocation node)
-    {
-        boolean isValidMappingScope = node instanceof ITypeNode
-                || node instanceof IPackageNode
-                || node instanceof IFunctionNode;
-        if(!isValidMappingScope)
-        {
-            throw new IllegalStateException("A source mapping scope must be a 
package, type, or function.");
-        }
-        
-        IDefinitionNode definitionNode = (IDefinitionNode) node;
-        String nodeName = definitionNode.getQualifiedName();
-        ITypeDefinition typeDef = 
EmitterUtils.getTypeDefinition(definitionNode);
-        if (typeDef != null)
-        {
-            boolean isConstructor = node instanceof IFunctionNode &&
-                    ((IFunctionNode) node).isConstructor();
-            boolean isStatic = definitionNode.hasModifier(ASModifier.STATIC);
-            if (isConstructor)
-            {
-                nodeName = typeDef.getQualifiedName() + ".constructor";
-            }
-            else if (isStatic)
-            {
-                nodeName = typeDef.getQualifiedName() + "." + nodeName;
-            }
-            else
-            {
-                nodeName = typeDef.getQualifiedName() + ".prototype." + 
nodeName;
-            }
-        }
-        nameStack.push(nodeName);
-    }
-    
-    public void popSourceMapName()
-    {
-        nameStack.pop();
-    }
-
     public void startMapping(ISourceLocation node)
     {
         startMapping(node, node.getLine(), node.getColumn());
@@ -454,15 +413,9 @@ public class JSEmitter extends ASEmitter implements 
IJSEmitter
                 }
             }
         }
-        
-        String nodeName = null;
-        if (nameStack.size() > 0)
-        {
-            nodeName = nameStack.lastElement();
-        }
+
         SourceMapMapping mapping = new SourceMapMapping();
         mapping.sourcePath = sourcePath;
-        mapping.name = nodeName;
         mapping.sourceStartPosition = new FilePosition(line, column);
         mapping.destStartPosition = new FilePosition(getCurrentLine(), 
getCurrentColumn());
         lastMapping = mapping;

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/838a0fcd/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ClassEmitter.java
----------------------------------------------------------------------
diff --git 
a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ClassEmitter.java
 
b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ClassEmitter.java
index d629b5d..5cb397c 100644
--- 
a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ClassEmitter.java
+++ 
b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/ClassEmitter.java
@@ -58,8 +58,6 @@ public class ClassEmitter extends JSSubEmitter implements
         // TODO (mschmalle) will remove this cast as more things get abstracted
         JSFlexJSEmitter fjs = (JSFlexJSEmitter) getEmitter();
         
-        getEmitter().pushSourceMapName(node);
-
         ASDocComment asDoc = (ASDocComment) node.getASDocComment();
         if (asDoc != null && MXMLJSC.keepASDoc)
             DocEmitterUtils.loadImportIgnores(fjs, asDoc.commentNoEnd());
@@ -204,7 +202,6 @@ public class ClassEmitter extends JSSubEmitter implements
         
         fjs.getPackageFooterEmitter().emitClassInfo(node);
 
-        getEmitter().popSourceMapName();
         getModel().popClass();
     }
     

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/838a0fcd/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/MethodEmitter.java
----------------------------------------------------------------------
diff --git 
a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/MethodEmitter.java
 
b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/MethodEmitter.java
index d26f9f5..85078fd 100644
--- 
a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/MethodEmitter.java
+++ 
b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/MethodEmitter.java
@@ -142,9 +142,7 @@ public class MethodEmitter extends JSSubEmitter implements
 
         if (!isConstructor || node.getScopedNode().getChildCount() > 0)
         {
-            getEmitter().pushSourceMapName(node);
             fjs.emitMethodScope(node.getScopedNode());
-            getEmitter().popSourceMapName();
         }
 
         if (isConstructor)

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/838a0fcd/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/PackageFooterEmitter.java
----------------------------------------------------------------------
diff --git 
a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/PackageFooterEmitter.java
 
b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/PackageFooterEmitter.java
index feaceb0..57393e9 100644
--- 
a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/PackageFooterEmitter.java
+++ 
b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/PackageFooterEmitter.java
@@ -59,7 +59,6 @@ public class PackageFooterEmitter extends JSSubEmitter 
implements
     @Override
     public void emit(IPackageDefinition definition)
     {
-        getEmitter().popSourceMapName();
         IASScope containedScope = definition.getContainedScope();
         ITypeDefinition type = EmitterUtils.findType(containedScope
                 .getAllLocalDefinitions());

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/838a0fcd/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/PackageHeaderEmitter.java
----------------------------------------------------------------------
diff --git 
a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/PackageHeaderEmitter.java
 
b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/PackageHeaderEmitter.java
index 56bfeb8..e71d497 100644
--- 
a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/PackageHeaderEmitter.java
+++ 
b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/PackageHeaderEmitter.java
@@ -142,8 +142,6 @@ public class PackageHeaderEmitter extends JSSubEmitter 
implements
         // TODO (mschmalle) will remove this cast as more things get abstracted
         JSFlexJSEmitter fjs = (JSFlexJSEmitter) getEmitter();
 
-        getEmitter().pushSourceMapName(definition.getNode());
-
         PackageScope containedScope = (PackageScope) definition
                 .getContainedScope();
 

Reply via email to