You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2013/05/05 08:18:20 UTC
git commit: [flex-falcon] [refs/heads/develop] - Event handler code
generation was adding 'this' for the event parameter
Updated Branches:
refs/heads/develop f44a31b12 -> 2ecbdebb1
Event handler code generation was adding 'this' for the event parameter
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/2ecbdebb
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/2ecbdebb
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/2ecbdebb
Branch: refs/heads/develop
Commit: 2ecbdebb19f9cd6fcd166e17e1aa935b865fceeb
Parents: f44a31b
Author: Alex Harui <ah...@apache.org>
Authored: Sat May 4 23:17:58 2013 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Sat May 4 23:17:58 2013 -0700
----------------------------------------------------------------------
.../test-files/flexjs/files/MyInitialView.mxml | 4 ++--
.../flexjs/files/MyInitialView_result.js | 5 +++--
.../codegen/js/flexjs/JSFlexJSEmitter.java | 4 ++++
3 files changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/2ecbdebb/compiler.jx.tests/test-files/flexjs/files/MyInitialView.mxml
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/files/MyInitialView.mxml b/compiler.jx.tests/test-files/flexjs/files/MyInitialView.mxml
index f2cc9c7..2c30fd6 100644
--- a/compiler.jx.tests/test-files/flexjs/files/MyInitialView.mxml
+++ b/compiler.jx.tests/test-files/flexjs/files/MyInitialView.mxml
@@ -48,7 +48,7 @@ limitations under the License.
return String(comboBox.selectedItem);
}
- public function startTimer():void
+ public function startTimer(event:org.apache.flex.events.Event):void
{
timer = new org.apache.flex.utils.Timer(1000);
timer.addEventListener('timer', timerHandler);
@@ -69,7 +69,7 @@ limitations under the License.
destinationPropertyName="text" />
</basic:beads>
</basic:Label>
- <basic:TextButton text="Let's Start Timer" x="100" y="75" click="startTimer()" />
+ <basic:TextButton text="Let's Start Timer" x="100" y="75" click="startTimer(event)" />
<basic:TextButton text="Stop Timer" x="100" y="100" click="timer.removeEventListener('timer', timerHandler);timer.stop()" />
<basic:Label id="timerLabel" x="100" y="125" />
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/2ecbdebb/compiler.jx.tests/test-files/flexjs/files/MyInitialView_result.js
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/files/MyInitialView_result.js b/compiler.jx.tests/test-files/flexjs/files/MyInitialView_result.js
index 7ac5c67..510cf7c 100644
--- a/compiler.jx.tests/test-files/flexjs/files/MyInitialView_result.js
+++ b/compiler.jx.tests/test-files/flexjs/files/MyInitialView_result.js
@@ -215,8 +215,9 @@ MyInitialView.prototype.get_comboBoxValue = function() {
/**
* @expose
+ * @param {org.apache.flex.events.org.apache.flex.events.Event} event
*/
-MyInitialView.prototype.startTimer = function() {
+MyInitialView.prototype.startTimer = function(event) {
this.timer = new org.apache.flex.utils.Timer(1000);
this.timer.addEventListener('timer', goog.bind(this.timerHandler, this));
this.timer.start();
@@ -237,7 +238,7 @@ MyInitialView.prototype.timerHandler = function(event) {
*/
MyInitialView.prototype.$EH0 = function(event)
{
- this.startTimer();
+ this.startTimer(event);
};
/**
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/2ecbdebb/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 0325d44..96d892c 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
@@ -43,6 +43,7 @@ import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogEmitterTokens;
import org.apache.flex.compiler.internal.definitions.AccessorDefinition;
import org.apache.flex.compiler.internal.definitions.ClassDefinition;
import org.apache.flex.compiler.internal.definitions.FunctionDefinition;
+import org.apache.flex.compiler.internal.definitions.ParameterDefinition;
import org.apache.flex.compiler.internal.definitions.VariableDefinition;
import org.apache.flex.compiler.internal.projects.CompilerProject;
import org.apache.flex.compiler.internal.projects.FlexJSProject;
@@ -275,6 +276,9 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
if (classNode == null) // script in MXML and AS interface definitions
{
+ if (nodeDef instanceof ParameterDefinition)
+ return false;
+
if (nodeDef instanceof VariableDefinition)
{
IDefinition pdef = ((VariableDefinition) nodeDef).getParent();