You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Frédéric THOMAS <we...@hotmail.com> on 2015/07/07 16:01:18 UTC

[FalconJx / EXTERNC] interface members have no JSDoc ?

Is that expected the qux member has no JSDoc and is emitted as a simple var?

If I compile that emitted JS back to AS3, how the EXTERNC is suppose to guess the Type without JSDoc and react if a class implementing the interface use getter / setter ?

package interfaces {
import foo.Qux;

public interface IImport {
    function get qux():Qux;
    function set qux(value:Qux):void;
}
}


Emitted to:

/**
 * interfaces.IImport
 *
 * @fileoverview
 *
 * @suppress {checkTypes}
 */

goog.provide('interfaces_IImport');

/**
 * @interface
 */
interfaces_IImport = function() {};
interfaces_IImport.prototype.qux;


/**
 * Metadata
 *
 * @type {Object.<string, Array.<Object>>}
 */
interfaces_IImport.prototype.FLEXJS_CLASS_INFO = { names: [{ name: 'IImport', qName: 'interfaces_IImport'}] };

Thanks,
Frédéric THOMAS 		 	   		  

RE: [FalconJx / EXTERNC] interface members have no JSDoc ?

Posted by Frédéric THOMAS <we...@hotmail.com>.
> No, there should be a full signature, if I'm not mistaken

I can't see any examples, do you know what would look like such JSDoc and signatures for the getter and setter of my example ?

Frédéric THOMAS


----------------------------------------
> From: erik@ixsoftware.nl
> Date: Tue, 7 Jul 2015 17:06:35 +0200
> Subject: Re: [FalconJx / EXTERNC] interface members have no JSDoc ?
> To: dev@flex.apache.org
>
> No, there should be a full signature, if I'm not mistaken. But since I was
> last in the emitter, they switched to using Object.createProperties. I'm
> not familiar with the expected outcome for that pattern.
>
> EdB
>
>
>
> On Tue, Jul 7, 2015 at 4:01 PM, Frédéric THOMAS <we...@hotmail.com>
> wrote:
>
>> Is that expected the qux member has no JSDoc and is emitted as a simple
>> var?
>>
>> If I compile that emitted JS back to AS3, how the EXTERNC is suppose to
>> guess the Type without JSDoc and react if a class implementing the
>> interface use getter / setter ?
>>
>> package interfaces {
>> import foo.Qux;
>>
>> public interface IImport {
>> function get qux():Qux;
>> function set qux(value:Qux):void;
>> }
>> }
>>
>>
>> Emitted to:
>>
>> /**
>> * interfaces.IImport
>> *
>> * @fileoverview
>> *
>> * @suppress {checkTypes}
>> */
>>
>> goog.provide('interfaces_IImport');
>>
>> /**
>> * @interface
>> */
>> interfaces_IImport = function() {};
>> interfaces_IImport.prototype.qux;
>>
>>
>> /**
>> * Metadata
>> *
>> * @type {Object.<string, Array.<Object>>}
>> */
>> interfaces_IImport.prototype.FLEXJS_CLASS_INFO = { names: [{ name:
>> 'IImport', qName: 'interfaces_IImport'}] };
>>
>> Thanks,
>> Frédéric THOMAS
>
>
>
>
> --
> Ix Multimedia Software
>
> Jan Luykenstraat 27
> 3521 VB Utrecht
>
> T. 06-51952295
> I. www.ixsoftware.nl
 		 	   		  

RE: [FalconJx / EXTERNC] interface members have no JSDoc ?

Posted by Frédéric THOMAS <we...@hotmail.com>.
I didn't know the @interface was not used, I thought the compiler might have checked if the members were implemented, apparently, once again, it is done at compile time.
So,  I'm fine with how it is now, I was just pointing that out as well as getting thoughts about as-js-as round-trip but actually, there is no point to go that way IMO.

Thanks,
Frédéric THOMAS


----------------------------------------
> From: aharui@adobe.com
> To: dev@flex.apache.org
> Subject: Re: [FalconJx / EXTERNC] interface members have no JSDoc ?
> Date: Tue, 7 Jul 2015 16:33:24 +0000
>
> The FLEXJS output type doesn’t currently output much for Interfaces.
> Should it? How does GCC use interfaces? AFAICT, the methods on the
> interface aren’t used at runtime so there isn’t much need for it. The AS
> compiler and Flash/AIR runtime has already verified correctness.
>
> If we need more interface details for the JSC output-type we can certainly
> add them, but I don’t know if it is worth it just to be able to round-trip
> code from JS to AS and back to JS.
>
> -Alex
>
> On 7/7/15, 8:06 AM, "Erik de Bruin" <er...@ixsoftware.nl> wrote:
>
>>No, there should be a full signature, if I'm not mistaken. But since I was
>>last in the emitter, they switched to using Object.createProperties. I'm
>>not familiar with the expected outcome for that pattern.
>>
>>EdB
>>
>>
>>
>>On Tue, Jul 7, 2015 at 4:01 PM, Frédéric THOMAS <we...@hotmail.com>
>>wrote:
>>
>>> Is that expected the qux member has no JSDoc and is emitted as a simple
>>> var?
>>>
>>> If I compile that emitted JS back to AS3, how the EXTERNC is suppose to
>>> guess the Type without JSDoc and react if a class implementing the
>>> interface use getter / setter ?
>>>
>>> package interfaces {
>>> import foo.Qux;
>>>
>>> public interface IImport {
>>> function get qux():Qux;
>>> function set qux(value:Qux):void;
>>> }
>>> }
>>>
>>>
>>> Emitted to:
>>>
>>> /**
>>> * interfaces.IImport
>>> *
>>> * @fileoverview
>>> *
>>> * @suppress {checkTypes}
>>> */
>>>
>>> goog.provide('interfaces_IImport');
>>>
>>> /**
>>> * @interface
>>> */
>>> interfaces_IImport = function() {};
>>> interfaces_IImport.prototype.qux;
>>>
>>>
>>> /**
>>> * Metadata
>>> *
>>> * @type {Object.<string, Array.<Object>>}
>>> */
>>> interfaces_IImport.prototype.FLEXJS_CLASS_INFO = { names: [{ name:
>>> 'IImport', qName: 'interfaces_IImport'}] };
>>>
>>> Thanks,
>>> Frédéric THOMAS
>>
>>
>>
>>
>>--
>>Ix Multimedia Software
>>
>>Jan Luykenstraat 27
>>3521 VB Utrecht
>>
>>T. 06-51952295
>>I. www.ixsoftware.nl
>
 		 	   		  

Re: [FalconJx / EXTERNC] interface members have no JSDoc ?

Posted by Alex Harui <ah...@adobe.com>.
The FLEXJS output type doesn’t currently output much for Interfaces.
Should it?  How does GCC use interfaces?  AFAICT, the methods on the
interface aren’t used at runtime so there isn’t much need for it.  The AS
compiler and Flash/AIR runtime has already verified correctness.

If we need more interface details for the JSC output-type we can certainly
add them, but I don’t know if it is worth it just to be able to round-trip
code from JS to AS and back to JS.

-Alex

On 7/7/15, 8:06 AM, "Erik de Bruin" <er...@ixsoftware.nl> wrote:

>No, there should be a full signature, if I'm not mistaken. But since I was
>last in the emitter, they switched to using Object.createProperties. I'm
>not familiar with the expected outcome for that pattern.
>
>EdB
>
>
>
>On Tue, Jul 7, 2015 at 4:01 PM, Frédéric THOMAS <we...@hotmail.com>
>wrote:
>
>> Is that expected the qux member has no JSDoc and is emitted as a simple
>> var?
>>
>> If I compile that emitted JS back to AS3, how the EXTERNC is suppose to
>> guess the Type without JSDoc and react if a class implementing the
>> interface use getter / setter ?
>>
>> package interfaces {
>> import foo.Qux;
>>
>> public interface IImport {
>>     function get qux():Qux;
>>     function set qux(value:Qux):void;
>> }
>> }
>>
>>
>> Emitted to:
>>
>> /**
>>  * interfaces.IImport
>>  *
>>  * @fileoverview
>>  *
>>  * @suppress {checkTypes}
>>  */
>>
>> goog.provide('interfaces_IImport');
>>
>> /**
>>  * @interface
>>  */
>> interfaces_IImport = function() {};
>> interfaces_IImport.prototype.qux;
>>
>>
>> /**
>>  * Metadata
>>  *
>>  * @type {Object.<string, Array.<Object>>}
>>  */
>> interfaces_IImport.prototype.FLEXJS_CLASS_INFO = { names: [{ name:
>> 'IImport', qName: 'interfaces_IImport'}] };
>>
>> Thanks,
>> Frédéric THOMAS
>
>
>
>
>-- 
>Ix Multimedia Software
>
>Jan Luykenstraat 27
>3521 VB Utrecht
>
>T. 06-51952295
>I. www.ixsoftware.nl


Re: [FalconJx / EXTERNC] interface members have no JSDoc ?

Posted by Erik de Bruin <er...@ixsoftware.nl>.
No, there should be a full signature, if I'm not mistaken. But since I was
last in the emitter, they switched to using Object.createProperties. I'm
not familiar with the expected outcome for that pattern.

EdB



On Tue, Jul 7, 2015 at 4:01 PM, Frédéric THOMAS <we...@hotmail.com>
wrote:

> Is that expected the qux member has no JSDoc and is emitted as a simple
> var?
>
> If I compile that emitted JS back to AS3, how the EXTERNC is suppose to
> guess the Type without JSDoc and react if a class implementing the
> interface use getter / setter ?
>
> package interfaces {
> import foo.Qux;
>
> public interface IImport {
>     function get qux():Qux;
>     function set qux(value:Qux):void;
> }
> }
>
>
> Emitted to:
>
> /**
>  * interfaces.IImport
>  *
>  * @fileoverview
>  *
>  * @suppress {checkTypes}
>  */
>
> goog.provide('interfaces_IImport');
>
> /**
>  * @interface
>  */
> interfaces_IImport = function() {};
> interfaces_IImport.prototype.qux;
>
>
> /**
>  * Metadata
>  *
>  * @type {Object.<string, Array.<Object>>}
>  */
> interfaces_IImport.prototype.FLEXJS_CLASS_INFO = { names: [{ name:
> 'IImport', qName: 'interfaces_IImport'}] };
>
> Thanks,
> Frédéric THOMAS




-- 
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

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