flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erikdebr...@apache.org
Subject [3/5] git commit: [flex-falcon] [refs/heads/develop] - Trying again: added JSDoc file annotation with @suppress to make the remaining GCC type warnings go away. There are small inconsistencies between the AS and goog JS type (e.g. in goog, 'string' is no
Date Sat, 16 Nov 2013 15:20:21 GMT
Trying again: added JSDoc file annotation with @suppress to make the remaining GCC type warnings
go away. There are small inconsistencies between the AS and goog JS type (e.g. in goog, 'string'
is not an Object), that we cannot compensate for. Since the AS compiler takes care of the
type checking on the AS code, IMHO we need not worry that we cover up any runtime errors with
this @suppress.

Signed-off-by: Erik de Bruin <erik@ixsoftware.nl>


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

Branch: refs/heads/develop
Commit: d5a8c50c5d480f1c7a7a36d54ff59ec91cc80621
Parents: 774b889
Author: Erik de Bruin <erik@ixsoftware.nl>
Authored: Sat Nov 16 15:50:23 2013 +0100
Committer: Erik de Bruin <erik@ixsoftware.nl>
Committed: Sat Nov 16 15:50:23 2013 +0100

----------------------------------------------------------------------
 .../codegen/js/flexjs/JSFlexJSEmitter.java      | 28 ++++++++++++++++++++
 .../codegen/mxml/flexjs/MXMLFlexJSEmitter.java  |  9 +++++++
 2 files changed, 37 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/d5a8c50c/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java
index b300c31..6802ba5 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java
@@ -1109,6 +1109,34 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
     }
 
     @Override
+    public void emitPackageHeader(IPackageDefinition definition)
+    {
+        IASScope containedScope = definition.getContainedScope();
+        ITypeDefinition type = findType(containedScope.getAllLocalDefinitions());
+        if (type == null)
+            return;
+
+        writeNewline("/**");
+        writeNewline(" * " + type.getQualifiedName());
+        writeNewline(" *");
+        writeNewline(" * @fileoverview");
+        writeNewline(" *");
+        writeNewline(" * @suppress {checkTypes}");
+        writeNewline(" */");
+        writeNewline();
+        
+        /* goog.provide('x');\n\n */
+        write(JSGoogEmitterTokens.GOOG_PROVIDE);
+        write(ASEmitterTokens.PAREN_OPEN);
+        write(ASEmitterTokens.SINGLE_QUOTE);
+        write(type.getQualifiedName());
+        write(ASEmitterTokens.SINGLE_QUOTE);
+        write(ASEmitterTokens.PAREN_CLOSE);
+        writeNewline(ASEmitterTokens.SEMICOLON);
+        writeNewline();
+    }
+
+    @Override
     public void emitPackageHeaderContents(IPackageDefinition definition)
     {
         PackageScope containedScope = (PackageScope) definition

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/d5a8c50c/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitter.java
b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitter.java
index 68bad5e..f722223 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitter.java
@@ -1380,6 +1380,15 @@ public class MXMLFlexJSEmitter extends MXMLEmitter implements
         String cname = node.getFileNode().getName();
         String bcname = node.getBaseClassName();
 
+        writeNewline("/**");
+        writeNewline(" * " + cname);
+        writeNewline(" *");
+        writeNewline(" * @fileoverview");
+        writeNewline(" *");
+        writeNewline(" * @suppress {checkTypes}");
+        writeNewline(" */");
+        writeNewline();
+        
         emitHeaderLine(cname, true); // provide
         writeNewline();
         emitHeaderLine(bcname);


Mime
View raw message