You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
package test
{
public class SuperTestBase
{
public function SuperTestBase(v:Boolean=false)
{
}
}
}
package test
{
public class SuperTest extends SuperTestBase
{
public function SuperTest()
{
super();
}
}
}
The above actionscript creates the following SuperTest javascript:
if (typeof test == "undefined")
var test = {};
test.SuperTest = function() {
test.SuperTestBase.call(thisfalse);
};
$inherit(test.SuperTest, test.SuperTestBase);
test.SuperTest.className = "test.SuperTest";
test.SuperTest.getRuntimeDependencies = function(t) {
var p;
return [];
};
test.SuperTest.getStaticDependencies = function(t) {
var p;
return [];
};
test.SuperTest.injectionPoints = function(t) {
var p;
switch (t) {
case 1:
p = test.SuperTestBase.injectionPoints(t);
break;
case 2:
p = test.SuperTestBase.injectionPoints(t);
break;
case 3:
p = test.SuperTestBase.injectionPoints(t);
break;
default:
p = [];
break;
}
return p;
};
Line 5 should read:
test.SuperTestBase.call();
or at very least:
test.SuperTestBase.call(false);
however it currently compiles to
test.SuperTestBase.call(thisfalse);
work around is to manually set the Boolean in AS when calling super.
public function SuperTest()
{
super(false);
}
However this particular configuration appears to be creating other issues as well. For example if you create a new empty vector
package test
{
public class SuperTest extends SuperTestBase
{
public var _vec:Vector.<Object> = new Vector.<Object>();
public function SuperTest()
{
super(false);
}
}
}
you get the following VectorTest javascript
if (typeof test == "undefined")
var test = {};
test.SuperTest = function() {
this._vec = [false];
test.SuperTestBase.call(this, false);
};
$inherit(test.SuperTest, test.SuperTestBase);
test.SuperTest.className = "test.SuperTest";
test.SuperTest.getRuntimeDependencies = function(t) {
var p;
return [];
};
test.SuperTest.getStaticDependencies = function(t) {
var p;
return [];
};
test.SuperTest.injectionPoints = function(t) {
var p;
switch (t) {
case 1:
p = test.SuperTestBase.injectionPoints(t);
break;
case 2:
p = test.SuperTestBase.injectionPoints(t);
break;
case 3:
p = test.SuperTestBase.injectionPoints(t);
break;
default:
p = [];
break;
}
return p;
};
On line 5 you would expect to get
this._vec = [];
however it current compiles to
this._vec = [false];
if you change the Boolean in the base class to have no default value
public function SuperTestBase(v:Boolean)
{
}
then the vector initialises correctly
workaround: don't use default param values in constructor... which isn't really much of a workaround seeing as how common it is to use default param values in the constructor :/
The text was updated successfully, but these errors were encountered:
The above actionscript creates the following SuperTest javascript:
Line 5 should read:
or at very least:
however it currently compiles to
work around is to manually set the Boolean in AS when calling super.
However this particular configuration appears to be creating other issues as well. For example if you create a new empty vector
you get the following VectorTest javascript
On line 5 you would expect to get
however it current compiles to
if you change the Boolean in the base class to have no default value
then the vector initialises correctly
workaround: don't use default param values in constructor... which isn't really much of a workaround seeing as how common it is to use default param values in the constructor :/
The text was updated successfully, but these errors were encountered: