You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@royale.apache.org by Serkan Taş <se...@likyateknoloji.com> on 2018/10/18 20:16:31 UTC

int.MAX_VALUE in function list

Hi,

When i am compiling class with method below i get compile error :

     public function scrollToRange(anchorPosition:int = 0, 
activePosition:int = int.MAX_VALUE):void
     {
         activePosition1:int = int.MAX_VALUE;
         // if (!textDisplay)
         //    return;

         // textDisplay.scrollToRange(anchorPosition, activePosition);
     }


Error:

D:\dev\royale-emulation-works\apache-royale-0.9.4-bin-js-swf\royale-asjs\frameworks\projects\SparkRoyale\src\main\royale\spark\components\TextArea.as(753): 
col: 80 Parameter initializer unknown or is not a compile-time constant. 
An initial value of undefined will be used instead.

     public function scrollToRange(anchorPosition:int = 0, 
activePosition:int = int.MAX_VALUE):void



When change as below, compiles correctly.

     public function scrollToRange(anchorPosition:int = 0, 
activePosition:int = 0/*int.MAX_VALUE*/):void
     {
         var activePosition1:int = int.MAX_VALUE;
         // if (!textDisplay)
         //    return;

         // textDisplay.scrollToRange(anchorPosition, activePosition);
     }


Can we say that int.MAX_VALUE usage in function signature not allowed ?

Thanks
Serkan

Re: int.MAX_VALUE in function list

Posted by Harvey Johnson <hj...@gmail.com>.
https://developer.samsung.com/internet#events

On Oct 19, 2018 02:48, "Alex Harui" <ah...@adobe.com> wrote:

Turned out to be trickier than I thought.  Externs use @const for both
read-only as well as true constants.  There doesn’t seem to be a way to
distinguish one from the other.  Adding an initial value causes it to not
be picked up as an extern.  The initial value doesn’t really matter because
the initial value should be defined by the actual implementation the
externs represent, but it seemed like we should get the right values in the
AS in case we ever inline constants.  So I added a config entry to specify
true constants.  Volunteers are needed to add more config entries for other
constants.  I just did uint and int to prove it works.



You will need the changes to royale-compiler as well as royale-typedefs.



HTH,

-Alex



*From: *Alex Harui <ah...@adobe.com>
*Reply-To: *"users@royale.apache.org" <us...@royale.apache.org>
*Date: *Thursday, October 18, 2018 at 5:51 PM

*To: *"users@royale.apache.org" <us...@royale.apache.org>
*Subject: *Re: int.MAX_VALUE in function list



Looks like there is a bug in externc.  The missing.js specified @const but
the output is var not const.  I’ll try to take a few minutes to see why.



-Alex



*From: *Alex Harui <ah...@adobe.com>
*Reply-To: *"users@royale.apache.org" <us...@royale.apache.org>
*Date: *Thursday, October 18, 2018 at 5:35 PM
*To: *"users@royale.apache.org" <us...@royale.apache.org>
*Subject: *Re: int.MAX_VALUE in function list



Well, we should probably tweak the compiler to get it to work.



-Alex



*From: *Serkan Taş <se...@likyateknoloji.com>
*Reply-To: *"users@royale.apache.org" <us...@royale.apache.org>
*Date: *Thursday, October 18, 2018 at 1:16 PM
*To: *"users@royale.apache.org" <us...@royale.apache.org>
*Subject: *int.MAX_VALUE in function list



Hi,

When i am compiling class with method below i get compile error :

    public function scrollToRange(anchorPosition:int = 0,
activePosition:int = int.MAX_VALUE):void
    {
        activePosition1:int = int.MAX_VALUE;
        // if (!textDisplay)
        //    return;

        // textDisplay.scrollToRange(anchorPosition, activePosition);
    }


Error:

D:\dev\royale-emulation-works\apache-royale-0.9.4-bin-js-swf\royale-asjs\frameworks\projects\SparkRoyale\src\main\royale\spark\components\TextArea.as(753):
col: 80 Parameter initializer unknown or is not a compile-time constant. An
initial value of undefined will be used instead.

    public function scrollToRange(anchorPosition:int = 0,
activePosition:int = int.MAX_VALUE):void



When change as below, compiles correctly.

    public function scrollToRange(anchorPosition:int = 0,
activePosition:int = 0/*int.MAX_VALUE*/):void
    {
        var activePosition1:int = int.MAX_VALUE;
        // if (!textDisplay)
        //    return;

        // textDisplay.scrollToRange(anchorPosition, activePosition);
    }


Can we say that int.MAX_VALUE usage in function signature not allowed ?

Thanks
Serkan

Re: int.MAX_VALUE in function list

Posted by Serkan Taş <se...@likyateknoloji.com>.
Thanks Alex,

Serkan.

20.10.2018 00:09 tarihinde Alex Harui yazdı:
>
> Hi Serkan,
>
> The nightly builds are managed on this server: 
> http://apacheroyaleci.westus2.cloudapp.azure.com:8080 
> <http://apacheroyaleci.westus2.cloudapp.azure.com:8080>
>
> You can track the builds and see what changes have been built.  From 
> that website, the compiler and typedefs were built more than 8 hours 
> ago in the correct order, and asjs was built after that so yes, that 
> nightly should contain these changes.
>
> Thanks,
>
> -Alex
>
> *From: *Serkan Taş <se...@likyateknoloji.com>
> *Reply-To: *"users@royale.apache.org" <us...@royale.apache.org>
> *Date: *Friday, October 19, 2018 at 12:46 PM
> *To: *"users@royale.apache.org" <us...@royale.apache.org>
> *Subject: *Re: int.MAX_VALUE in function list
>
> Hi Alex,
>
> Are your changes included in the nightly build ?
>
> Thanks
> Serkan
>
> 19.10.2018 09:48 tarihinde Alex Harui yazdı:
>
>     Turned out to be trickier than I thought.  Externs use @const for
>     both read-only as well as true constants.  There doesn’t seem to
>     be a way to distinguish one from the other.  Adding an initial
>     value causes it to not be picked up as an extern. The initial
>     value doesn’t really matter because the initial value should be
>     defined by the actual implementation the externs represent, but it
>     seemed like we should get the right values in the AS in case we
>     ever inline constants.  So I added a config entry to specify true
>     constants. Volunteers are needed to add more config entries for
>     other constants.  I just did uint and int to prove it works.
>
>     You will need the changes to royale-compiler as well as
>     royale-typedefs.
>
>     HTH,
>
>     -Alex
>
>     *From: *Alex Harui <ah...@adobe.com> <ma...@adobe.com>
>     *Reply-To: *"users@royale.apache.org"
>     <ma...@royale.apache.org> <us...@royale.apache.org>
>     <ma...@royale.apache.org>
>     *Date: *Thursday, October 18, 2018 at 5:51 PM
>     *To: *"users@royale.apache.org" <ma...@royale.apache.org>
>     <us...@royale.apache.org> <ma...@royale.apache.org>
>     *Subject: *Re: int.MAX_VALUE in function list
>
>     Looks like there is a bug in externc.  The missing.js specified
>     @const but the output is var not const.  I’ll try to take a few
>     minutes to see why.
>
>     -Alex
>
>     *From: *Alex Harui <ah...@adobe.com> <ma...@adobe.com>
>     *Reply-To: *"users@royale.apache.org"
>     <ma...@royale.apache.org> <us...@royale.apache.org>
>     <ma...@royale.apache.org>
>     *Date: *Thursday, October 18, 2018 at 5:35 PM
>     *To: *"users@royale.apache.org" <ma...@royale.apache.org>
>     <us...@royale.apache.org> <ma...@royale.apache.org>
>     *Subject: *Re: int.MAX_VALUE in function list
>
>     Well, we should probably tweak the compiler to get it to work.
>
>     -Alex
>
>     *From: *Serkan Taş <se...@likyateknoloji.com>
>     <ma...@likyateknoloji.com>
>     *Reply-To: *"users@royale.apache.org"
>     <ma...@royale.apache.org> <us...@royale.apache.org>
>     <ma...@royale.apache.org>
>     *Date: *Thursday, October 18, 2018 at 1:16 PM
>     *To: *"users@royale.apache.org" <ma...@royale.apache.org>
>     <us...@royale.apache.org> <ma...@royale.apache.org>
>     *Subject: *int.MAX_VALUE in function list
>
>     Hi,
>
>     When i am compiling class with method below i get compile error :
>
>     public function scrollToRange(anchorPosition:int = 0,
>     activePosition:int = int.MAX_VALUE):void
>         {
>             activePosition1:int = int.MAX_VALUE;
>             // if (!textDisplay)
>             //    return;
>
>             // textDisplay.scrollToRange(anchorPosition, activePosition);
>         }
>
>
>     Error:
>
>     D:\dev\royale-emulation-works\apache-royale-0.9.4-bin-js-swf\royale-asjs\frameworks\projects\SparkRoyale\src\main\royale\spark\components\TextArea.as(753):
>     col: 80 Parameter initializer unknown or is not a compile-time
>     constant. An initial value of undefined will be used instead.
>
>         public function scrollToRange(anchorPosition:int = 0,
>     activePosition:int = int.MAX_VALUE):void
>
>
>
>     When change as below, compiles correctly.
>
>     public function scrollToRange(anchorPosition:int = 0,
>     activePosition:int = 0/*int.MAX_VALUE*/):void
>         {
>             var activePosition1:int = int.MAX_VALUE;
>             // if (!textDisplay)
>             //    return;
>
>             // textDisplay.scrollToRange(anchorPosition, activePosition);
>         }
>
>
>     Can we say that int.MAX_VALUE usage in function signature not
>     allowed ?
>
>     Thanks
>     Serkan
>
>
>
>
>
>


Re: int.MAX_VALUE in function list

Posted by Alex Harui <ah...@adobe.com>.
Hi Serkan,

The nightly builds are managed on this server: http://apacheroyaleci.westus2.cloudapp.azure.com:8080

You can track the builds and see what changes have been built.  From that website, the compiler and typedefs were built more than 8 hours ago in the correct order, and asjs was built after that so yes, that nightly should contain these changes.

Thanks,
-Alex

From: Serkan Taş <se...@likyateknoloji.com>
Reply-To: "users@royale.apache.org" <us...@royale.apache.org>
Date: Friday, October 19, 2018 at 12:46 PM
To: "users@royale.apache.org" <us...@royale.apache.org>
Subject: Re: int.MAX_VALUE in function list

Hi Alex,

Are your changes included in the nightly build ?

Thanks
Serkan
19.10.2018 09:48 tarihinde Alex Harui yazdı:
Turned out to be trickier than I thought.  Externs use @const for both read-only as well as true constants.  There doesn’t seem to be a way to distinguish one from the other.  Adding an initial value causes it to not be picked up as an extern.  The initial value doesn’t really matter because the initial value should be defined by the actual implementation the externs represent, but it seemed like we should get the right values in the AS in case we ever inline constants.  So I added a config entry to specify true constants.  Volunteers are needed to add more config entries for other constants.  I just did uint and int to prove it works.

You will need the changes to royale-compiler as well as royale-typedefs.

HTH,
-Alex

From: Alex Harui <ah...@adobe.com>
Reply-To: "users@royale.apache.org"<ma...@royale.apache.org> <us...@royale.apache.org>
Date: Thursday, October 18, 2018 at 5:51 PM
To: "users@royale.apache.org"<ma...@royale.apache.org> <us...@royale.apache.org>
Subject: Re: int.MAX_VALUE in function list

Looks like there is a bug in externc.  The missing.js specified @const but the output is var not const.  I’ll try to take a few minutes to see why.

-Alex

From: Alex Harui <ah...@adobe.com>
Reply-To: "users@royale.apache.org"<ma...@royale.apache.org> <us...@royale.apache.org>
Date: Thursday, October 18, 2018 at 5:35 PM
To: "users@royale.apache.org"<ma...@royale.apache.org> <us...@royale.apache.org>
Subject: Re: int.MAX_VALUE in function list

Well, we should probably tweak the compiler to get it to work.

-Alex

From: Serkan Taş <se...@likyateknoloji.com>
Reply-To: "users@royale.apache.org"<ma...@royale.apache.org> <us...@royale.apache.org>
Date: Thursday, October 18, 2018 at 1:16 PM
To: "users@royale.apache.org"<ma...@royale.apache.org> <us...@royale.apache.org>
Subject: int.MAX_VALUE in function list

Hi,

When i am compiling class with method below i get compile error :

    public function scrollToRange(anchorPosition:int = 0, activePosition:int = int.MAX_VALUE):void
    {
        activePosition1:int = int.MAX_VALUE;
        // if (!textDisplay)
        //    return;

        // textDisplay.scrollToRange(anchorPosition, activePosition);
    }


Error:

D:\dev\royale-emulation-works\apache-royale-0.9.4-bin-js-swf\royale-asjs\frameworks\projects\SparkRoyale\src\main\royale\spark\components\TextArea.as(753): col: 80 Parameter initializer unknown or is not a compile-time constant. An initial value of undefined will be used instead.

    public function scrollToRange(anchorPosition:int = 0, activePosition:int = int.MAX_VALUE):void



When change as below, compiles correctly.

    public function scrollToRange(anchorPosition:int = 0, activePosition:int = 0/*int.MAX_VALUE*/):void
    {
        var activePosition1:int = int.MAX_VALUE;
        // if (!textDisplay)
        //    return;

        // textDisplay.scrollToRange(anchorPosition, activePosition);
    }


Can we say that int.MAX_VALUE usage in function signature not allowed ?

Thanks
Serkan







Re: int.MAX_VALUE in function list

Posted by Serkan Taş <se...@likyateknoloji.com>.
Hi Alex,

Are your changes included in the nightly build ?

Thanks
Serkan

19.10.2018 09:48 tarihinde Alex Harui yazdı:
>
> Turned out to be trickier than I thought. Externs use @const for both 
> read-only as well as true constants.  There doesn’t seem to be a way 
> to distinguish one from the other.  Adding an initial value causes it 
> to not be picked up as an extern.  The initial value doesn’t really 
> matter because the initial value should be defined by the actual 
> implementation the externs represent, but it seemed like we should get 
> the right values in the AS in case we ever inline constants.  So I 
> added a config entry to specify true constants.  Volunteers are needed 
> to add more config entries for other constants.  I just did uint and 
> int to prove it works.
>
> You will need the changes to royale-compiler as well as royale-typedefs.
>
> HTH,
>
> -Alex
>
> *From: *Alex Harui <ah...@adobe.com>
> *Reply-To: *"users@royale.apache.org" <us...@royale.apache.org>
> *Date: *Thursday, October 18, 2018 at 5:51 PM
> *To: *"users@royale.apache.org" <us...@royale.apache.org>
> *Subject: *Re: int.MAX_VALUE in function list
>
> Looks like there is a bug in externc.  The missing.js specified @const 
> but the output is var not const.  I’ll try to take a few minutes to 
> see why.
>
> -Alex
>
> *From: *Alex Harui <ah...@adobe.com>
> *Reply-To: *"users@royale.apache.org" <us...@royale.apache.org>
> *Date: *Thursday, October 18, 2018 at 5:35 PM
> *To: *"users@royale.apache.org" <us...@royale.apache.org>
> *Subject: *Re: int.MAX_VALUE in function list
>
> Well, we should probably tweak the compiler to get it to work.
>
> -Alex
>
> *From: *Serkan Taş <se...@likyateknoloji.com>
> *Reply-To: *"users@royale.apache.org" <us...@royale.apache.org>
> *Date: *Thursday, October 18, 2018 at 1:16 PM
> *To: *"users@royale.apache.org" <us...@royale.apache.org>
> *Subject: *int.MAX_VALUE in function list
>
> Hi,
>
> When i am compiling class with method below i get compile error :
>
>     public function scrollToRange(anchorPosition:int = 0, 
> activePosition:int = int.MAX_VALUE):void
>     {
>         activePosition1:int = int.MAX_VALUE;
>         // if (!textDisplay)
>         //    return;
>
>         // textDisplay.scrollToRange(anchorPosition, activePosition);
>     }
>
>
> Error:
>
> D:\dev\royale-emulation-works\apache-royale-0.9.4-bin-js-swf\royale-asjs\frameworks\projects\SparkRoyale\src\main\royale\spark\components\TextArea.as(753): 
> col: 80 Parameter initializer unknown or is not a compile-time 
> constant. An initial value of undefined will be used instead.
>
>     public function scrollToRange(anchorPosition:int = 0, 
> activePosition:int = int.MAX_VALUE):void
>
>
>
> When change as below, compiles correctly.
>
>     public function scrollToRange(anchorPosition:int = 0, 
> activePosition:int = 0/*int.MAX_VALUE*/):void
>     {
>         var activePosition1:int = int.MAX_VALUE;
>         // if (!textDisplay)
>         //    return;
>
>         // textDisplay.scrollToRange(anchorPosition, activePosition);
>     }
>
>
> Can we say that int.MAX_VALUE usage in function signature not allowed ?
>
> Thanks
> Serkan
>
>
>


Re: int.MAX_VALUE in function list

Posted by Alex Harui <ah...@adobe.com>.
Turned out to be trickier than I thought.  Externs use @const for both read-only as well as true constants.  There doesn’t seem to be a way to distinguish one from the other.  Adding an initial value causes it to not be picked up as an extern.  The initial value doesn’t really matter because the initial value should be defined by the actual implementation the externs represent, but it seemed like we should get the right values in the AS in case we ever inline constants.  So I added a config entry to specify true constants.  Volunteers are needed to add more config entries for other constants.  I just did uint and int to prove it works.

You will need the changes to royale-compiler as well as royale-typedefs.

HTH,
-Alex

From: Alex Harui <ah...@adobe.com>
Reply-To: "users@royale.apache.org" <us...@royale.apache.org>
Date: Thursday, October 18, 2018 at 5:51 PM
To: "users@royale.apache.org" <us...@royale.apache.org>
Subject: Re: int.MAX_VALUE in function list

Looks like there is a bug in externc.  The missing.js specified @const but the output is var not const.  I’ll try to take a few minutes to see why.

-Alex

From: Alex Harui <ah...@adobe.com>
Reply-To: "users@royale.apache.org" <us...@royale.apache.org>
Date: Thursday, October 18, 2018 at 5:35 PM
To: "users@royale.apache.org" <us...@royale.apache.org>
Subject: Re: int.MAX_VALUE in function list

Well, we should probably tweak the compiler to get it to work.

-Alex

From: Serkan Taş <se...@likyateknoloji.com>
Reply-To: "users@royale.apache.org" <us...@royale.apache.org>
Date: Thursday, October 18, 2018 at 1:16 PM
To: "users@royale.apache.org" <us...@royale.apache.org>
Subject: int.MAX_VALUE in function list

Hi,

When i am compiling class with method below i get compile error :

    public function scrollToRange(anchorPosition:int = 0, activePosition:int = int.MAX_VALUE):void
    {
        activePosition1:int = int.MAX_VALUE;
        // if (!textDisplay)
        //    return;

        // textDisplay.scrollToRange(anchorPosition, activePosition);
    }


Error:

D:\dev\royale-emulation-works\apache-royale-0.9.4-bin-js-swf\royale-asjs\frameworks\projects\SparkRoyale\src\main\royale\spark\components\TextArea.as(753): col: 80 Parameter initializer unknown or is not a compile-time constant. An initial value of undefined will be used instead.

    public function scrollToRange(anchorPosition:int = 0, activePosition:int = int.MAX_VALUE):void



When change as below, compiles correctly.

    public function scrollToRange(anchorPosition:int = 0, activePosition:int = 0/*int.MAX_VALUE*/):void
    {
        var activePosition1:int = int.MAX_VALUE;
        // if (!textDisplay)
        //    return;

        // textDisplay.scrollToRange(anchorPosition, activePosition);
    }


Can we say that int.MAX_VALUE usage in function signature not allowed ?

Thanks
Serkan




Re: int.MAX_VALUE in function list

Posted by Alex Harui <ah...@adobe.com>.
Looks like there is a bug in externc.  The missing.js specified @const but the output is var not const.  I’ll try to take a few minutes to see why.

-Alex

From: Alex Harui <ah...@adobe.com>
Reply-To: "users@royale.apache.org" <us...@royale.apache.org>
Date: Thursday, October 18, 2018 at 5:35 PM
To: "users@royale.apache.org" <us...@royale.apache.org>
Subject: Re: int.MAX_VALUE in function list

Well, we should probably tweak the compiler to get it to work.

-Alex

From: Serkan Taş <se...@likyateknoloji.com>
Reply-To: "users@royale.apache.org" <us...@royale.apache.org>
Date: Thursday, October 18, 2018 at 1:16 PM
To: "users@royale.apache.org" <us...@royale.apache.org>
Subject: int.MAX_VALUE in function list

Hi,

When i am compiling class with method below i get compile error :

    public function scrollToRange(anchorPosition:int = 0, activePosition:int = int.MAX_VALUE):void
    {
        activePosition1:int = int.MAX_VALUE;
        // if (!textDisplay)
        //    return;

        // textDisplay.scrollToRange(anchorPosition, activePosition);
    }


Error:

D:\dev\royale-emulation-works\apache-royale-0.9.4-bin-js-swf\royale-asjs\frameworks\projects\SparkRoyale\src\main\royale\spark\components\TextArea.as(753): col: 80 Parameter initializer unknown or is not a compile-time constant. An initial value of undefined will be used instead.

    public function scrollToRange(anchorPosition:int = 0, activePosition:int = int.MAX_VALUE):void



When change as below, compiles correctly.

    public function scrollToRange(anchorPosition:int = 0, activePosition:int = 0/*int.MAX_VALUE*/):void
    {
        var activePosition1:int = int.MAX_VALUE;
        // if (!textDisplay)
        //    return;

        // textDisplay.scrollToRange(anchorPosition, activePosition);
    }


Can we say that int.MAX_VALUE usage in function signature not allowed ?

Thanks
Serkan



Re: int.MAX_VALUE in function list

Posted by Alex Harui <ah...@adobe.com>.
Well, we should probably tweak the compiler to get it to work.

-Alex

From: Serkan Taş <se...@likyateknoloji.com>
Reply-To: "users@royale.apache.org" <us...@royale.apache.org>
Date: Thursday, October 18, 2018 at 1:16 PM
To: "users@royale.apache.org" <us...@royale.apache.org>
Subject: int.MAX_VALUE in function list

Hi,

When i am compiling class with method below i get compile error :

    public function scrollToRange(anchorPosition:int = 0, activePosition:int = int.MAX_VALUE):void
    {
        activePosition1:int = int.MAX_VALUE;
        // if (!textDisplay)
        //    return;

        // textDisplay.scrollToRange(anchorPosition, activePosition);
    }


Error:

D:\dev\royale-emulation-works\apache-royale-0.9.4-bin-js-swf\royale-asjs\frameworks\projects\SparkRoyale\src\main\royale\spark\components\TextArea.as(753): col: 80 Parameter initializer unknown or is not a compile-time constant. An initial value of undefined will be used instead.

    public function scrollToRange(anchorPosition:int = 0, activePosition:int = int.MAX_VALUE):void



When change as below, compiles correctly.

    public function scrollToRange(anchorPosition:int = 0, activePosition:int = 0/*int.MAX_VALUE*/):void
    {
        var activePosition1:int = int.MAX_VALUE;
        // if (!textDisplay)
        //    return;

        // textDisplay.scrollToRange(anchorPosition, activePosition);
    }


Can we say that int.MAX_VALUE usage in function signature not allowed ?

Thanks
Serkan