Build failed in Jenkins: royale-asjs #1447

2018-10-06 Thread apacheroyaleci
See 


--
[...truncated 988.00 KB...]
 [java] 
 [java] Oct 07, 2018 5:23:16 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [os]:112: WARNING - name module is not defined in the 
externs.
 [java] module.exports = os;
 [java] ^^
 [java] 
 [java] Oct 07, 2018 5:23:16 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [path]:97: WARNING - name module is not defined in the 
externs.
 [java] module.exports = path;
 [java] ^^
 [java] 
 [java] Oct 07, 2018 5:23:16 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [punycode]:74: WARNING - name module is not defined in the 
externs.
 [java] module.exports = punycode;
 [java] ^^
 [java] 
 [java] Oct 07, 2018 5:23:16 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [querystring]:66: WARNING - name module is not defined in 
the externs.
 [java] module.exports = querystring;
 [java] ^^
 [java] 
 [java] Oct 07, 2018 5:23:16 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [readline]:22: WARNING - accessing name require in externs 
has no effect. Perhaps you forgot to add a var keyword?
 [java] var events = require('events');
 [java]  ^^^
 [java] 
 [java] Oct 07, 2018 5:23:16 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [readline]:23: WARNING - accessing name require in externs 
has no effect. Perhaps you forgot to add a var keyword?
 [java] var stream = require('stream');
 [java]  ^^^
 [java] 
 [java] Oct 07, 2018 5:23:16 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [readline]:84: WARNING - name module is not defined in the 
externs.
 [java] module.exports = readline;
 [java] ^^
 [java] 
 [java] Oct 07, 2018 5:23:16 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [repl]:23: WARNING - accessing name require in externs has 
no effect. Perhaps you forgot to add a var keyword?
 [java] var events = require('events');
 [java]  ^^^
 [java] 
 [java] Oct 07, 2018 5:23:16 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [repl]:24: WARNING - accessing name require in externs has 
no effect. Perhaps you forgot to add a var keyword?
 [java] var stream = require('stream');
 [java]  ^^^
 [java] 
 [java] Oct 07, 2018 5:23:16 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [repl]:48: WARNING - name module is not defined in the 
externs.
 [java] module.exports = repl;
 [java] ^^
 [java] 
 [java] Oct 07, 2018 5:23:16 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [stream]:23: WARNING - accessing name require in externs 
has no effect. Perhaps you forgot to add a var keyword?
 [java] var events = require('events');
 [java]  ^^^
 [java] 
 [java] Oct 07, 2018 5:23:16 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [stream]:254: WARNING - name module is not defined in the 
externs.
 [java] module.exports = stream;
 [java] ^^
 [java] 
 [java] Oct 07, 2018 5:23:16 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [string_decoder]:52: WARNING - name module is not defined 
in the externs.
 [java] module.exports = StringDecoder;
 [java] ^^
 [java] 
 [java] Oct 07, 2018 5:23:16 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [tls]:23: WARNING - accessing name require in externs has 
no effect. Perhaps you forgot to add a var keyword?
 [java] var crypto = require('crypto');
 [java]  ^^^
 [java] 
 [java] Oct 07, 2018 5:23:16 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [tls]:24: WARNING - accessing name require in externs has 
no effect. Perhaps you forgot to add a var keyword?
 [java] var events = require('events');
 [java]  ^^^
 [java] 
 [java] Oct 07, 2018 5:23:16 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [tls]:25: WARNING - accessing name require in externs has 
no effect. Perhaps you forgot to add a var keyword?
 [java] var net = require('net');
 [java]   ^^^
 [java] 
 [java] Oct 07, 2018 5:23:16 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [tls]:26: WARNING - accessing name require in externs has 
no effect. Perhaps you forgot to add a var keyword?
 [java] var stream = require('stream');
 

Build failed in Jenkins: royale-asjs #1446

2018-10-06 Thread apacheroyaleci
See 


--
[...truncated 988.92 KB...]
 [java] 
 [java] Oct 07, 2018 3:58:46 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [os]:112: WARNING - name module is not defined in the 
externs.
 [java] module.exports = os;
 [java] ^^
 [java] 
 [java] Oct 07, 2018 3:58:46 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [path]:97: WARNING - name module is not defined in the 
externs.
 [java] module.exports = path;
 [java] ^^
 [java] 
 [java] Oct 07, 2018 3:58:46 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [punycode]:74: WARNING - name module is not defined in the 
externs.
 [java] module.exports = punycode;
 [java] ^^
 [java] 
 [java] Oct 07, 2018 3:58:46 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [querystring]:66: WARNING - name module is not defined in 
the externs.
 [java] module.exports = querystring;
 [java] ^^
 [java] 
 [java] Oct 07, 2018 3:58:46 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [readline]:22: WARNING - accessing name require in externs 
has no effect. Perhaps you forgot to add a var keyword?
 [java] var events = require('events');
 [java]  ^^^
 [java] 
 [java] Oct 07, 2018 3:58:46 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [readline]:23: WARNING - accessing name require in externs 
has no effect. Perhaps you forgot to add a var keyword?
 [java] var stream = require('stream');
 [java]  ^^^
 [java] 
 [java] Oct 07, 2018 3:58:46 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [readline]:84: WARNING - name module is not defined in the 
externs.
 [java] module.exports = readline;
 [java] ^^
 [java] 
 [java] Oct 07, 2018 3:58:46 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [repl]:23: WARNING - accessing name require in externs has 
no effect. Perhaps you forgot to add a var keyword?
 [java] var events = require('events');
 [java]  ^^^
 [java] 
 [java] Oct 07, 2018 3:58:46 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [repl]:24: WARNING - accessing name require in externs has 
no effect. Perhaps you forgot to add a var keyword?
 [java] var stream = require('stream');
 [java]  ^^^
 [java] 
 [java] Oct 07, 2018 3:58:46 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [repl]:48: WARNING - name module is not defined in the 
externs.
 [java] module.exports = repl;
 [java] ^^
 [java] 
 [java] Oct 07, 2018 3:58:46 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [stream]:23: WARNING - accessing name require in externs 
has no effect. Perhaps you forgot to add a var keyword?
 [java] var events = require('events');
 [java]  ^^^
 [java] 
 [java] Oct 07, 2018 3:58:46 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [stream]:254: WARNING - name module is not defined in the 
externs.
 [java] module.exports = stream;
 [java] ^^
 [java] 
 [java] Oct 07, 2018 3:58:46 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [string_decoder]:52: WARNING - name module is not defined 
in the externs.
 [java] module.exports = StringDecoder;
 [java] ^^
 [java] 
 [java] Oct 07, 2018 3:58:46 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [tls]:23: WARNING - accessing name require in externs has 
no effect. Perhaps you forgot to add a var keyword?
 [java] var crypto = require('crypto');
 [java]  ^^^
 [java] 
 [java] Oct 07, 2018 3:58:46 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [tls]:24: WARNING - accessing name require in externs has 
no effect. Perhaps you forgot to add a var keyword?
 [java] var events = require('events');
 [java]  ^^^
 [java] 
 [java] Oct 07, 2018 3:58:46 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [tls]:25: WARNING - accessing name require in externs has 
no effect. Perhaps you forgot to add a var keyword?
 [java] var net = require('net');
 [java]   ^^^
 [java] 
 [java] Oct 07, 2018 3:58:46 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [tls]:26: WARNING - accessing name require in externs has 
no effect. Perhaps you forgot to add a var keyword?
 [java] var stream = require('stream');
 

Re: Reflection TypeDefinition API gives unexpected results

2018-10-06 Thread Greg Dove
Hi Carlos,

There could still be bugs, but there are some unit tests. You might find
some useful reference in the unit tests :
https://github.com/apache/royale-asjs/blob/develop/manualtests/UnitTests/src/main/royale/flexUnitTests/reflection/ReflectionTesterTest.as

And some of the test classes used:
https://github.com/apache/royale-asjs/tree/develop/manualtests/UnitTests/src/main/royale/flexUnitTests/reflection/support

If there is a case not working, then the coverage would need to include
that. I can take a look at this in the coming week if you add a failing
case.

I can't recall offhand about whether consts (static or instance) were
included as part of the reflection data. But I can see at least one Test
Class that includes both static and instance consts, so the reflection data
should either intentionally include or exclude them - if the tests fail
then something may have changed.

In terms of EventDispatcher as base class, I did not check, but maybe this
class is bindable? In which case it will have EventDispatcher injected as a
base class by the compiler. Because the reflection data is collected from
the runtime inheritance chain in javascript, it should be related to
whatever the compiler provided as output code. This would apply in flash as
well as javascript, although flash would have more data below the Royale
EventDispatcher as the native classes are reflectable (not the case with
the google event base classes on the js side).

Hope there is something helpful there for now.

-Greg


On Sun, Oct 7, 2018 at 7:33 AM Carlos Rovira 
wrote:

> Hi,
>
> I'm trying to do some Reflection work and finding some unexpected results.
> Given this example class:
>
> package controllers
> {
> import interfaces.IController;
>
> import models.User;
>
> import services.UserService;
>
> public class UserController implements IController
> {
> public static const USER_CONTROLLER_EVENT:String = "userControllerEvent";
>
> /**
>  * Constructor
>  */
> public function UserController()
> {
> trace("UserController constructor");
> }
>
> private var _userService:UserService;
>
> [Inject]
> public function get userService():UserService
> {
> return _userService;
> }
> public function set userService(value:UserService):void
> {
> trace("setting userService: ", value);
> _userService = value;
> }
> [Bindable]
> public var currentUser:User;
> }
> }
>
> I want to retrieve, super class, interface, metadata, const and vars and
> methods, so I think I should use this:
>
> var typeDefinition:TypeDefinition = describeType(target);
>
> To see what this retrieves for this email the toString method is great:
>
> typeDefinition.toString(true);
>
> RESULT:
>
> *typeDefinition.toString  Typedefinition: controllers.UserController,
> kind:class*
> *constructor :*
> * method: 'UserController', returnType:''
> declaredBy:controllers.UserController*
> * {No parameters}*
> *interfaces :*
> * Typedefinition: interfaces.IController, kind:interface*
> * Typedefinition: org.apache.royale.events.IEventDispatcher,
> kind:interface. < this is unexpected*
> *baseClasses :*
> * Typedefinition: org.apache.royale.events.EventDispatcher, kind:class.
> **<
> this is unexpected*
> *variables :*
> * {none}*
> *accessors :*
> * accessor: 'currentUser' access:readwrite, type:models.User,
> declaredBy:controllers.UserController*
> * accessor: 'userService' access:readwrite, type:services.UserService,
> declaredBy:controllers.UserController*
> *methods :*
> * method: 'hasEventListener', returnType:Boolean
> declaredBy:org.apache.royale.events.EventDispatcher.  **< this is
> unexpected (but normal due to EventDispatcher listed as base class*
> * parameter 1, optional:false, type:String*
> * method: 'dispatchEvent', returnType:Boolean
> declaredBy:org.apache.royale.events.EventDispatcher.  * *< this is
> unexpected (but normal due to EventDispatcher listed as base class*
> * parameter 1, optional:false, type:Object*
> * method: 'toString', returnType:String
> declaredBy:org.apache.royale.events.EventDispatcher * *< this is
> unexpected (but normal due to EventDispatcher listed as base class*
> * {No parameters}*
> *static variables :*
> * {none} *  *< this is unexpected where is *USER_CONTROLLER_EVENT*?*
> *static accessors :*
> * {none}*
> *static methods :*
> * {none}*
>
> As I stated in other email, the most annoying thing is the
> *EventDispatcher*
> and *methods* listed as super class of this class...
> the other is no *static var* listed
>
> One thing I need most is to retrieve new *Metadata* I want to insert, I'm
> taking about the [Inject] metadata, I put [Bindable] as well since is
> already used, but I don't see any signals of any one of them
>
> I must say that I have in config/compile-swf-config.xml this code:
>
> 
> Bindable
> ...
> ...
> Inject
> 
>
> and building with maven
>
> Is this a bug, or maybe this API is unfinished ? or maybe I'm missing
> something ?
>
> Thanks
>
>
> --
> Carlos Rovira
> 

Reflection TypeDefinition API gives unexpected results

2018-10-06 Thread Carlos Rovira
Hi,

I'm trying to do some Reflection work and finding some unexpected results.
Given this example class:

package controllers
{
import interfaces.IController;

import models.User;

import services.UserService;

public class UserController implements IController
{
public static const USER_CONTROLLER_EVENT:String = "userControllerEvent";

/**
 * Constructor
 */
public function UserController()
{
trace("UserController constructor");
}

private var _userService:UserService;

[Inject]
public function get userService():UserService
{
return _userService;
}
public function set userService(value:UserService):void
{
trace("setting userService: ", value);
_userService = value;
}
[Bindable]
public var currentUser:User;
}
}

I want to retrieve, super class, interface, metadata, const and vars and
methods, so I think I should use this:

var typeDefinition:TypeDefinition = describeType(target);

To see what this retrieves for this email the toString method is great:

typeDefinition.toString(true);

RESULT:

*typeDefinition.toString  Typedefinition: controllers.UserController,
kind:class*
*constructor :*
* method: 'UserController', returnType:''
declaredBy:controllers.UserController*
* {No parameters}*
*interfaces :*
* Typedefinition: interfaces.IController, kind:interface*
* Typedefinition: org.apache.royale.events.IEventDispatcher,
kind:interface. < this is unexpected*
*baseClasses :*
* Typedefinition: org.apache.royale.events.EventDispatcher, kind:class. **<
this is unexpected*
*variables :*
* {none}*
*accessors :*
* accessor: 'currentUser' access:readwrite, type:models.User,
declaredBy:controllers.UserController*
* accessor: 'userService' access:readwrite, type:services.UserService,
declaredBy:controllers.UserController*
*methods :*
* method: 'hasEventListener', returnType:Boolean
declaredBy:org.apache.royale.events.EventDispatcher.  **< this is
unexpected (but normal due to EventDispatcher listed as base class*
* parameter 1, optional:false, type:String*
* method: 'dispatchEvent', returnType:Boolean
declaredBy:org.apache.royale.events.EventDispatcher.  * *< this is
unexpected (but normal due to EventDispatcher listed as base class*
* parameter 1, optional:false, type:Object*
* method: 'toString', returnType:String
declaredBy:org.apache.royale.events.EventDispatcher * *< this is
unexpected (but normal due to EventDispatcher listed as base class*
* {No parameters}*
*static variables :*
* {none} *  *< this is unexpected where is *USER_CONTROLLER_EVENT*?*
*static accessors :*
* {none}*
*static methods :*
* {none}*

As I stated in other email, the most annoying thing is the *EventDispatcher*
and *methods* listed as super class of this class...
the other is no *static var* listed

One thing I need most is to retrieve new *Metadata* I want to insert, I'm
taking about the [Inject] metadata, I put [Bindable] as well since is
already used, but I don't see any signals of any one of them

I must say that I have in config/compile-swf-config.xml this code:


Bindable
...
...
Inject


and building with maven

Is this a bug, or maybe this API is unfinished ? or maybe I'm missing
something ?

Thanks


-- 
Carlos Rovira
http://about.me/carlosrovira


Re: Check is something is Class or instance in Royale

2018-10-06 Thread Carlos Rovira
Hi Piotr,

I think the problem is more about what to do with "Class" since is valid in
AS3 and we need proper transpiler to SWF, JS...
Right now in JS Class is not know

[Error] ReferenceError: Can't find variable: Class=

As I posted in the first email, I can workaround with

typeof myFunc === 'function'

I think this could work for both cases, or maybe the solution you posted (I
didn't try it)

But the use case comes from trying to compile an existing Flex AS3 library
with Royale, so we'll find "Class" keyword many times out there, so I think
is worth it trying to solve at compiler/Language level.

Thanks Piotr for the suggestion

Carlos



El sáb., 6 oct. 2018 a las 15:49, Piotr Zarzycki ()
escribió:

> In the other words you are interested whether there is an object not a
> simple type? That's what I mean.
>
> Why not if (are[0] is object) - does it not cover all of the cases?
>
>
> On Sat, Oct 6, 2018, 2:48 PM Carlos Rovira 
> wrote:
>
> > No, arr[0] has an instance of a custom typed object.
> >
> > El sáb., 6 oct. 2018 a las 10:58, Piotr Zarzycki (<
> > piotrzarzyck...@gmail.com>)
> > escribió:
> >
> > > Hi Carlos,
> > >
> > > Are you trying to distinguish something from simple type by that
> > if(arr[0]
> > > is Class) ? By simple type I mean String, Boolean?
> > >
> > > Piotr
> > >
> > > On Sat, Oct 6, 2018, 10:54 AM Carlos Rovira 
> > > wrote:
> > >
> > > > Hi Alex,
> > > >
> > > > I'm very new to Language.as, so I'll try to do my best.
> > > >
> > > > I'm trying to add to Language.as "is" function this:
> > > >
> > > > if(rightOperand === Class) {
> > > > return typeof leftOperand === 'function';
> > > > }
> > > >
> > > > the test case is :
> > > >
> > > > var arr:Array = [main]; //main is a container declared in MXML, so is
> > not
> > > > class is an instance
> > > > if(arr[0] is Class)
> > > > {
> > > > trace("is Class");
> > > > } else
> > > > {
> > > > trace("is NOT Class"); // I expect to get this trace
> > > > }
> > > >
> > > > but browser reports:
> > > >
> > > > [Error] ReferenceError: Can't find variable: Class is
> (Language.js:147)
> > > >
> > > > So first point to solve is how to deal with "Class", since is not
> > > > recognized at javascript level. Seems to me that "Class" should be
> > solved
> > > > at compiler level?
> > > >
> > > > Thanks
> > > >
> > > >
> > > > El vie., 5 oct. 2018 a las 23:11, Alex Harui
> ( > > >)
> > > > escribió:
> > > >
> > > > > Hi Carlos,
> > > > >
> > > > > Use of "is" is transpiled into a call to Language.is.  I think
> > > > Language.is
> > > > > should special case the test for Class.  Try updating Language.is
> and
> > > see
> > > > > if that is what you need.
> > > > >
> > > > > -Alex
> > > > >
> > > > > On 10/5/18, 11:13 AM, "Carlos Rovira" 
> > > wrote:
> > > > >
> > > > > Hi,
> > > > >
> > > > > in js, check if something is a class or is an instance is like
> > this
> > > > [1]
> > > > >
> > > > > typeof myFunc === 'function'
> > > > >
> > > > > In Royale since we are using AS3, doing
> > > > >
> > > > > if(something is Class)
> > > > > do this
> > > > > else
> > > > >do that
> > > > >
> > > > > should work either for SWF and for JS, but seems is not the
> case.
> > > > > I must make two codes COMPILE::SWF (with "is Class") and
> > > COMPILE::JS
> > > > > (with
> > > > > typeof ... ==='function')
> > > > >
> > > > > Could we have this abstracted by compiler?
> > > > >
> > > > > Thanks
> > > > >
> > > > > [1]
> > > > >
> > > > >
> > > >
> > >
> >
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F405164%2Fbest-method-of-testing-for-a-function-in-javascriptdata=02%7C01%7Caharui%40adobe.com%7Ca4d898cf20fe4f072a9008d62aee4d24%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636743600312034959sdata=fdiolpGWQJihoZw2PfYLmoyckh1mDiynH8EbJXYIeog%3Dreserved=0
> > > > >
> > > > > --
> > > > > Carlos Rovira
> > > > >
> > > > >
> > > >
> > >
> >
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosroviradata=02%7C01%7Caharui%40adobe.com%7Ca4d898cf20fe4f072a9008d62aee4d24%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636743600312034959sdata=bwLXrUQ6N4syATPB8iEXL%2BnFZPQl9xhIndqwNbCShCo%3Dreserved=0
> > > > >
> > > > >
> > > > >
> > > >
> > > > --
> > > > Carlos Rovira
> > > > http://about.me/carlosrovira
> > > >
> > >
> >
> >
> > --
> > Carlos Rovira
> > http://about.me/carlosrovira
> >
>


-- 
Carlos Rovira
http://about.me/carlosrovira


Re: Check is something is Class or instance in Royale

2018-10-06 Thread Piotr Zarzycki
In the other words you are interested whether there is an object not a
simple type? That's what I mean.

Why not if (are[0] is object) - does it not cover all of the cases?


On Sat, Oct 6, 2018, 2:48 PM Carlos Rovira  wrote:

> No, arr[0] has an instance of a custom typed object.
>
> El sáb., 6 oct. 2018 a las 10:58, Piotr Zarzycki (<
> piotrzarzyck...@gmail.com>)
> escribió:
>
> > Hi Carlos,
> >
> > Are you trying to distinguish something from simple type by that
> if(arr[0]
> > is Class) ? By simple type I mean String, Boolean?
> >
> > Piotr
> >
> > On Sat, Oct 6, 2018, 10:54 AM Carlos Rovira 
> > wrote:
> >
> > > Hi Alex,
> > >
> > > I'm very new to Language.as, so I'll try to do my best.
> > >
> > > I'm trying to add to Language.as "is" function this:
> > >
> > > if(rightOperand === Class) {
> > > return typeof leftOperand === 'function';
> > > }
> > >
> > > the test case is :
> > >
> > > var arr:Array = [main]; //main is a container declared in MXML, so is
> not
> > > class is an instance
> > > if(arr[0] is Class)
> > > {
> > > trace("is Class");
> > > } else
> > > {
> > > trace("is NOT Class"); // I expect to get this trace
> > > }
> > >
> > > but browser reports:
> > >
> > > [Error] ReferenceError: Can't find variable: Class is (Language.js:147)
> > >
> > > So first point to solve is how to deal with "Class", since is not
> > > recognized at javascript level. Seems to me that "Class" should be
> solved
> > > at compiler level?
> > >
> > > Thanks
> > >
> > >
> > > El vie., 5 oct. 2018 a las 23:11, Alex Harui ( > >)
> > > escribió:
> > >
> > > > Hi Carlos,
> > > >
> > > > Use of "is" is transpiled into a call to Language.is.  I think
> > > Language.is
> > > > should special case the test for Class.  Try updating Language.is and
> > see
> > > > if that is what you need.
> > > >
> > > > -Alex
> > > >
> > > > On 10/5/18, 11:13 AM, "Carlos Rovira" 
> > wrote:
> > > >
> > > > Hi,
> > > >
> > > > in js, check if something is a class or is an instance is like
> this
> > > [1]
> > > >
> > > > typeof myFunc === 'function'
> > > >
> > > > In Royale since we are using AS3, doing
> > > >
> > > > if(something is Class)
> > > > do this
> > > > else
> > > >do that
> > > >
> > > > should work either for SWF and for JS, but seems is not the case.
> > > > I must make two codes COMPILE::SWF (with "is Class") and
> > COMPILE::JS
> > > > (with
> > > > typeof ... ==='function')
> > > >
> > > > Could we have this abstracted by compiler?
> > > >
> > > > Thanks
> > > >
> > > > [1]
> > > >
> > > >
> > >
> >
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F405164%2Fbest-method-of-testing-for-a-function-in-javascriptdata=02%7C01%7Caharui%40adobe.com%7Ca4d898cf20fe4f072a9008d62aee4d24%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636743600312034959sdata=fdiolpGWQJihoZw2PfYLmoyckh1mDiynH8EbJXYIeog%3Dreserved=0
> > > >
> > > > --
> > > > Carlos Rovira
> > > >
> > > >
> > >
> >
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosroviradata=02%7C01%7Caharui%40adobe.com%7Ca4d898cf20fe4f072a9008d62aee4d24%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636743600312034959sdata=bwLXrUQ6N4syATPB8iEXL%2BnFZPQl9xhIndqwNbCShCo%3Dreserved=0
> > > >
> > > >
> > > >
> > >
> > > --
> > > Carlos Rovira
> > > http://about.me/carlosrovira
> > >
> >
>
>
> --
> Carlos Rovira
> http://about.me/carlosrovira
>


Class that doesn't extend nothing reports extends EventDispatcher

2018-10-06 Thread Carlos Rovira
Hi,

I have a simple class

public class UserController implements IController
{
...
}

at runtime doing a trace in the browser reports and object that has

Prototype of UserController (that's ok for me)
 - Prototype of EventDispatcher (this is what I don't  understand why,
since the class does no extends EventDispatcher)

this has some explanation or maybe this is a bug?

thanks

-- 
Carlos Rovira
http://about.me/carlosrovira


Re: Check is something is Class or instance in Royale

2018-10-06 Thread Carlos Rovira
No, arr[0] has an instance of a custom typed object.

El sáb., 6 oct. 2018 a las 10:58, Piotr Zarzycki ()
escribió:

> Hi Carlos,
>
> Are you trying to distinguish something from simple type by that if(arr[0]
> is Class) ? By simple type I mean String, Boolean?
>
> Piotr
>
> On Sat, Oct 6, 2018, 10:54 AM Carlos Rovira 
> wrote:
>
> > Hi Alex,
> >
> > I'm very new to Language.as, so I'll try to do my best.
> >
> > I'm trying to add to Language.as "is" function this:
> >
> > if(rightOperand === Class) {
> > return typeof leftOperand === 'function';
> > }
> >
> > the test case is :
> >
> > var arr:Array = [main]; //main is a container declared in MXML, so is not
> > class is an instance
> > if(arr[0] is Class)
> > {
> > trace("is Class");
> > } else
> > {
> > trace("is NOT Class"); // I expect to get this trace
> > }
> >
> > but browser reports:
> >
> > [Error] ReferenceError: Can't find variable: Class is (Language.js:147)
> >
> > So first point to solve is how to deal with "Class", since is not
> > recognized at javascript level. Seems to me that "Class" should be solved
> > at compiler level?
> >
> > Thanks
> >
> >
> > El vie., 5 oct. 2018 a las 23:11, Alex Harui ( >)
> > escribió:
> >
> > > Hi Carlos,
> > >
> > > Use of "is" is transpiled into a call to Language.is.  I think
> > Language.is
> > > should special case the test for Class.  Try updating Language.is and
> see
> > > if that is what you need.
> > >
> > > -Alex
> > >
> > > On 10/5/18, 11:13 AM, "Carlos Rovira" 
> wrote:
> > >
> > > Hi,
> > >
> > > in js, check if something is a class or is an instance is like this
> > [1]
> > >
> > > typeof myFunc === 'function'
> > >
> > > In Royale since we are using AS3, doing
> > >
> > > if(something is Class)
> > > do this
> > > else
> > >do that
> > >
> > > should work either for SWF and for JS, but seems is not the case.
> > > I must make two codes COMPILE::SWF (with "is Class") and
> COMPILE::JS
> > > (with
> > > typeof ... ==='function')
> > >
> > > Could we have this abstracted by compiler?
> > >
> > > Thanks
> > >
> > > [1]
> > >
> > >
> >
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F405164%2Fbest-method-of-testing-for-a-function-in-javascriptdata=02%7C01%7Caharui%40adobe.com%7Ca4d898cf20fe4f072a9008d62aee4d24%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636743600312034959sdata=fdiolpGWQJihoZw2PfYLmoyckh1mDiynH8EbJXYIeog%3Dreserved=0
> > >
> > > --
> > > Carlos Rovira
> > >
> > >
> >
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosroviradata=02%7C01%7Caharui%40adobe.com%7Ca4d898cf20fe4f072a9008d62aee4d24%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636743600312034959sdata=bwLXrUQ6N4syATPB8iEXL%2BnFZPQl9xhIndqwNbCShCo%3Dreserved=0
> > >
> > >
> > >
> >
> > --
> > Carlos Rovira
> > http://about.me/carlosrovira
> >
>


-- 
Carlos Rovira
http://about.me/carlosrovira


Re: Check is something is Class or instance in Royale

2018-10-06 Thread Piotr Zarzycki
Hi Carlos,

Are you trying to distinguish something from simple type by that if(arr[0]
is Class) ? By simple type I mean String, Boolean?

Piotr

On Sat, Oct 6, 2018, 10:54 AM Carlos Rovira  wrote:

> Hi Alex,
>
> I'm very new to Language.as, so I'll try to do my best.
>
> I'm trying to add to Language.as "is" function this:
>
> if(rightOperand === Class) {
> return typeof leftOperand === 'function';
> }
>
> the test case is :
>
> var arr:Array = [main]; //main is a container declared in MXML, so is not
> class is an instance
> if(arr[0] is Class)
> {
> trace("is Class");
> } else
> {
> trace("is NOT Class"); // I expect to get this trace
> }
>
> but browser reports:
>
> [Error] ReferenceError: Can't find variable: Class is (Language.js:147)
>
> So first point to solve is how to deal with "Class", since is not
> recognized at javascript level. Seems to me that "Class" should be solved
> at compiler level?
>
> Thanks
>
>
> El vie., 5 oct. 2018 a las 23:11, Alex Harui ()
> escribió:
>
> > Hi Carlos,
> >
> > Use of "is" is transpiled into a call to Language.is.  I think
> Language.is
> > should special case the test for Class.  Try updating Language.is and see
> > if that is what you need.
> >
> > -Alex
> >
> > On 10/5/18, 11:13 AM, "Carlos Rovira"  wrote:
> >
> > Hi,
> >
> > in js, check if something is a class or is an instance is like this
> [1]
> >
> > typeof myFunc === 'function'
> >
> > In Royale since we are using AS3, doing
> >
> > if(something is Class)
> > do this
> > else
> >do that
> >
> > should work either for SWF and for JS, but seems is not the case.
> > I must make two codes COMPILE::SWF (with "is Class") and COMPILE::JS
> > (with
> > typeof ... ==='function')
> >
> > Could we have this abstracted by compiler?
> >
> > Thanks
> >
> > [1]
> >
> >
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F405164%2Fbest-method-of-testing-for-a-function-in-javascriptdata=02%7C01%7Caharui%40adobe.com%7Ca4d898cf20fe4f072a9008d62aee4d24%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636743600312034959sdata=fdiolpGWQJihoZw2PfYLmoyckh1mDiynH8EbJXYIeog%3Dreserved=0
> >
> > --
> > Carlos Rovira
> >
> >
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosroviradata=02%7C01%7Caharui%40adobe.com%7Ca4d898cf20fe4f072a9008d62aee4d24%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636743600312034959sdata=bwLXrUQ6N4syATPB8iEXL%2BnFZPQl9xhIndqwNbCShCo%3Dreserved=0
> >
> >
> >
>
> --
> Carlos Rovira
> http://about.me/carlosrovira
>


Re: Check is something is Class or instance in Royale

2018-10-06 Thread Carlos Rovira
Hi Alex,

I'm very new to Language.as, so I'll try to do my best.

I'm trying to add to Language.as "is" function this:

if(rightOperand === Class) {
return typeof leftOperand === 'function';
}

the test case is :

var arr:Array = [main]; //main is a container declared in MXML, so is not
class is an instance
if(arr[0] is Class)
{
trace("is Class");
} else
{
trace("is NOT Class"); // I expect to get this trace
}

but browser reports:

[Error] ReferenceError: Can't find variable: Class is (Language.js:147)

So first point to solve is how to deal with "Class", since is not
recognized at javascript level. Seems to me that "Class" should be solved
at compiler level?

Thanks


El vie., 5 oct. 2018 a las 23:11, Alex Harui ()
escribió:

> Hi Carlos,
>
> Use of "is" is transpiled into a call to Language.is.  I think Language.is
> should special case the test for Class.  Try updating Language.is and see
> if that is what you need.
>
> -Alex
>
> On 10/5/18, 11:13 AM, "Carlos Rovira"  wrote:
>
> Hi,
>
> in js, check if something is a class or is an instance is like this [1]
>
> typeof myFunc === 'function'
>
> In Royale since we are using AS3, doing
>
> if(something is Class)
> do this
> else
>do that
>
> should work either for SWF and for JS, but seems is not the case.
> I must make two codes COMPILE::SWF (with "is Class") and COMPILE::JS
> (with
> typeof ... ==='function')
>
> Could we have this abstracted by compiler?
>
> Thanks
>
> [1]
>
> https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstackoverflow.com%2Fquestions%2F405164%2Fbest-method-of-testing-for-a-function-in-javascriptdata=02%7C01%7Caharui%40adobe.com%7Ca4d898cf20fe4f072a9008d62aee4d24%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636743600312034959sdata=fdiolpGWQJihoZw2PfYLmoyckh1mDiynH8EbJXYIeog%3Dreserved=0
>
> --
> Carlos Rovira
>
> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosroviradata=02%7C01%7Caharui%40adobe.com%7Ca4d898cf20fe4f072a9008d62aee4d24%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636743600312034959sdata=bwLXrUQ6N4syATPB8iEXL%2BnFZPQl9xhIndqwNbCShCo%3Dreserved=0
>
>
>

-- 
Carlos Rovira
http://about.me/carlosrovira


Re: NextGenAS tutorials on Royale website

2018-10-06 Thread Carlos Rovira
Hi Josh,

many thanks for your email, very important to avoid put time where is not
worth it invest.




El sáb., 6 oct. 2018 a las 2:10, Josh Tynjala ()
escribió:

> dts2as hasn't been updated with any syntax changes since TypeScript 2.4.1.
> There were still edge cases where it failed too. It probably won't be very
> compatible with modern type definitions.
>
> Keeping dts2as up to date with changes to TypeScript was a major pain. It
> wouldn't have been so bad if type definitions were kept pretty simple, but
> I found that the TypeScript community very quickly embraced new language
> features in their type definitions, and this caused dts2as to break
> frequently.
>
> In short, I wouldn't recommend anyone try to do use or update dts2as
> (unless you have a lot of time and patience to dedicate to the process).
>
> On the other hand, I wouldn't expect to see the format of Closure
> Compiler's externs changing very much going forward. Embracing externc
> seems like a better way to go for making type definitions for third-party
> libraries in Royale. It doesn't have a major community-driven repository of
> common libraries, like DefinitelyTyped exists for TypeScript, but that
> doesn't meant that someone in the Royale community couldn't get the
> momentum started.
>
> - Josh
>
> On 2018/10/04 09:13:54, Carlos Rovira  wrote:
> > Hi Harbs,
> >
> > El mié., 3 oct. 2018 a las 11:54, Harbs ()
> escribió:
> >
> > > I agree that it would be great to make it easier to use Node. There are
> > > some sticking points currently. To answer your points:
> > >
> > > 1. Yes. It’s kind of similar in that it declares dependencies and
> > > optionally build tasks. Although there’s not necessarily a build step
> at
> > > all in Node.js. It’s worth pointing out that there are some new
> > > developments on the Node dependency front (besides Yarn and Turbo).[1]
> > >
> > >
> > thanks, that's what I expected
> >
> >
> >
> > > 2a) This is a problem. You’d either used untyped variables or create
> > > Typedefs. I’d really like to get support for Typescript definition
> files
> > > directly some day. Most popular nom packages have Typescript definition
> > > files.
> > >
> >
> > So maybe the solution would be the use dts2as:
> >
> > https://joshblog.net/2015/introducing-nextgen-actionscript/
> >
> > there's another tutorial from josh that we can publish.
> >
> > A side from this, I still think that adding TS at the same level than AS3
> > would be a great movement for Royale, Although the task will be not
> > trivial, probably most of the needed pieces are out there to use (TS
> Antlr
> > grammar, lever, and so on), we just need someone with the interest,
> > time and dedication to make this real...
> >
> >
> > >
> > > 2b) Linking is done using require(). This “just works” as long as the
> node
> > > modules are installed.
> >
> >
> > ...and I assume if you used package.json to download the dependencies,
> the
> > modules should be installed.
> >
> >
> > > Some tooling for debugging  and releasing would probably be helpful
> though.
> > >
> >
> > Ok, but I expect Debugging to be the same we already have in Royale
> > (although in parallel, I think debugging still has some issues to solve,
> > but not related to this).
> >
> > Thanks
> >
> > Carlos
> >
> >
> >
> > >
> > > HTH,
> > > Harbs
> > >
> > > [1]
> > >
> https://blog.npmjs.org/post/178027064160/next-generation-package-management
> > >
> > > > On Oct 3, 2018, at 12:06 PM, Carlos Rovira 
> > > wrote:
> > > >
> > > > Ok! publishing! :)
> > > >
> > > > While I publish I want to do share some thoughts I had today with
> friends
> > > > that use Node. They say that we need to make it as easy as possible
> to
> > > work
> > > > with Node since today is what front end devs use. So it's a must for
> us
> > > to
> > > > succeed in the current JS world. So tow things:
> > > >
> > > > 1.- package.json :  I assume that this is like build.xml or pom.xml.
> And
> > > > people expect to add JS libraries and those ones could bring other
> > > > dependencies as well. For me this is in the Node world and in Royale
> we
> > > > don't need to do more.
> > > >
> > > > 2.- Once we have a node dependency downloaded in our local repo, we
> need
> > > to
> > > > be able to use easily. Two things comes to my mind here:
> > > >   a) how we use the code directly in AS3 for a node library
> > > >   b) how we link the library and it's dependencies quickly
> (until now
> > > > we link via inject, from a CDN, but that's not what a node dev
> expect)
> > > >
> > > > hope you could share thoughts about this process to discover if we
> cover
> > > it
> > > > completely or we have black spots.
> > > >
> > > > thanks
> > > >
> > > >
> > > >
> > > >
> > > > El mié., 3 oct. 2018 a las 10:45, Harbs ()
> > > escribió:
> > > >
> > > >> I’m done. I think it’s good to go.
> > > >>
> > > >> Harbs
> > > >>
> > > >>> On Oct 3, 2018, at 11:37 AM, Harbs  wrote:
> > > >>>
> > > >>> I’m making a few small 

Jenkins build is back to normal : royale-asjs_MXTests #24

2018-10-06 Thread apacheroyaleci
See