You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by cd...@apache.org on 2016/04/11 16:00:05 UTC

[38/50] git commit: [flex-falcon] [refs/heads/feature/maven-migration] - MXMLWriter: fix for exception caused by change in JSWriter writeTo() signature

MXMLWriter: fix for exception caused by change in JSWriter writeTo() signature


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

Branch: refs/heads/feature/maven-migration
Commit: 5fc4bfc9ae313f15f5672e6990ef17e8d5deb127
Parents: bdc933e
Author: Josh Tynjala <jo...@apache.org>
Authored: Thu Apr 7 16:04:45 2016 -0700
Committer: Josh Tynjala <jo...@apache.org>
Committed: Thu Apr 7 16:04:45 2016 -0700

----------------------------------------------------------------------
 .../compiler/internal/codegen/js/JSWriter.java  |  3 +--
 .../internal/codegen/mxml/MXMLWriter.java       | 24 ++++++++++++--------
 2 files changed, 16 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/5fc4bfc9/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/JSWriter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/JSWriter.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/JSWriter.java
index 0e60a93..e984eda 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/JSWriter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/JSWriter.java
@@ -103,7 +103,6 @@ public class JSWriter implements IJSWriter
         if (sourceMapOut != null)
         {
             convertMappingSourcePathsToRelative(emitter, sourceMapOut);
-            
 
             File compilationUnitFile = new File(compilationUnit.getAbsoluteFilename());
             ISourceMapEmitter sourceMapEmitter = backend.createSourceMapEmitter(emitter);
@@ -123,7 +122,7 @@ public class JSWriter implements IJSWriter
         }
     }
     
-    private void convertMappingSourcePathsToRelative(IJSEmitter emitter, File relativeToFile)
+    protected void convertMappingSourcePathsToRelative(IJSEmitter emitter, File relativeToFile)
     {
         List<IJSEmitter.SourceMapMapping> mappings = emitter.getSourceMapMappings();
         for (IJSEmitter.SourceMapMapping mapping : mappings)

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/5fc4bfc9/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/MXMLWriter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/MXMLWriter.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/MXMLWriter.java
index 81ce78c..afb45fd 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/MXMLWriter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/MXMLWriter.java
@@ -19,12 +19,14 @@
 
 package org.apache.flex.compiler.internal.codegen.mxml;
 
+import java.io.File;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.util.List;
 
-import org.apache.flex.compiler.codegen.as.IASEmitter;
+import org.apache.flex.compiler.codegen.js.IJSEmitter;
 import org.apache.flex.compiler.codegen.mxml.IMXMLEmitter;
+import org.apache.flex.compiler.driver.js.IJSBackend;
 import org.apache.flex.compiler.internal.codegen.js.JSFilterWriter;
 import org.apache.flex.compiler.internal.codegen.js.JSSharedData;
 import org.apache.flex.compiler.internal.codegen.js.JSWriter;
@@ -49,18 +51,17 @@ public class MXMLWriter extends JSWriter
     }
 
     @Override
-    public void writeTo(OutputStream out)
+    public void writeTo(OutputStream out, File sourceMapOut)
     {
-        JSFilterWriter writer = (JSFilterWriter) JSSharedData.backend
-                .createWriterBuffer(project);
+        IJSBackend backend = (IJSBackend) JSSharedData.backend;
+        JSFilterWriter writer = (JSFilterWriter) backend.createWriterBuffer(project);
 
-        IASEmitter asEmitter = JSSharedData.backend.createEmitter(writer);
-        IASBlockWalker asBlockWalker = JSSharedData.backend.createWalker(
+        IJSEmitter asEmitter = (IJSEmitter) backend.createEmitter(writer);
+        IASBlockWalker asBlockWalker = backend.createWalker(
                 project, problems, asEmitter);
 
-        IMXMLEmitter mxmlEmitter = JSSharedData.backend
-                .createMXMLEmitter(writer);
-        IMXMLBlockWalker mxmlBlockWalker = JSSharedData.backend.createMXMLWalker(
+        IMXMLEmitter mxmlEmitter = backend.createMXMLEmitter(writer);
+        IMXMLBlockWalker mxmlBlockWalker = backend.createMXMLWalker(
                 project, problems, mxmlEmitter, asEmitter, asBlockWalker);
 
         mxmlBlockWalker.visitCompilationUnit(compilationUnit);
@@ -73,6 +74,11 @@ public class MXMLWriter extends JSWriter
         {
             e.printStackTrace();
         }
+
+        if (sourceMapOut != null)
+        {
+            throw new UnsupportedOperationException("Source maps not supported for MXML files");
+        }
     }
 
 }