You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by er...@apache.org on 2015/07/01 17:46:34 UTC

[1/5] git commit: [flex-falcon] [refs/heads/develop] - Fix NPE

Repository: flex-falcon
Updated Branches:
  refs/heads/develop 7ad42479d -> e7cc6f5ed


Fix NPE

If '-output' is left out of the cli arguments, and no '-load-config' is specified, an uncaught NPE was thrown

Signed-off-by: Erik de Bruin <er...@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/49fee914
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/49fee914
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/49fee914

Branch: refs/heads/develop
Commit: 49fee9146f9095f8bb5098de4f742508ca5a13d0
Parents: 7ad4247
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Wed Jul 1 11:29:14 2015 +0200
Committer: Erik de Bruin <er...@ixsoftware.nl>
Committed: Wed Jul 1 11:29:14 2015 +0200

----------------------------------------------------------------------
 flex-compiler-oem/src/flex2/tools/Tool.java | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/49fee914/flex-compiler-oem/src/flex2/tools/Tool.java
----------------------------------------------------------------------
diff --git a/flex-compiler-oem/src/flex2/tools/Tool.java b/flex-compiler-oem/src/flex2/tools/Tool.java
index 132ea31..73d8b4f 100644
--- a/flex-compiler-oem/src/flex2/tools/Tool.java
+++ b/flex-compiler-oem/src/flex2/tools/Tool.java
@@ -190,14 +190,18 @@ public class Tool
             throws org.apache.flex.compiler.exceptions.ConfigurationException
     {
         final String configFilePath = ArgumentUtil.getValue(args, "-load-config");
-        final File configFile = new File(configFilePath);
-        final FileSpecification fileSpecification = new FileSpecification(configFile.getAbsolutePath());
-        final ConfigurationBuffer cfgbuf = createConfigurationBuffer(Configuration.class);
-
-        FileConfigurator.load(cfgbuf, fileSpecification, new File(configFile.getPath()).getParent(), "flex-config",
-                false);
-
-        return cfgbuf;
+        if (configFilePath != null)
+        {
+            final File configFile = new File(configFilePath);
+            final FileSpecification fileSpecification = new FileSpecification(configFile.getAbsolutePath());
+            final ConfigurationBuffer cfgbuf = createConfigurationBuffer(Configuration.class);
+            
+            FileConfigurator.load(cfgbuf, fileSpecification, new File(configFile.getPath()).getParent(), "flex-config",
+                                  false);
+            
+            return cfgbuf;
+        }
+        return null;
     }
 
     private static ConfigurationBuffer createConfigurationBuffer(Class<? extends Configuration> configurationClass)


RE: [4/5] git commit: [flex-falcon] [refs/heads/develop] - Fix uncaught exception

Posted by Frédéric THOMAS <we...@hotmail.com>.
Ok, I just did a test and it doesn't avoid the compiler to catch my test case but doesn't display the stack trace only, so, that's fine !

Thanks,
Frédéric THOMAS


----------------------------------------
> From: erik@ixsoftware.nl
> Date: Wed, 1 Jul 2015 19:18:02 +0200
> Subject: Re: [4/5] git commit: [flex-falcon] [refs/heads/develop] - Fix uncaught exception
> To: dev@flex.apache.org
>
>>
>> Is it this that is creating an NPE in TypeScope ??
>>
>
> I got an exception, traced it to TypeScope, made a minimal intervention
> (null check) and the exception went away.
>
>
>> I'm curious here because IIUC, hiding an exception there can have very bad
>> side effects, for example make the compiler to accept classes with no
>> import type.
>>
>
> The exception I got wasn't caught anywhere in the stack. I made it all the
> way out. Can't imagine the compiler 'relying' on an uncaught exception...
>
> Anyway, I don't care all that much, and I might be wrong, so feel free
> (to ask me) to revert.
>
> EdB
>
>
>
>
>> Frédéric THOMAS
>>
>>
>> ----------------------------------------
>>> From: erik@ixsoftware.nl
>>> Date: Wed, 1 Jul 2015 18:48:24 +0200
>>> Subject: Re: [4/5] git commit: [flex-falcon] [refs/heads/develop] - Fix
>> uncaught exception
>>> To: dev@flex.apache.org
>>>
>>> I made the USMapCoords a separate class, as the FlexJS emitter isn't set
>> up
>>> to emit two 'exportSymbols' statements per JS file, even though the file
>>> might have two classes. Anyway, that didn't help much getting the release
>>> version working, but I figured that any use case is a proper use case,
>> so I
>>> made the exception go away anyway ;-)
>>>
>>> EdB
>>>
>>>
>>>
>>> On Wed, Jul 1, 2015 at 6:17 PM, Frédéric THOMAS <webdoublefx@hotmail.com
>>>
>>> wrote:
>>>
>>>> I fixed the imports already, and I'm about to give a try to write a new
>>>> compiler pass for it in replacement of the fix, it might be that in the
>>>> current fix, I didn't catch all the cases but it was working fine for
>> all
>>>> the 3 existing externs we have, can you tell me what have you change
>> before
>>>> this exception has been raised ?
>>>>
>>>> Thanks,
>>>> Frédéric THOMAS
>>>>
>>>>
>>>> ----------------------------------------
>>>>> From: erikdebruin@apache.org
>>>>> To: commits@flex.apache.org
>>>>> Date: Wed, 1 Jul 2015 15:46:37 +0000
>>>>> Subject: [4/5] git commit: [flex-falcon] [refs/heads/develop] - Fix
>>>> uncaught exception
>>>>>
>>>>> Fix uncaught exception
>>>>>
>>>>> Found this one while trying to compile a modified version of Fred's
>>>> JQuery externs example. I know next to nothing about Falcon, so if more
>>>> enlightened folks can trace this back to the root cause, that would be
>>>> lovely :-)
>>>>>
>>>>> Signed-off-by: Erik de Bruin <er...@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/fe8d7046
>>>>> Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/fe8d7046
>>>>> Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/fe8d7046
>>>>>
>>>>> Branch: refs/heads/develop
>>>>> Commit: fe8d704616c8b5b9059703ebd4c9ec31d7b63747
>>>>> Parents: 099263d
>>>>> Author: Erik de Bruin <er...@ixsoftware.nl>
>>>>> Authored: Wed Jul 1 17:43:19 2015 +0200
>>>>> Committer: Erik de Bruin <er...@ixsoftware.nl>
>>>>> Committed: Wed Jul 1 17:43:19 2015 +0200
>>>>>
>>>>> ----------------------------------------------------------------------
>>>>> .../src/org/apache/flex/compiler/internal/scopes/TypeScope.java | 4
>> ++++
>>>>> 1 file changed, 4 insertions(+)
>>>>> ----------------------------------------------------------------------
>>>>>
>>>>>
>>>>>
>>>>
>> http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/fe8d7046/compiler/src/org/apache/flex/compiler/internal/scopes/TypeScope.java
>>>>> ----------------------------------------------------------------------
>>>>> diff --git
>>>> a/compiler/src/org/apache/flex/compiler/internal/scopes/TypeScope.java
>>>> b/compiler/src/org/apache/flex/compiler/internal/scopes/TypeScope.java
>>>>> index 4e49e9f..8723fe2 100644
>>>>> ---
>>>> a/compiler/src/org/apache/flex/compiler/internal/scopes/TypeScope.java
>>>>> +++
>>>> b/compiler/src/org/apache/flex/compiler/internal/scopes/TypeScope.java
>>>>> @@ -341,6 +341,10 @@ public class TypeScope extends ASScope
>>>>> Collection<IDefinition> sDefs = new
>>>> FilteredCollection<IDefinition>(STATIC_ONLY_PREDICATE, defs);
>>>>> for (ITypeDefinition type : owningType.staticTypeIterable(project,
>>>> false))
>>>>> {
>>>>> + if (type == null)
>>>>> + {
>>>>> + continue;
>>>>> + }
>>>>> ASScope typeScope = (ASScope)type.getContainedScope();
>>>>> typeScope.getLocalProperty(project,
>>>>> // Only lookup static properties in this scope - for any inherited
>>>> scopes, we should lookup instance properties
>>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Ix Multimedia Software
>>>
>>> Jan Luykenstraat 27
>>> 3521 VB Utrecht
>>>
>>> T. 06-51952295
>>> I. www.ixsoftware.nl
>>
>>
>
>
>
> --
> Ix Multimedia Software
>
> Jan Luykenstraat 27
> 3521 VB Utrecht
>
> T. 06-51952295
> I. www.ixsoftware.nl
 		 	   		  

Re: [4/5] git commit: [flex-falcon] [refs/heads/develop] - Fix uncaught exception

Posted by Erik de Bruin <er...@ixsoftware.nl>.
>
> Is it this that is creating an NPE in TypeScope ??
>

I got an exception, traced it to TypeScope, made a minimal intervention
(null check) and the exception went away.


> I'm curious here because IIUC, hiding an exception there can have very bad
> side effects, for example make the compiler to accept classes with no
> import type.
>

The exception I got wasn't caught anywhere in the stack. I made it all the
way out. Can't imagine the compiler 'relying' on an uncaught exception...

Anyway, I don't care all that much, and I might be wrong, so feel free
(to ask me) to revert.

EdB




> Frédéric THOMAS
>
>
> ----------------------------------------
> > From: erik@ixsoftware.nl
> > Date: Wed, 1 Jul 2015 18:48:24 +0200
> > Subject: Re: [4/5] git commit: [flex-falcon] [refs/heads/develop] - Fix
> uncaught exception
> > To: dev@flex.apache.org
> >
> > I made the USMapCoords a separate class, as the FlexJS emitter isn't set
> up
> > to emit two 'exportSymbols' statements per JS file, even though the file
> > might have two classes. Anyway, that didn't help much getting the release
> > version working, but I figured that any use case is a proper use case,
> so I
> > made the exception go away anyway ;-)
> >
> > EdB
> >
> >
> >
> > On Wed, Jul 1, 2015 at 6:17 PM, Frédéric THOMAS <webdoublefx@hotmail.com
> >
> > wrote:
> >
> >> I fixed the imports already, and I'm about to give a try to write a new
> >> compiler pass for it in replacement of the fix, it might be that in the
> >> current fix, I didn't catch all the cases but it was working fine for
> all
> >> the 3 existing externs we have, can you tell me what have you change
> before
> >> this exception has been raised ?
> >>
> >> Thanks,
> >> Frédéric THOMAS
> >>
> >>
> >> ----------------------------------------
> >>> From: erikdebruin@apache.org
> >>> To: commits@flex.apache.org
> >>> Date: Wed, 1 Jul 2015 15:46:37 +0000
> >>> Subject: [4/5] git commit: [flex-falcon] [refs/heads/develop] - Fix
> >> uncaught exception
> >>>
> >>> Fix uncaught exception
> >>>
> >>> Found this one while trying to compile a modified version of Fred's
> >> JQuery externs example. I know next to nothing about Falcon, so if more
> >> enlightened folks can trace this back to the root cause, that would be
> >> lovely :-)
> >>>
> >>> Signed-off-by: Erik de Bruin <er...@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/fe8d7046
> >>> Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/fe8d7046
> >>> Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/fe8d7046
> >>>
> >>> Branch: refs/heads/develop
> >>> Commit: fe8d704616c8b5b9059703ebd4c9ec31d7b63747
> >>> Parents: 099263d
> >>> Author: Erik de Bruin <er...@ixsoftware.nl>
> >>> Authored: Wed Jul 1 17:43:19 2015 +0200
> >>> Committer: Erik de Bruin <er...@ixsoftware.nl>
> >>> Committed: Wed Jul 1 17:43:19 2015 +0200
> >>>
> >>> ----------------------------------------------------------------------
> >>> .../src/org/apache/flex/compiler/internal/scopes/TypeScope.java | 4
> ++++
> >>> 1 file changed, 4 insertions(+)
> >>> ----------------------------------------------------------------------
> >>>
> >>>
> >>>
> >>
> http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/fe8d7046/compiler/src/org/apache/flex/compiler/internal/scopes/TypeScope.java
> >>> ----------------------------------------------------------------------
> >>> diff --git
> >> a/compiler/src/org/apache/flex/compiler/internal/scopes/TypeScope.java
> >> b/compiler/src/org/apache/flex/compiler/internal/scopes/TypeScope.java
> >>> index 4e49e9f..8723fe2 100644
> >>> ---
> >> a/compiler/src/org/apache/flex/compiler/internal/scopes/TypeScope.java
> >>> +++
> >> b/compiler/src/org/apache/flex/compiler/internal/scopes/TypeScope.java
> >>> @@ -341,6 +341,10 @@ public class TypeScope extends ASScope
> >>> Collection<IDefinition> sDefs = new
> >> FilteredCollection<IDefinition>(STATIC_ONLY_PREDICATE, defs);
> >>> for (ITypeDefinition type : owningType.staticTypeIterable(project,
> >> false))
> >>> {
> >>> + if (type == null)
> >>> + {
> >>> + continue;
> >>> + }
> >>> ASScope typeScope = (ASScope)type.getContainedScope();
> >>> typeScope.getLocalProperty(project,
> >>> // Only lookup static properties in this scope - for any inherited
> >> scopes, we should lookup instance properties
> >>>
> >>
> >>
> >
> >
> >
> > --
> > Ix Multimedia Software
> >
> > Jan Luykenstraat 27
> > 3521 VB Utrecht
> >
> > T. 06-51952295
> > I. www.ixsoftware.nl
>
>



-- 
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

T. 06-51952295
I. www.ixsoftware.nl

RE: [4/5] git commit: [flex-falcon] [refs/heads/develop] - Fix uncaught exception

Posted by Frédéric THOMAS <we...@hotmail.com>.
Hey, sorry for my English again but I'm not totally sure I understood, can you detail please ?

> I made the USMapCoords a separate class, as the FlexJS emitter isn't set up
> to emit two 'exportSymbols' statements per JS file, even though the file
> might have two classes.

Why it does it well in js-debug ? shouldn't both have the same behaviour ?

/**
 * @constructor
 */
USMapCoords = function() {
};


/**
 * @expose
 * @type {Object}
 */
USMapCoords.usmap

Is it this that is creating an NPE in TypeScope ?? 
I'm curious here because IIUC, hiding an exception there can have very bad side effects, for example make the compiler to accept classes with no import type.

Frédéric THOMAS


----------------------------------------
> From: erik@ixsoftware.nl
> Date: Wed, 1 Jul 2015 18:48:24 +0200
> Subject: Re: [4/5] git commit: [flex-falcon] [refs/heads/develop] - Fix uncaught exception
> To: dev@flex.apache.org
>
> I made the USMapCoords a separate class, as the FlexJS emitter isn't set up
> to emit two 'exportSymbols' statements per JS file, even though the file
> might have two classes. Anyway, that didn't help much getting the release
> version working, but I figured that any use case is a proper use case, so I
> made the exception go away anyway ;-)
>
> EdB
>
>
>
> On Wed, Jul 1, 2015 at 6:17 PM, Frédéric THOMAS <we...@hotmail.com>
> wrote:
>
>> I fixed the imports already, and I'm about to give a try to write a new
>> compiler pass for it in replacement of the fix, it might be that in the
>> current fix, I didn't catch all the cases but it was working fine for all
>> the 3 existing externs we have, can you tell me what have you change before
>> this exception has been raised ?
>>
>> Thanks,
>> Frédéric THOMAS
>>
>>
>> ----------------------------------------
>>> From: erikdebruin@apache.org
>>> To: commits@flex.apache.org
>>> Date: Wed, 1 Jul 2015 15:46:37 +0000
>>> Subject: [4/5] git commit: [flex-falcon] [refs/heads/develop] - Fix
>> uncaught exception
>>>
>>> Fix uncaught exception
>>>
>>> Found this one while trying to compile a modified version of Fred's
>> JQuery externs example. I know next to nothing about Falcon, so if more
>> enlightened folks can trace this back to the root cause, that would be
>> lovely :-)
>>>
>>> Signed-off-by: Erik de Bruin <er...@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/fe8d7046
>>> Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/fe8d7046
>>> Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/fe8d7046
>>>
>>> Branch: refs/heads/develop
>>> Commit: fe8d704616c8b5b9059703ebd4c9ec31d7b63747
>>> Parents: 099263d
>>> Author: Erik de Bruin <er...@ixsoftware.nl>
>>> Authored: Wed Jul 1 17:43:19 2015 +0200
>>> Committer: Erik de Bruin <er...@ixsoftware.nl>
>>> Committed: Wed Jul 1 17:43:19 2015 +0200
>>>
>>> ----------------------------------------------------------------------
>>> .../src/org/apache/flex/compiler/internal/scopes/TypeScope.java | 4 ++++
>>> 1 file changed, 4 insertions(+)
>>> ----------------------------------------------------------------------
>>>
>>>
>>>
>> http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/fe8d7046/compiler/src/org/apache/flex/compiler/internal/scopes/TypeScope.java
>>> ----------------------------------------------------------------------
>>> diff --git
>> a/compiler/src/org/apache/flex/compiler/internal/scopes/TypeScope.java
>> b/compiler/src/org/apache/flex/compiler/internal/scopes/TypeScope.java
>>> index 4e49e9f..8723fe2 100644
>>> ---
>> a/compiler/src/org/apache/flex/compiler/internal/scopes/TypeScope.java
>>> +++
>> b/compiler/src/org/apache/flex/compiler/internal/scopes/TypeScope.java
>>> @@ -341,6 +341,10 @@ public class TypeScope extends ASScope
>>> Collection<IDefinition> sDefs = new
>> FilteredCollection<IDefinition>(STATIC_ONLY_PREDICATE, defs);
>>> for (ITypeDefinition type : owningType.staticTypeIterable(project,
>> false))
>>> {
>>> + if (type == null)
>>> + {
>>> + continue;
>>> + }
>>> ASScope typeScope = (ASScope)type.getContainedScope();
>>> typeScope.getLocalProperty(project,
>>> // Only lookup static properties in this scope - for any inherited
>> scopes, we should lookup instance properties
>>>
>>
>>
>
>
>
> --
> Ix Multimedia Software
>
> Jan Luykenstraat 27
> 3521 VB Utrecht
>
> T. 06-51952295
> I. www.ixsoftware.nl
 		 	   		  

Re: [4/5] git commit: [flex-falcon] [refs/heads/develop] - Fix uncaught exception

Posted by Erik de Bruin <er...@ixsoftware.nl>.
I made the USMapCoords a separate class, as the FlexJS emitter isn't set up
to emit two 'exportSymbols' statements per JS file, even though the file
might have two classes. Anyway, that didn't help much getting the release
version working, but I figured that any use case is a proper use case, so I
made the exception go away anyway ;-)

EdB



On Wed, Jul 1, 2015 at 6:17 PM, Frédéric THOMAS <we...@hotmail.com>
wrote:

> I fixed the imports already, and I'm about to give a try to write a new
> compiler pass for it in replacement of the fix, it might be that in the
> current fix, I didn't catch all the cases but it was working fine for all
> the 3 existing externs we have, can you tell me what have you change before
> this exception has been raised ?
>
> Thanks,
> Frédéric THOMAS
>
>
> ----------------------------------------
> > From: erikdebruin@apache.org
> > To: commits@flex.apache.org
> > Date: Wed, 1 Jul 2015 15:46:37 +0000
> > Subject: [4/5] git commit: [flex-falcon] [refs/heads/develop] - Fix
> uncaught exception
> >
> > Fix uncaught exception
> >
> > Found this one while trying to compile a modified version of Fred's
> JQuery externs example. I know next to nothing about Falcon, so if more
> enlightened folks can trace this back to the root cause, that would be
> lovely :-)
> >
> > Signed-off-by: Erik de Bruin <er...@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/fe8d7046
> > Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/fe8d7046
> > Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/fe8d7046
> >
> > Branch: refs/heads/develop
> > Commit: fe8d704616c8b5b9059703ebd4c9ec31d7b63747
> > Parents: 099263d
> > Author: Erik de Bruin <er...@ixsoftware.nl>
> > Authored: Wed Jul 1 17:43:19 2015 +0200
> > Committer: Erik de Bruin <er...@ixsoftware.nl>
> > Committed: Wed Jul 1 17:43:19 2015 +0200
> >
> > ----------------------------------------------------------------------
> > .../src/org/apache/flex/compiler/internal/scopes/TypeScope.java | 4 ++++
> > 1 file changed, 4 insertions(+)
> > ----------------------------------------------------------------------
> >
> >
> >
> http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/fe8d7046/compiler/src/org/apache/flex/compiler/internal/scopes/TypeScope.java
> > ----------------------------------------------------------------------
> > diff --git
> a/compiler/src/org/apache/flex/compiler/internal/scopes/TypeScope.java
> b/compiler/src/org/apache/flex/compiler/internal/scopes/TypeScope.java
> > index 4e49e9f..8723fe2 100644
> > ---
> a/compiler/src/org/apache/flex/compiler/internal/scopes/TypeScope.java
> > +++
> b/compiler/src/org/apache/flex/compiler/internal/scopes/TypeScope.java
> > @@ -341,6 +341,10 @@ public class TypeScope extends ASScope
> > Collection<IDefinition> sDefs = new
> FilteredCollection<IDefinition>(STATIC_ONLY_PREDICATE, defs);
> > for (ITypeDefinition type : owningType.staticTypeIterable(project,
> false))
> > {
> > + if (type == null)
> > + {
> > + continue;
> > + }
> > ASScope typeScope = (ASScope)type.getContainedScope();
> > typeScope.getLocalProperty(project,
> > // Only lookup static properties in this scope - for any inherited
> scopes, we should lookup instance properties
> >
>
>



-- 
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

T. 06-51952295
I. www.ixsoftware.nl

RE: [4/5] git commit: [flex-falcon] [refs/heads/develop] - Fix uncaught exception

Posted by Frédéric THOMAS <we...@hotmail.com>.
I fixed the imports already, and I'm about to give a try to write a new compiler pass for it in replacement of the fix, it might be that in the current fix, I didn't catch all the cases but it was working fine for all the 3 existing externs we have, can you tell me what have you change before this exception has been raised ?

Thanks,
Frédéric THOMAS


----------------------------------------
> From: erikdebruin@apache.org
> To: commits@flex.apache.org
> Date: Wed, 1 Jul 2015 15:46:37 +0000
> Subject: [4/5] git commit: [flex-falcon] [refs/heads/develop] - Fix uncaught exception
>
> Fix uncaught exception
>
> Found this one while trying to compile a modified version of Fred's JQuery externs example. I know next to nothing about Falcon, so if more enlightened folks can trace this back to the root cause, that would be lovely :-)
>
> Signed-off-by: Erik de Bruin <er...@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/fe8d7046
> Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/fe8d7046
> Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/fe8d7046
>
> Branch: refs/heads/develop
> Commit: fe8d704616c8b5b9059703ebd4c9ec31d7b63747
> Parents: 099263d
> Author: Erik de Bruin <er...@ixsoftware.nl>
> Authored: Wed Jul 1 17:43:19 2015 +0200
> Committer: Erik de Bruin <er...@ixsoftware.nl>
> Committed: Wed Jul 1 17:43:19 2015 +0200
>
> ----------------------------------------------------------------------
> .../src/org/apache/flex/compiler/internal/scopes/TypeScope.java | 4 ++++
> 1 file changed, 4 insertions(+)
> ----------------------------------------------------------------------
>
>
> http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/fe8d7046/compiler/src/org/apache/flex/compiler/internal/scopes/TypeScope.java
> ----------------------------------------------------------------------
> diff --git a/compiler/src/org/apache/flex/compiler/internal/scopes/TypeScope.java b/compiler/src/org/apache/flex/compiler/internal/scopes/TypeScope.java
> index 4e49e9f..8723fe2 100644
> --- a/compiler/src/org/apache/flex/compiler/internal/scopes/TypeScope.java
> +++ b/compiler/src/org/apache/flex/compiler/internal/scopes/TypeScope.java
> @@ -341,6 +341,10 @@ public class TypeScope extends ASScope
> Collection<IDefinition> sDefs = new FilteredCollection<IDefinition>(STATIC_ONLY_PREDICATE, defs);
> for (ITypeDefinition type : owningType.staticTypeIterable(project, false))
> {
> + if (type == null)
> + {
> + continue;
> + }
> ASScope typeScope = (ASScope)type.getContainedScope();
> typeScope.getLocalProperty(project,
> // Only lookup static properties in this scope - for any inherited scopes, we should lookup instance properties
>
 		 	   		  

[4/5] git commit: [flex-falcon] [refs/heads/develop] - Fix uncaught exception

Posted by er...@apache.org.
Fix uncaught exception

Found this one while trying to compile a modified version of Fred's JQuery externs example. I know next to nothing about Falcon, so if more enlightened folks can trace this back to the root cause, that would be lovely :-)

Signed-off-by: Erik de Bruin <er...@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/fe8d7046
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/fe8d7046
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/fe8d7046

Branch: refs/heads/develop
Commit: fe8d704616c8b5b9059703ebd4c9ec31d7b63747
Parents: 099263d
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Wed Jul 1 17:43:19 2015 +0200
Committer: Erik de Bruin <er...@ixsoftware.nl>
Committed: Wed Jul 1 17:43:19 2015 +0200

----------------------------------------------------------------------
 .../src/org/apache/flex/compiler/internal/scopes/TypeScope.java  | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/fe8d7046/compiler/src/org/apache/flex/compiler/internal/scopes/TypeScope.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/scopes/TypeScope.java b/compiler/src/org/apache/flex/compiler/internal/scopes/TypeScope.java
index 4e49e9f..8723fe2 100644
--- a/compiler/src/org/apache/flex/compiler/internal/scopes/TypeScope.java
+++ b/compiler/src/org/apache/flex/compiler/internal/scopes/TypeScope.java
@@ -341,6 +341,10 @@ public class TypeScope extends ASScope
             Collection<IDefinition> sDefs = new FilteredCollection<IDefinition>(STATIC_ONLY_PREDICATE, defs);
             for (ITypeDefinition type : owningType.staticTypeIterable(project, false))
             {
+                if (type == null)
+                {
+                    continue;
+                }
                 ASScope typeScope = (ASScope)type.getContainedScope();
                 typeScope.getLocalProperty(project,
                                             // Only lookup static properties in this scope - for any inherited scopes, we should lookup instance properties


RE: [3/5] git commit: [flex-falcon] [refs/heads/develop] - Fix NPE

Posted by Frédéric THOMAS <we...@hotmail.com>.
Well, I'm for anything that can improve what I did and for sure, the command line wasn't included, so, go ahead, I like :-)

Frédéric THOMAS


----------------------------------------
> From: erik@ixsoftware.nl
> Date: Wed, 1 Jul 2015 18:51:58 +0200
> Subject: Re: [3/5] git commit: [flex-falcon] [refs/heads/develop] - Fix NPE
> To: dev@flex.apache.org
>
>>
>> eg. IntelliJ passes a config.xml and in more prevent you have a build
>> configuration without output path.
>>
>
> Yeah, but having an '-output' argument will force the 'js/out' parent
> directories to be created, something I thought wasn't very helpful if
> you're building from the command line. Why nest any deeper than is already
> necessary?
>
> EdB
>
>
>
>
>> Frédéric THOMAS
>>
>>
>> ----------------------------------------
>>> From: erikdebruin@apache.org
>>> To: commits@flex.apache.org
>>> Date: Wed, 1 Jul 2015 15:46:36 +0000
>>> Subject: [3/5] git commit: [flex-falcon] [refs/heads/develop] - Fix NPE
>>>
>>> Fix NPE
>>>
>>> This time such that the diff looks nicer ;-)
>>>
>>> Signed-off-by: Erik de Bruin <er...@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/099263d4
>>> Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/099263d4
>>> Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/099263d4
>>>
>>> Branch: refs/heads/develop
>>> Commit: 099263d45f8fbdc7f332e801704f14129ea9bdbb
>>> Parents: 185c377
>>> Author: Erik de Bruin <er...@ixsoftware.nl>
>>> Authored: Wed Jul 1 17:36:23 2015 +0200
>>> Committer: Erik de Bruin <er...@ixsoftware.nl>
>>> Committed: Wed Jul 1 17:36:23 2015 +0200
>>>
>>> ----------------------------------------------------------------------
>>> flex-compiler-oem/src/flex2/tools/Tool.java | 4 ++++
>>> 1 file changed, 4 insertions(+)
>>> ----------------------------------------------------------------------
>>>
>>>
>>>
>> http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/099263d4/flex-compiler-oem/src/flex2/tools/Tool.java
>>> ----------------------------------------------------------------------
>>> diff --git a/flex-compiler-oem/src/flex2/tools/Tool.java
>> b/flex-compiler-oem/src/flex2/tools/Tool.java
>>> index 132ea31..1e4c516 100644
>>> --- a/flex-compiler-oem/src/flex2/tools/Tool.java
>>> +++ b/flex-compiler-oem/src/flex2/tools/Tool.java
>>> @@ -190,6 +190,10 @@ public class Tool
>>> throws org.apache.flex.compiler.exceptions.ConfigurationException
>>> {
>>> final String configFilePath = ArgumentUtil.getValue(args,
>> "-load-config");
>>> + if (configFilePath == null)
>>> + {
>>> + return null;
>>> + }
>>> final File configFile = new File(configFilePath);
>>> final FileSpecification fileSpecification = new
>> FileSpecification(configFile.getAbsolutePath());
>>> final ConfigurationBuffer cfgbuf =
>> createConfigurationBuffer(Configuration.class);
>>>
>>
>>
>
>
>
> --
> Ix Multimedia Software
>
> Jan Luykenstraat 27
> 3521 VB Utrecht
>
> T. 06-51952295
> I. www.ixsoftware.nl
 		 	   		  

Re: [3/5] git commit: [flex-falcon] [refs/heads/develop] - Fix NPE

Posted by Erik de Bruin <er...@ixsoftware.nl>.
>
> eg. IntelliJ passes a config.xml and in more prevent you have a build
> configuration without output path.
>

Yeah, but having an '-output' argument will force the 'js/out' parent
directories to be created, something I thought wasn't very helpful if
you're building from the command line. Why nest any deeper than is already
necessary?

EdB




> Frédéric THOMAS
>
>
> ----------------------------------------
> > From: erikdebruin@apache.org
> > To: commits@flex.apache.org
> > Date: Wed, 1 Jul 2015 15:46:36 +0000
> > Subject: [3/5] git commit: [flex-falcon] [refs/heads/develop] - Fix NPE
> >
> > Fix NPE
> >
> > This time such that the diff looks nicer ;-)
> >
> > Signed-off-by: Erik de Bruin <er...@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/099263d4
> > Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/099263d4
> > Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/099263d4
> >
> > Branch: refs/heads/develop
> > Commit: 099263d45f8fbdc7f332e801704f14129ea9bdbb
> > Parents: 185c377
> > Author: Erik de Bruin <er...@ixsoftware.nl>
> > Authored: Wed Jul 1 17:36:23 2015 +0200
> > Committer: Erik de Bruin <er...@ixsoftware.nl>
> > Committed: Wed Jul 1 17:36:23 2015 +0200
> >
> > ----------------------------------------------------------------------
> > flex-compiler-oem/src/flex2/tools/Tool.java | 4 ++++
> > 1 file changed, 4 insertions(+)
> > ----------------------------------------------------------------------
> >
> >
> >
> http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/099263d4/flex-compiler-oem/src/flex2/tools/Tool.java
> > ----------------------------------------------------------------------
> > diff --git a/flex-compiler-oem/src/flex2/tools/Tool.java
> b/flex-compiler-oem/src/flex2/tools/Tool.java
> > index 132ea31..1e4c516 100644
> > --- a/flex-compiler-oem/src/flex2/tools/Tool.java
> > +++ b/flex-compiler-oem/src/flex2/tools/Tool.java
> > @@ -190,6 +190,10 @@ public class Tool
> > throws org.apache.flex.compiler.exceptions.ConfigurationException
> > {
> > final String configFilePath = ArgumentUtil.getValue(args,
> "-load-config");
> > + if (configFilePath == null)
> > + {
> > + return null;
> > + }
> > final File configFile = new File(configFilePath);
> > final FileSpecification fileSpecification = new
> FileSpecification(configFile.getAbsolutePath());
> > final ConfigurationBuffer cfgbuf =
> createConfigurationBuffer(Configuration.class);
> >
>
>



-- 
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

T. 06-51952295
I. www.ixsoftware.nl

RE: [3/5] git commit: [flex-falcon] [refs/heads/develop] - Fix NPE

Posted by Frédéric THOMAS <we...@hotmail.com>.
Correct, I haven't planed for the build out of IntelliJ , we are likely to find more of them.

eg. IntelliJ passes a config.xml and in more prevent you have a build configuration without output path.

Frédéric THOMAS


----------------------------------------
> From: erikdebruin@apache.org
> To: commits@flex.apache.org
> Date: Wed, 1 Jul 2015 15:46:36 +0000
> Subject: [3/5] git commit: [flex-falcon] [refs/heads/develop] - Fix NPE
>
> Fix NPE
>
> This time such that the diff looks nicer ;-)
>
> Signed-off-by: Erik de Bruin <er...@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/099263d4
> Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/099263d4
> Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/099263d4
>
> Branch: refs/heads/develop
> Commit: 099263d45f8fbdc7f332e801704f14129ea9bdbb
> Parents: 185c377
> Author: Erik de Bruin <er...@ixsoftware.nl>
> Authored: Wed Jul 1 17:36:23 2015 +0200
> Committer: Erik de Bruin <er...@ixsoftware.nl>
> Committed: Wed Jul 1 17:36:23 2015 +0200
>
> ----------------------------------------------------------------------
> flex-compiler-oem/src/flex2/tools/Tool.java | 4 ++++
> 1 file changed, 4 insertions(+)
> ----------------------------------------------------------------------
>
>
> http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/099263d4/flex-compiler-oem/src/flex2/tools/Tool.java
> ----------------------------------------------------------------------
> diff --git a/flex-compiler-oem/src/flex2/tools/Tool.java b/flex-compiler-oem/src/flex2/tools/Tool.java
> index 132ea31..1e4c516 100644
> --- a/flex-compiler-oem/src/flex2/tools/Tool.java
> +++ b/flex-compiler-oem/src/flex2/tools/Tool.java
> @@ -190,6 +190,10 @@ public class Tool
> throws org.apache.flex.compiler.exceptions.ConfigurationException
> {
> final String configFilePath = ArgumentUtil.getValue(args, "-load-config");
> + if (configFilePath == null)
> + {
> + return null;
> + }
> final File configFile = new File(configFilePath);
> final FileSpecification fileSpecification = new FileSpecification(configFile.getAbsolutePath());
> final ConfigurationBuffer cfgbuf = createConfigurationBuffer(Configuration.class);
>
 		 	   		  

[3/5] git commit: [flex-falcon] [refs/heads/develop] - Fix NPE

Posted by er...@apache.org.
Fix NPE

This time such that the diff looks nicer ;-)

Signed-off-by: Erik de Bruin <er...@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/099263d4
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/099263d4
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/099263d4

Branch: refs/heads/develop
Commit: 099263d45f8fbdc7f332e801704f14129ea9bdbb
Parents: 185c377
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Wed Jul 1 17:36:23 2015 +0200
Committer: Erik de Bruin <er...@ixsoftware.nl>
Committed: Wed Jul 1 17:36:23 2015 +0200

----------------------------------------------------------------------
 flex-compiler-oem/src/flex2/tools/Tool.java | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/099263d4/flex-compiler-oem/src/flex2/tools/Tool.java
----------------------------------------------------------------------
diff --git a/flex-compiler-oem/src/flex2/tools/Tool.java b/flex-compiler-oem/src/flex2/tools/Tool.java
index 132ea31..1e4c516 100644
--- a/flex-compiler-oem/src/flex2/tools/Tool.java
+++ b/flex-compiler-oem/src/flex2/tools/Tool.java
@@ -190,6 +190,10 @@ public class Tool
             throws org.apache.flex.compiler.exceptions.ConfigurationException
     {
         final String configFilePath = ArgumentUtil.getValue(args, "-load-config");
+        if (configFilePath == null)
+        {
+            return null;
+        }
         final File configFile = new File(configFilePath);
         final FileSpecification fileSpecification = new FileSpecification(configFile.getAbsolutePath());
         final ConfigurationBuffer cfgbuf = createConfigurationBuffer(Configuration.class);


[2/5] git commit: [flex-falcon] [refs/heads/develop] - Revert "Fix NPE"

Posted by er...@apache.org.
Revert "Fix NPE"

This reverts commit 49fee9146f9095f8bb5098de4f742508ca5a13d0.


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

Branch: refs/heads/develop
Commit: 185c3776c4eab430c5ad11fa681d5403d35f1fbc
Parents: 49fee91
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Wed Jul 1 17:34:46 2015 +0200
Committer: Erik de Bruin <er...@ixsoftware.nl>
Committed: Wed Jul 1 17:34:46 2015 +0200

----------------------------------------------------------------------
 flex-compiler-oem/src/flex2/tools/Tool.java | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/185c3776/flex-compiler-oem/src/flex2/tools/Tool.java
----------------------------------------------------------------------
diff --git a/flex-compiler-oem/src/flex2/tools/Tool.java b/flex-compiler-oem/src/flex2/tools/Tool.java
index 73d8b4f..132ea31 100644
--- a/flex-compiler-oem/src/flex2/tools/Tool.java
+++ b/flex-compiler-oem/src/flex2/tools/Tool.java
@@ -190,18 +190,14 @@ public class Tool
             throws org.apache.flex.compiler.exceptions.ConfigurationException
     {
         final String configFilePath = ArgumentUtil.getValue(args, "-load-config");
-        if (configFilePath != null)
-        {
-            final File configFile = new File(configFilePath);
-            final FileSpecification fileSpecification = new FileSpecification(configFile.getAbsolutePath());
-            final ConfigurationBuffer cfgbuf = createConfigurationBuffer(Configuration.class);
-            
-            FileConfigurator.load(cfgbuf, fileSpecification, new File(configFile.getPath()).getParent(), "flex-config",
-                                  false);
-            
-            return cfgbuf;
-        }
-        return null;
+        final File configFile = new File(configFilePath);
+        final FileSpecification fileSpecification = new FileSpecification(configFile.getAbsolutePath());
+        final ConfigurationBuffer cfgbuf = createConfigurationBuffer(Configuration.class);
+
+        FileConfigurator.load(cfgbuf, fileSpecification, new File(configFile.getPath()).getParent(), "flex-config",
+                false);
+
+        return cfgbuf;
     }
 
     private static ConfigurationBuffer createConfigurationBuffer(Class<? extends Configuration> configurationClass)


[5/5] git commit: [flex-falcon] [refs/heads/develop] - In FlexJS 'const' declarations weren't getting emitted as with a 'var' keyword

Posted by er...@apache.org.
In FlexJS 'const' declarations weren't getting emitted as with a 'var' keyword

Omitting keywords, especially when running in strict mode, won't work out well.

Signed-off-by: Erik de Bruin <er...@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/e7cc6f5e
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/e7cc6f5e
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/e7cc6f5e

Branch: refs/heads/develop
Commit: e7cc6f5ed866f44e79befce2eae7b21d8b4e5118
Parents: fe8d704
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Wed Jul 1 17:45:33 2015 +0200
Committer: Erik de Bruin <er...@ixsoftware.nl>
Committed: Wed Jul 1 17:45:33 2015 +0200

----------------------------------------------------------------------
 .../js/flexjs/TestFlexJSMethodMembers.java      |  8 +++++
 .../codegen/js/flexjs/TestFlexJSStatements.java | 34 ++++++++++++++++++++
 .../codegen/js/flexjs/JSFlexJSEmitter.java      | 13 ++++++++
 .../codegen/js/jx/VarDeclarationEmitter.java    |  5 +++
 4 files changed, 60 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/e7cc6f5e/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSMethodMembers.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSMethodMembers.java b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSMethodMembers.java
index a11ea8d..0ede063 100644
--- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSMethodMembers.java
+++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSMethodMembers.java
@@ -190,6 +190,14 @@ public class TestFlexJSMethodMembers extends TestGoogMethodMembers
         assertOut("/**\n * @expose\n * @param {string} bar\n * @param {number=} baz\n * @return {number}\n * @override\n */\nFalconTest_A.prototype.foo = function(bar, baz) {\n  baz = typeof baz !== 'undefined' ? baz : null;\n  return -1;\n}");
     }
 
+    @Test
+    public void testMethod_withConstDeclaration()
+    {
+        IFunctionNode node = getMethod("public function foo():String{const A:String = 'Hello World'; return A;}");
+        asBlockWalker.visitFunction(node);
+        assertOut("/**\n * @expose\n * @return {string}\n */\nFalconTest_A.prototype.foo = function() {\n  \n/**\n * @const\n * @type {string}\n */\nvar A = 'Hello World';\n  return A;\n}");
+    }
+
     @Override
     protected IBackend createBackend()
     {

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/e7cc6f5e/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSStatements.java
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSStatements.java b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSStatements.java
index 2369ecb..7d8e725 100644
--- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSStatements.java
+++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSStatements.java
@@ -56,6 +56,40 @@ public class TestFlexJSStatements extends TestGoogStatements
     }
 
     //----------------------------------
+    // const declaration
+    //----------------------------------
+
+    @Override
+    @Test
+    public void testConstDeclaration()
+    {
+        IVariableNode node = (IVariableNode) getNode("const a = 42;",
+                IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        assertOut("\n/**\n * @const\n * @type {*}\n */\nvar a = 42");
+    }
+
+    @Override
+    @Test
+    public void testConstDeclaration_withType()
+    {
+        IVariableNode node = (IVariableNode) getNode("const a:int = 42;",
+                IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        assertOut("\n/**\n * @const\n * @type {number}\n */\nvar a = 42");
+    }
+
+    @Override
+    @Test
+    public void testConstDeclaration_withList()
+    {
+        IVariableNode node = (IVariableNode) getNode(
+                "const a:int = 4, b:int = 11, c:int = 42;", IVariableNode.class);
+        asBlockWalker.visitVariable(node);
+        assertOut("\n/**\n * @const\n * @type {number}\n */\nvar a = 4, \n/**\n * @const\n * @type {number}\n */\nb = 11, \n/**\n * @const\n * @type {number}\n */\nc = 42");
+    }
+
+    //----------------------------------
     // for () { }
     //----------------------------------
 

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/e7cc6f5e/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 e1df65a..210ec5f 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
@@ -174,6 +174,19 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
     }
 
     @Override
+    public void emitMemberKeyword(IDefinitionNode node)
+    {
+        if (node instanceof IFunctionNode)
+        {
+            writeToken(ASEmitterTokens.FUNCTION);
+        }
+        else if (node instanceof IVariableNode)
+        {
+            writeToken(ASEmitterTokens.VAR);
+        }
+    }
+
+    @Override
     public void emitMemberName(IDefinitionNode node)
     {
         write(node.getName());

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/e7cc6f5e/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/VarDeclarationEmitter.java
----------------------------------------------------------------------
diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/VarDeclarationEmitter.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/VarDeclarationEmitter.java
index 8b57ea9..ef5be6b 100644
--- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/VarDeclarationEmitter.java
+++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/jx/VarDeclarationEmitter.java
@@ -65,6 +65,11 @@ public class VarDeclarationEmitter extends JSSubEmitter implements
             fjs.getDocEmitter().emitVarDoc(node, null);
         }
 
+        if (!(node instanceof ChainedVariableNode) && node.isConst())
+        {
+            fjs.emitMemberKeyword(node);
+        }
+
         fjs.emitDeclarationName(node);
         if (!(avnode instanceof IEmbedNode))
             fjs.emitAssignedValue(avnode);