Quick commit to keep get everything in the repo before Mike goes wild Signed-off-by: Erik de Bruin <erik@ixsoftware.nl>
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSStatements.java b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSStatements.java index 3385b47..8327fcf 100644 --- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSStatements.java +++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSStatements.java
@@ -346,7 +346,7 @@ IIfNode node = (IIfNode) getNode( "if (numChildren == 0) { if (!typeDescription.@dynamic) { trace(\"warning: no describeType entry for '\" + childName + \"' on non-dynamic type '\" + typeDescription.@name + \"'\"); } }", IIfNode.class); asBlockWalker.visitIf(node); - assertOut("if (numChildren == 0) {\n if (!this.typeDescription['E4XOperator']) {\n org_apache_flex_utils_Language.trace(\"warning: no describeType entry for '\" + childName + \"' on non-dynamic type '\" + this.typeDescription['E4XOperator'] + \"'\");\n }\n}"); + assertOut("if (numChildren == 0) {\n if (!typeDescription['E4XOperator']) {\n org_apache_flex_utils_Language.trace(\"warning: no describeType entry for '\" + childName + \"' on non-dynamic type '\" + typeDescription['E4XOperator'] + \"'\");\n }\n}"); } @Test @@ -355,7 +355,7 @@ IIfNode node = (IIfNode) getNode( "if (options.includeReadOnly) { properties = classInfo..accessor.(@access != \"writeonly\") + classInfo..variable; }", IIfNode.class); asBlockWalker.visitIf(node); - assertOut("if (options.includeReadOnly) {\n properties = 'E4XFilter' + this.classInfo['E4XSelector'];\n}"); + assertOut("if (options.includeReadOnly) {\n properties = 'E4XFilter' + classInfo['E4XSelector'];\n}"); } @Test
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/TestBase.java b/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/TestBase.java index 2a2e90b..3b4f464 100644 --- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/TestBase.java +++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/test/TestBase.java
@@ -261,7 +261,7 @@ walker.visitCompilationUnit(cu); - //System.out.println(writer.toString()); + System.out.println(writer.toString()); BufferedOutputStream out = new BufferedOutputStream( new FileOutputStream(outputClassFile));
diff --git a/compiler.jx.tests/test-files/vf2js/projects/simpleMXML/src/SimpleMXML_Project_result.js b/compiler.jx.tests/test-files/vf2js/projects/simpleMXML/src/SimpleMXML_Project_result.js index e34f12d..d493d28 100644 --- a/compiler.jx.tests/test-files/vf2js/projects/simpleMXML/src/SimpleMXML_Project_result.js +++ b/compiler.jx.tests/test-files/vf2js/projects/simpleMXML/src/SimpleMXML_Project_result.js
@@ -23,7 +23,7 @@ goog.require('spark.components.Application'); goog.require('example.Component'); -goog.require('org_apache_flex_utils_Language'); +goog.require('org.apache.flex.utils.Language');
diff --git a/compiler.jx.tests/test-files/vf2js/projects/super/Base.as b/compiler.jx.tests/test-files/vf2js/projects/super/Base.as index ee69d65..7c2330c 100644 --- a/compiler.jx.tests/test-files/vf2js/projects/super/Base.as +++ b/compiler.jx.tests/test-files/vf2js/projects/super/Base.as
@@ -52,6 +52,8 @@ public function getNumber():void { alert(super.doStuff()); + + alert(Math.max(0, super.x - 1)); var x:Number = super.x; }
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/vf2js/JSVF2JSEmitter.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/vf2js/JSVF2JSEmitter.java index b11193b..68d0cb6 100644 --- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/vf2js/JSVF2JSEmitter.java +++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/vf2js/JSVF2JSEmitter.java
@@ -990,7 +990,10 @@ if (pfnode == null) return false; - return pfnode.getName().equals(node.getName()); + String parentName = pfnode.getName(); + String currentName = node.getName(); + + return parentName.equals(currentName); } //-------------------------------------------------------------------------- @@ -1359,8 +1362,6 @@ { // ToDo (erikdebruin): properly handle E4X - write(ASEmitterTokens.THIS); - write(ASEmitterTokens.MEMBER_ACCESS); getWalker().walk(node.getLeftOperandNode()); write(ASEmitterTokens.SQUARE_OPEN); write(ASEmitterTokens.SINGLE_QUOTE); @@ -1373,8 +1374,6 @@ { // ToDo (erikdebruin): properly handle E4X - write(ASEmitterTokens.THIS); - write(ASEmitterTokens.MEMBER_ACCESS); getWalker().walk(node.getLeftOperandNode()); write(ASEmitterTokens.SQUARE_OPEN); write(ASEmitterTokens.SINGLE_QUOTE);