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/11/04 09:31:54 UTC
[4/5] git commit: [flex-falcon]
[refs/heads/feature-autobuild/closure-classpath-sources] - switch from
goog.base (actually ClassName.base) to ClassName.superClass_.property.apply
because base() doesn't seem to handle super calls to methods other than wit
switch from goog.base (actually ClassName.base) to ClassName.superClass_.property.apply because base() doesn't seem to handle super calls to methods other than with the same method name that was called
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/2c8becbc
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/2c8becbc
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/2c8becbc
Branch: refs/heads/feature-autobuild/closure-classpath-sources
Commit: 2c8becbcb22052105d8a614196f1d36db6b909ec
Parents: f83b5b5
Author: Alex Harui <ah...@apache.org>
Authored: Thu Nov 3 14:48:35 2016 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Thu Nov 3 14:48:35 2016 -0700
----------------------------------------------------------------------
.../internal/codegen/js/JSEmitterTokens.java | 1 +
.../codegen/js/jx/BinaryOperatorEmitter.java | 28 +++++----
.../codegen/js/jx/MemberAccessEmitter.java | 13 ++--
.../codegen/js/jx/SuperCallEmitter.java | 64 +++++++++++++++-----
.../js/flexjs/TestFlexJSAccessorMembers.java | 8 +--
.../codegen/js/flexjs/TestFlexJSClass.java | 6 +-
.../js/flexjs/TestFlexJSExpressions.java | 6 +-
.../mxml/flexjs/TestFlexJSMXMLScript.java | 2 +-
.../flexjs/projects/super/Base_result.js | 6 +-
9 files changed, 86 insertions(+), 48 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/2c8becbc/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSEmitterTokens.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSEmitterTokens.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSEmitterTokens.java
index 82935af..be2aafc 100644
--- a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSEmitterTokens.java
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/JSEmitterTokens.java
@@ -23,6 +23,7 @@ import org.apache.flex.compiler.codegen.IEmitterTokens;
public enum JSEmitterTokens implements IEmitterTokens
{
ARGUMENTS("arguments"),
+ APPLY("apply"),
CALL("call"),
CONFIGURABLE("configurable"),
CONSTRUCTOR("constructor"),
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/2c8becbc/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/BinaryOperatorEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/BinaryOperatorEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/BinaryOperatorEmitter.java
index 0e237d2..98ada1a 100644
--- a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/BinaryOperatorEmitter.java
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/BinaryOperatorEmitter.java
@@ -26,6 +26,7 @@ import org.apache.flex.compiler.definitions.IDefinition;
import org.apache.flex.compiler.definitions.metadata.IMetaTag;
import org.apache.flex.compiler.definitions.metadata.IMetaTagAttribute;
import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSEmitterTokens;
import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSDocEmitter;
import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitter;
@@ -121,34 +122,35 @@ public class BinaryOperatorEmitter extends JSSubEmitter implements
getModel().getCurrentClass().getQualifiedName()));
write(ASEmitterTokens.MEMBER_ACCESS);
- write(JSGoogEmitterTokens.GOOG_BASE);
- write(ASEmitterTokens.PAREN_OPEN);
- write(ASEmitterTokens.THIS);
- writeToken(ASEmitterTokens.COMMA);
- write(ASEmitterTokens.SINGLE_QUOTE);
+ write(JSGoogEmitterTokens.SUPERCLASS);
+ write(ASEmitterTokens.MEMBER_ACCESS);
write(JSFlexJSEmitterTokens.SETTER_PREFIX);
write(rnodeDef.getBaseName());
- write(ASEmitterTokens.SINGLE_QUOTE);
+ write(ASEmitterTokens.MEMBER_ACCESS);
+ write(JSEmitterTokens.APPLY);
+ write(ASEmitterTokens.PAREN_OPEN);
+ write(ASEmitterTokens.THIS);
writeToken(ASEmitterTokens.COMMA);
-
+ writeToken(ASEmitterTokens.SQUARE_OPEN);
if (op.length() > 1) // += and things like that
{
write(getEmitter().formatQualifiedName(
cnode.getQualifiedName()));
write(ASEmitterTokens.MEMBER_ACCESS);
- write(JSGoogEmitterTokens.GOOG_BASE);
+ write(JSGoogEmitterTokens.SUPERCLASS);
+ write(ASEmitterTokens.MEMBER_ACCESS);
+ write(JSFlexJSEmitterTokens.GETTER_PREFIX);
+ write(rnodeDef.getBaseName());
+ write(ASEmitterTokens.MEMBER_ACCESS);
+ write(JSEmitterTokens.APPLY);
write(ASEmitterTokens.PAREN_OPEN);
write(ASEmitterTokens.THIS);
- writeToken(ASEmitterTokens.COMMA);
- write(ASEmitterTokens.SINGLE_QUOTE);
- write(JSFlexJSEmitterTokens.SETTER_PREFIX);
- write(rnodeDef.getBaseName());
- write(ASEmitterTokens.SINGLE_QUOTE);
write(ASEmitterTokens.PAREN_CLOSE);
write(op.substring(0, 1));
}
getWalker().walk(node.getRightOperandNode());
+ writeToken(ASEmitterTokens.SQUARE_CLOSE);
write(ASEmitterTokens.PAREN_CLOSE);
return;
}
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/2c8becbc/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/MemberAccessEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/MemberAccessEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/MemberAccessEmitter.java
index a54dfac..105dec9 100644
--- a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/MemberAccessEmitter.java
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/MemberAccessEmitter.java
@@ -24,6 +24,7 @@ import org.apache.flex.compiler.codegen.js.IJSEmitter;
import org.apache.flex.compiler.constants.IASLanguageConstants;
import org.apache.flex.compiler.definitions.IDefinition;
import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSEmitterTokens;
import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitter;
import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitterTokens;
@@ -290,17 +291,17 @@ public class MemberAccessEmitter extends JSSubEmitter implements
write(getEmitter().formatQualifiedName(
getEmitter().getModel().getCurrentClass().getQualifiedName()));
write(ASEmitterTokens.MEMBER_ACCESS);
- write(JSGoogEmitterTokens.GOOG_BASE);
- write(ASEmitterTokens.PAREN_OPEN);
- write(ASEmitterTokens.THIS);
- writeToken(ASEmitterTokens.COMMA);
- write(ASEmitterTokens.SINGLE_QUOTE);
+ write(JSGoogEmitterTokens.SUPERCLASS);
+ write(ASEmitterTokens.MEMBER_ACCESS);
write(JSFlexJSEmitterTokens.GETTER_PREFIX);
if (rightDef != null)
write(rightDef.getBaseName());
else
write(((GetterNode) rightNode).getName());
- write(ASEmitterTokens.SINGLE_QUOTE);
+ write(ASEmitterTokens.MEMBER_ACCESS);
+ write(JSEmitterTokens.APPLY);
+ write(ASEmitterTokens.PAREN_OPEN);
+ write(ASEmitterTokens.THIS);
write(ASEmitterTokens.PAREN_CLOSE);
return false;
}
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/2c8becbc/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/SuperCallEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/SuperCallEmitter.java b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/SuperCallEmitter.java
index 12dc411..657bf72 100644
--- a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/SuperCallEmitter.java
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/jx/SuperCallEmitter.java
@@ -26,6 +26,7 @@ import org.apache.flex.compiler.definitions.IClassDefinition;
import org.apache.flex.compiler.definitions.IDefinition;
import org.apache.flex.compiler.definitions.INamespaceDefinition;
import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
+import org.apache.flex.compiler.internal.codegen.js.JSEmitterTokens;
import org.apache.flex.compiler.internal.codegen.js.JSSessionModel;
import org.apache.flex.compiler.internal.codegen.js.JSSubEmitter;
import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitter;
@@ -89,17 +90,17 @@ public class SuperCallEmitter extends JSSubEmitter
write(getEmitter().formatQualifiedName(
cnode.getQualifiedName()));
write(ASEmitterTokens.MEMBER_ACCESS);
- write(JSGoogEmitterTokens.GOOG_BASE);
- write(ASEmitterTokens.PAREN_OPEN);
- write(ASEmitterTokens.THIS);
- writeToken(ASEmitterTokens.COMMA);
- write(ASEmitterTokens.SINGLE_QUOTE);
+ write(JSGoogEmitterTokens.SUPERCLASS);
+ write(ASEmitterTokens.MEMBER_ACCESS);
if (fnode.getNodeID() == ASTNodeID.GetterID)
write(JSFlexJSEmitterTokens.GETTER_PREFIX);
else
write(JSFlexJSEmitterTokens.SETTER_PREFIX);
write(fnode.getName());
- write(ASEmitterTokens.SINGLE_QUOTE);
+ write(ASEmitterTokens.MEMBER_ACCESS);
+ write(JSEmitterTokens.APPLY);
+ write(ASEmitterTokens.PAREN_OPEN);
+ write(ASEmitterTokens.THIS);
IASNode[] anodes = null;
boolean writeArguments = false;
@@ -126,18 +127,23 @@ public class SuperCallEmitter extends JSSubEmitter
if (pnode.getNodeID() == ASTNodeID.SetterID)
{
writeToken(ASEmitterTokens.COMMA);
+ writeToken(ASEmitterTokens.SQUARE_OPEN);
getWalker().walk(bnode.getRightOperandNode());
+ writeToken(ASEmitterTokens.SQUARE_CLOSE);
}
}
if (writeArguments)
{
+ // I think len has to be 0 or 1
int len = anodes.length;
for (int i = 0; i < len; i++)
{
writeToken(ASEmitterTokens.COMMA);
+ writeToken(ASEmitterTokens.SQUARE_OPEN);
getWalker().walk(anodes[i]);
+ writeToken(ASEmitterTokens.SQUARE_CLOSE);
}
}
@@ -185,23 +191,25 @@ public class SuperCallEmitter extends JSSubEmitter
}
else
write(fjs.formatQualifiedName(cnode.getQualifiedName()));
- write(ASEmitterTokens.MEMBER_ACCESS);
- write(JSGoogEmitterTokens.GOOG_BASE);
- write(ASEmitterTokens.PAREN_OPEN);
- write(ASEmitterTokens.THIS);
-
if (fnode.isConstructor())
{
+ write(ASEmitterTokens.MEMBER_ACCESS);
+ write(JSGoogEmitterTokens.GOOG_BASE);
+ write(ASEmitterTokens.PAREN_OPEN);
+ write(ASEmitterTokens.THIS);
+
writeToken(ASEmitterTokens.COMMA);
write(ASEmitterTokens.SINGLE_QUOTE);
write(JSGoogEmitterTokens.GOOG_CONSTRUCTOR);
write(ASEmitterTokens.SINGLE_QUOTE);
}
+ boolean usingApply = false;
+ boolean isCustomNamespace = false;
if (fnode != null && !fnode.isConstructor())
{
- writeToken(ASEmitterTokens.COMMA);
- write(ASEmitterTokens.SINGLE_QUOTE);
+ write(ASEmitterTokens.MEMBER_ACCESS);
+ write(JSGoogEmitterTokens.SUPERCLASS);
IExpressionNode namenode = fcnode.getNameNode();
IDefinition def = namenode.resolve(getWalker().getProject());
String superName = fnode.getName();
@@ -220,9 +228,26 @@ public class SuperCallEmitter extends JSSubEmitter
fjs.formatQualifiedName(nsDef.getQualifiedName()); // register with used names
String s = nsDef.getURI();
superName = s + "::" + superName;
+ isCustomNamespace = true;
+ }
+ if (isCustomNamespace)
+ {
+ write(ASEmitterTokens.SQUARE_OPEN);
+ write(ASEmitterTokens.SINGLE_QUOTE);
}
+ else
+ write(ASEmitterTokens.MEMBER_ACCESS);
write(superName);
- write(ASEmitterTokens.SINGLE_QUOTE);
+ if (isCustomNamespace)
+ {
+ write(ASEmitterTokens.SINGLE_QUOTE);
+ write(ASEmitterTokens.SQUARE_CLOSE);
+ }
+ write(ASEmitterTokens.MEMBER_ACCESS);
+ write(JSEmitterTokens.APPLY);
+ write(ASEmitterTokens.PAREN_OPEN);
+ write(ASEmitterTokens.THIS);
+ usingApply = true;
}
IASNode[] anodes = null;
@@ -249,13 +274,22 @@ public class SuperCallEmitter extends JSSubEmitter
if (writeArguments)
{
+ if (usingApply)
+ {
+ writeToken(ASEmitterTokens.COMMA);
+ writeToken(ASEmitterTokens.SQUARE_OPEN);
+ }
+
int len = anodes.length;
for (int i = 0; i < len; i++)
{
- writeToken(ASEmitterTokens.COMMA);
+ if (!usingApply || i > 0)
+ writeToken(ASEmitterTokens.COMMA);
getWalker().walk(anodes[i]);
}
+ if (usingApply)
+ writeToken(ASEmitterTokens.SQUARE_CLOSE);
}
write(ASEmitterTokens.PAREN_CLOSE);
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/2c8becbc/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSAccessorMembers.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSAccessorMembers.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSAccessorMembers.java
index e7ad931..cfc0578 100644
--- a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSAccessorMembers.java
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSAccessorMembers.java
@@ -74,7 +74,7 @@ public class TestFlexJSAccessorMembers extends TestGoogAccessorMembers
IClassNode.class, WRAP_LEVEL_PACKAGE);
asBlockWalker.visitClass(node);
assertOut("/**\n * @constructor\n * @extends {A}\n */\nB = function() {\n B.base(this, 'constructor');\n};\ngoog.inherits(B, A);\n\n\n" +
- "B.prototype.get__foo = function() {\n return B.base(this, 'get__foo');\n};\n\n\n" +
+ "B.prototype.get__foo = function() {\n return B.superClass_.get__foo.apply(this);\n};\n\n\n" +
"Object.defineProperties(B.prototype, /** @lends {B.prototype} */ {\n/** @export */\nfoo: {\nget: B.prototype.get__foo}}\n);");
}
@@ -85,7 +85,7 @@ public class TestFlexJSAccessorMembers extends TestGoogAccessorMembers
IClassNode.class, WRAP_LEVEL_PACKAGE);
asBlockWalker.visitClass(node);
assertOut("/**\n * @constructor\n * @extends {A}\n */\nB = function() {\n B.base(this, 'constructor');\n};\ngoog.inherits(B, A);\n\n\n" +
- "B.prototype.get__foo = function() {\n return B.base(this, 'get__foo');\n};\n\n\n" +
+ "B.prototype.get__foo = function() {\n return B.superClass_.get__foo.apply(this);\n};\n\n\n" +
"Object.defineProperties(B.prototype, /** @lends {B.prototype} */ {\n/** @export */\nfoo: {\nget: B.prototype.get__foo,\nset: A.prototype.set__foo}}\n);");
}
@@ -145,7 +145,7 @@ public class TestFlexJSAccessorMembers extends TestGoogAccessorMembers
IClassNode.class, WRAP_LEVEL_PACKAGE);
asBlockWalker.visitClass(node);
assertOut("/**\n * @constructor\n * @extends {A}\n */\nB = function() {\n B.base(this, 'constructor');\n};\ngoog.inherits(B, A);\n\n\n" +
- "B.prototype.set__foo = function(value) {\n B.base(this, 'set__foo', value);\n};\n\n\n" +
+ "B.prototype.set__foo = function(value) {\n B.superClass_.set__foo.apply(this, [ value] );\n};\n\n\n" +
"Object.defineProperties(B.prototype, /** @lends {B.prototype} */ {\n/** @export */\nfoo: {\nset: B.prototype.set__foo}}\n);");
}
@@ -168,7 +168,7 @@ public class TestFlexJSAccessorMembers extends TestGoogAccessorMembers
IClassNode.class, WRAP_LEVEL_PACKAGE);
asBlockWalker.visitClass(node);
assertOut("/**\n * @constructor\n * @extends {A}\n */\nB = function() {\n B.base(this, 'constructor');\n};\ngoog.inherits(B, A);\n\n\n" +
- "B.prototype.set__foo = function(value) {\n B.base(this, 'set__foo', value);\n};\n\n\n" +
+ "B.prototype.set__foo = function(value) {\n B.superClass_.set__foo.apply(this, [ value] );\n};\n\n\n" +
"Object.defineProperties(B.prototype, /** @lends {B.prototype} */ {\n/** @export */\nfoo: {\nget: A.prototype.get__foo,\nset: B.prototype.set__foo}}\n);");
}
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/2c8becbc/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSClass.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSClass.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSClass.java
index a597afa..54f4f03 100644
--- a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSClass.java
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSClass.java
@@ -168,7 +168,7 @@ public class TestFlexJSClass extends TestGoogClass
{
IClassNode node = getClassNode("public class B {public function B() {}; override public function foo():void {super.foo();};}");
asBlockWalker.visitClass(node);
- String expected = "/**\n * @constructor\n */\norg.apache.flex.B = function() {\n};\n\n\n/**\n * @export\n * @override\n */\norg.apache.flex.B.prototype.foo = function() {\n org.apache.flex.B.base(this, 'foo');\n};";
+ String expected = "/**\n * @constructor\n */\norg.apache.flex.B = function() {\n};\n\n\n/**\n * @export\n * @override\n */\norg.apache.flex.B.prototype.foo = function() {\n org.apache.flex.B.superClass_.foo.apply(this);\n};";
assertOut(expected);
}
@@ -186,7 +186,7 @@ public class TestFlexJSClass extends TestGoogClass
{
IClassNode node = getClassNode("public class B extends A {public function B() {}; override public function set foo(value:Object):void {super.foo = value;};} class A {public function set foo(value:Object):void {}}");
asBlockWalker.visitClass(node);
- String expected = "/**\n * @constructor\n * @extends {org.apache.flex.A}\n */\norg.apache.flex.B = function() {\n org.apache.flex.B.base(this, 'constructor');\n};\ngoog.inherits(org.apache.flex.B, org.apache.flex.A);\n\n\norg.apache.flex.B.prototype.set__foo = function(value) {\n org.apache.flex.B.base(this, 'set__foo', value);\n};\n\n\nObject.defineProperties(org.apache.flex.B.prototype, /** @lends {org.apache.flex.B.prototype} */ {\n/** @export */\nfoo: {\nset: org.apache.flex.B.prototype.set__foo}}\n);";
+ String expected = "/**\n * @constructor\n * @extends {org.apache.flex.A}\n */\norg.apache.flex.B = function() {\n org.apache.flex.B.base(this, 'constructor');\n};\ngoog.inherits(org.apache.flex.B, org.apache.flex.A);\n\n\norg.apache.flex.B.prototype.set__foo = function(value) {\n org.apache.flex.B.superClass_.set__foo.apply(this, [ value] );\n};\n\n\nObject.defineProperties(org.apache.flex.B.prototype, /** @lends {org.apache.flex.B.prototype} */ {\n/** @export */\nfoo: {\nset: org.apache.flex.B.prototype.set__foo}}\n);";
assertOut(expected);
}
@@ -299,7 +299,7 @@ public class TestFlexJSClass extends TestGoogClass
+ "public static function foo7(value:Object):void{}"
+ "flash_proxy static function foo7(value:Object):void{}" + "}");
asBlockWalker.visitClass(node);
- assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {\n};\n\n\n/**\n * @export\n * @return {Object}\n */\norg.apache.flex.A.prototype.foo1 = function() {\n return null;\n};\n\n\n/**\n * @export\n * @return {Object}\n */\norg.apache.flex.A.prototype.foo1a = function() {\n return null;\n};\n\n\n/**\n * @export\n * @override\n */\norg.apache.flex.A.prototype.foo1b = function() {\n return org.apache.flex.A.base(this, 'foo1b');\n};\n\n\n/**\n * @protected\n * @param {Object} value\n */\norg.apache.flex.A.prototype.foo2 = function(value) {\n};\n\n\n/**\n * @private\n * @param {Object} value\n */\norg.apache.flex.A.prototype.foo3 = function(value) {\n};\n\n\n/**\n * @param {Object} value\n */\norg.apache.flex.A.prototype.foo5 = function(value) {\n};\n\n\n/**\n * @param {Object} value\n */\norg.apache.flex.A.prototype[\"http://www.adobe.com/2006/actionscript/flash/proxy::foo6\"] = function(value) {\n};\n\n\n/**\n * @export\n * @param {Object} value\n */\norg.apac
he.flex.A.foo7 = function(value) {\n};\n\n\n/**\n * @param {Object} value\n */\norg.apache.flex.A[\"http://www.adobe.com/2006/actionscript/flash/proxy::foo7\"] = function(value) {\n};");
+ assertOut("/**\n * @constructor\n */\norg.apache.flex.A = function() {\n};\n\n\n/**\n * @export\n * @return {Object}\n */\norg.apache.flex.A.prototype.foo1 = function() {\n return null;\n};\n\n\n/**\n * @export\n * @return {Object}\n */\norg.apache.flex.A.prototype.foo1a = function() {\n return null;\n};\n\n\n/**\n * @export\n * @override\n */\norg.apache.flex.A.prototype.foo1b = function() {\n return org.apache.flex.A.superClass_.foo1b.apply(this);\n};\n\n\n/**\n * @protected\n * @param {Object} value\n */\norg.apache.flex.A.prototype.foo2 = function(value) {\n};\n\n\n/**\n * @private\n * @param {Object} value\n */\norg.apache.flex.A.prototype.foo3 = function(value) {\n};\n\n\n/**\n * @param {Object} value\n */\norg.apache.flex.A.prototype.foo5 = function(value) {\n};\n\n\n/**\n * @param {Object} value\n */\norg.apache.flex.A.prototype[\"http://www.adobe.com/2006/actionscript/flash/proxy::foo6\"] = function(value) {\n};\n\n\n/**\n * @export\n * @param {Object} value\n */
\norg.apache.flex.A.foo7 = function(value) {\n};\n\n\n/**\n * @param {Object} value\n */\norg.apache.flex.A[\"http://www.adobe.com/2006/actionscript/flash/proxy::foo7\"] = function(value) {\n};");
}
@Test
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/2c8becbc/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSExpressions.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSExpressions.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSExpressions.java
index e1bf07e..153e648 100644
--- a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSExpressions.java
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSExpressions.java
@@ -81,7 +81,7 @@ public class TestFlexJSExpressions extends TestGoogExpressions
{
IFunctionNode node = getMethod("function foo(){if (a) super.foo();}");
asBlockWalker.visitFunction(node);
- assertOut("FalconTest_A.prototype.foo = function() {\n if (a)\n FalconTest_A.base(this, 'foo');\n}");
+ assertOut("FalconTest_A.prototype.foo = function() {\n if (a)\n FalconTest_A.superClass_.foo.apply(this);\n}");
}
@Override
@@ -90,7 +90,7 @@ public class TestFlexJSExpressions extends TestGoogExpressions
{
IFunctionNode node = getMethod("function foo(){if (a) super.foo(a, b, c);}");
asBlockWalker.visitFunction(node);
- assertOut("FalconTest_A.prototype.foo = function() {\n if (a)\n FalconTest_A.base(this, 'foo', a, b, c);\n}");
+ assertOut("FalconTest_A.prototype.foo = function() {\n if (a)\n FalconTest_A.superClass_.foo.apply(this, [ a, b, c] );\n}");
}
@Test
@@ -99,7 +99,7 @@ public class TestFlexJSExpressions extends TestGoogExpressions
IFunctionNode node = (IFunctionNode)getNode("import flash.utils.Proxy;import flash.utils.flash_proxy;use namespace flash_proxy;public class FalconTest_A extends Proxy { flash_proxy function foo(){if (a) super.setProperty(a, b);}}",
IFunctionNode.class, WRAP_LEVEL_PACKAGE);
asBlockWalker.visitFunction(node);
- assertOut("/**\n */\nFalconTest_A.prototype[\"http://www.adobe.com/2006/actionscript/flash/proxy::foo\"] = function() {\n if (a)\n FalconTest_A.base(this, 'http://www.adobe.com/2006/actionscript/flash/proxy::setProperty', a, b);\n}");
+ assertOut("/**\n */\nFalconTest_A.prototype[\"http://www.adobe.com/2006/actionscript/flash/proxy::foo\"] = function() {\n if (a)\n FalconTest_A.superClass_['http://www.adobe.com/2006/actionscript/flash/proxy::setProperty'].apply(this, [ a, b] );\n}");
}
//----------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/2c8becbc/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/TestFlexJSMXMLScript.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/TestFlexJSMXMLScript.java b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/TestFlexJSMXMLScript.java
index 2f2d0de..4ecfbc7 100644
--- a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/TestFlexJSMXMLScript.java
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/mxml/flexjs/TestFlexJSMXMLScript.java
@@ -85,7 +85,7 @@ public class TestFlexJSMXMLScript extends FlexJSTestBase
" * @override\n" +
" */\n" +
"AppName.prototype.addedToParent = function() {\n" +
- " AppName.base(this, 'addedToParent');\n" +
+ " AppName.superClass_.addedToParent.apply(this);\n" +
"};\n" +
"\n" +
"\n" +
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/2c8becbc/compiler-jx/src/test/resources/flexjs/projects/super/Base_result.js
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/resources/flexjs/projects/super/Base_result.js b/compiler-jx/src/test/resources/flexjs/projects/super/Base_result.js
index 326c395..2e5c7ec 100644
--- a/compiler-jx/src/test/resources/flexjs/projects/super/Base_result.js
+++ b/compiler-jx/src/test/resources/flexjs/projects/super/Base_result.js
@@ -36,13 +36,13 @@ goog.inherits(Base, Super);
Base.prototype.get__text = function() {
- return "A" + Base.base(this, 'get__text');
+ return "A" + Base.superClass_.get__text.apply(this);
};
Base.prototype.set__text = function(value) {
- if (value != Base.base(this, 'get__text')) {
- Base.base(this, 'set__text', "B" + value);
+ if (value != Base.superClass_.get__text.apply(this)) {
+ Base.superClass_.set__text.apply(this, [ "B" + value] );
}
};