Re: [FlexJS] stopImmediatePropagation

2017-07-20 Thread Harbs
Yes. I need to copy the code from BrowserEvent. Interestingly, goog.Events does not distinguish between target and currentTarget. That does not seem very useful: * Target of the event. * @type {Object|undefined} */ this.target = opt_target; /** * Object that had the listener atta

Re: git commit: [flex-asjs] [refs/heads/feature/browser-event] - Cleaned up typing of native events

2017-07-20 Thread Piotr Zarzycki
Thank you! :) <3 2017-07-21 8:41 GMT+02:00 : > Repository: flex-asjs > Updated Branches: > refs/heads/feature/browser-event 273526e94 -> 294c3d6ab > > > Cleaned up typing of native events > > > Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo > Commit: http://git-wip-us.apache.org

Re: [FlexJS] stopImmediatePropagation

2017-07-20 Thread piotrz
Ahh Sorry I missed the point in his post. Do you see some solution ? Piotr - Apache Flex PMC piotrzarzyck...@gmail.com -- View this message in context: http://apache-flex-development.247.n4.nabble.com/FlexJS-stopImmediatePropagation-tp63418p63479.html Sent from the Apache Flex Developm

Re: [FlexJS] findPopupHost issue

2017-07-20 Thread Harbs
Bubbling does not work very well in FlexJS in general. When you can rely on native browser event bubbling, it usually works okay, but custom events don’t bubble. > On Jul 21, 2017, at 1:49 AM, Justin Mclean wrote: > > Hi, > >> The issue was that the TitleBar was dispatching "close" with bubbl

Re: [FlexJS] stopImmediatePropagation

2017-07-20 Thread Harbs
Yes. That’s the same issue that Alex has pointed out. > On Jul 21, 2017, at 8:44 AM, piotrz wrote: > > Hi Harbs, > > I just take a look into your branch and unfortunately something is wrong. > Our Tab component in MDL application stopped working. I see currentTarget is > missing in MouseEvent:

Re: [FlexJS] stopImmediatePropagation

2017-07-20 Thread piotrz
Hi Harbs, I just take a look into your branch and unfortunately something is wrong. Our Tab component in MDL application stopped working. I see currentTarget is missing in MouseEvent: I would like to a

Re: [FlexJS] findPopupHost issue

2017-07-20 Thread Justin Mclean
Hi, > The issue was that the TitleBar was dispatching "close" with bubbles=true. > This works fine on SWF but not on the HTML platform without some extra > work. So I just had PanelView intercept the event and dispatch one from > its strand. Out of interest is this because of a missing cloneEven

Re: [FlexJS] String.match()

2017-07-20 Thread Harbs
No. We thought that the “?” found the string in Flash. It does not. trace("https://www.google.com/search?q=dogs".match("?")); trace("https://www.google.com/search?q=dogs".search("?")); trace("https://www.google.com/search?q=dogs".indexOf("?")); outputs: null -1 29 > On Jul 21, 2017, at 12:00 AM

Re: [FlexJS] String.match()

2017-07-20 Thread Alex Harui
I think I'm still confused. My current thinking is that in Flash there are strings you can pass in that are "invalid RegExp" that will still find matches in a string. Isn't that what Yishay showed? IOW, passing in just "?" in Flash will find question marks in a string but is an error in JS becau

Re: [FlexJS] String.match()

2017-07-20 Thread piotrz
Harbs, Your second thought in my opinion is better solution. My daily job is in .NET/WPF and in C# following code var str = "m?o"; Regex reg = new Regex("?"); var match = reg.Match(str); Will throw "ArgumentException A regular expression parsing error occurred.", so there is no possibility to p

Re: [FlexJS] String.match()

2017-07-20 Thread Harbs
After all this discussion, I’m having second thoughts about this whole thing. What’s the point of using an invalid RegExp that will not match anything? I think the JS behavior makes more sense than the Flash behavior. If a RegExp is invalid, it should throw an error rather than never matching an

Re: [FlexJS] String.match()

2017-07-20 Thread Harbs
new RegExp({}) returns: /[object Object]/ I think the wrapping that I did in the code I already committed is correct: try{return input.match(pattern);} catch (e:Error){return null;} If the try fails, that means the RegExp is an invalid expression and will not match anything in Flash. In that ca

Re: [FlexJS] String.match()

2017-07-20 Thread Alex Harui
I'm confused. Doesn't Yishay's example use syntax that Harbs claimed threw an error? Anyway, I can believe the three steps Harbs listed are correct for JS since step 1 might just happen via implicit type coercion. I suppose someone could test it by seeing if JS handles "new RegExp({})"; But sinc

Re: [FlexJS] String.match()

2017-07-20 Thread Harbs
Right. That’s why I was suggesting wrapping the call in a try/catch and returning null/-1 from the catch. Additionally, the array returned from String.match() is a non-standard one. It has input and index properties. > On Jul 20, 2017, at 8:52 PM, yishayw wrote: > > I think there would still

Re: [FlexJS] String.match()

2017-07-20 Thread yishayw
I think there would still be a difference between flash and js because the flash implementation (counter to AS3 documentation) always returns null when an invalid regex is passed as a string. So according to your suggested implementation for Var s: String = "m?o"; Var a:Array = s.match("?") a is

Re: [FlexJS] findPopupHost issue

2017-07-20 Thread Peter Ent
I fixed this and committed/pushed it on the develop branch. The issue was that the TitleBar was dispatching "close" with bubbles=true. This works fine on SWF but not on the HTML platform without some extra work. So I just had PanelView intercept the event and dispatch one from its strand. —peter

Re: [FlexJS] String.match()

2017-07-20 Thread Harbs
Both Flash and JS environments return the same thing for this: "foo".match({foo:1}); ["o", index: 1, input: "foo"]0: "o"index: 1input: "foo"length: 1 It matches the first “o” in foo. I believe the reason for this is that Object.toString() is [object Object]. When that is evaluated to a RegExp it

Re: [FlexJS] findPopupHost issue

2017-07-20 Thread Peter Ent
I'm taking a look at this. Would you mind filing a JIRA on this? Thanks, Peter On 7/19/17, 1:23 PM, "PKumar" wrote: >​Panel , close event not firing on JS side. swf side it is working fine. >This may be an issue.​ > >On Wed, Jul 19, 2017 at 11:00 PM, Prashant Kumar >wrote: > >> ​I am having a

Re: [FlexJS] String.match()

2017-07-20 Thread Alex Harui
I just took a closer look at the ASDoc [1] and Mozilla doc [2]. Both imply that they take more than one type of input, so any utility function probably should as well and thus be of type "*". One difference in the two docs that stands out to me is in [1] where it says: "If the pattern is not a re

Re: [FlexJS] String.match()

2017-07-20 Thread Harbs
Really simply: new RegExp(“?”) In Flash, that will produce a RegExp object which matches nothing. In JS, it throws an error that the RegExp is not valid. match and search seem to call the RegExp constructor under the hood. In Flash it succeeds. In JS it throws an error. Utility functions serve

Re: [FlexJS] Debugging package

2017-07-20 Thread Alex Harui
It sounds like an interesting challenge, but I would not want to see special cases like this in the compiler. I don't understand the need to extend AS with JS syntax. In general, if there are different implementations on the various runtimes, we should invent an API for everyone to use, such as

Re: [FlexJS] Debugging package

2017-07-20 Thread Josh Tynjala
> > I'm still confused. If you can use flash.system.System.pause() what custom byte code is needed? I want to be able to write a "debugger" statement in ActionScript and have the compiler call flash.system.System.pause() in the generated SWF. Calling a function in a SWF requires some kind of inst

Re: [FlexJS] Debugging package

2017-07-20 Thread Alex Harui
I'm still confused. If you can use flash.system.System.pause() what custom byte code is needed? Are there other JS statements we need to support some day? Being able to add them to js.swc might be a better plan than having to change the compiler for each statement. -Alex On 7/19/17, 7:37 PM, "

Re: [FlexJS] String.match()

2017-07-20 Thread Alex Harui
I think I'm lost. If both behave the same, then why do we need to call some utility function? -Alex On 7/20/17, 5:00 AM, "Yishay Weiss" wrote: >Good catch. I was misled by the docs [1]. > >[1] >https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fhelp.adobe >.com%2Fen_US%2FFlashPla

Re: [FlexJS] Debugging package

2017-07-20 Thread piotrz
If that's the case we should not so freely use traces in framework itself. Eventually pass in compilation require flag for each module. Piotr - Apache Flex PMC piotrzarzyck...@gmail.com -- View this message in context: http://apache-flex-development.247.n4.nabble.com/FlexJS-Debugging-p

Re: [FlexJS] Debugging package

2017-07-20 Thread Alex Harui
Hmm, after digging into it a bit more, it appears that optimization does not remove trace calls. I haven't dumped a release SWF to verify. Maybe trace() just doesn't do anything in the production player. Optimization is a post-link process. IOW, it processes ABC code instead of source code, so

Re: [FlexJS] Debugging package

2017-07-20 Thread Josh Tynjala
We could consider something similar to COMPILE::JS and COMPILE::SWF where they default to a value of auto, which the compiler knows to turn into true or false. COMPILE::DEBUG could also default to a value of auto, and then the compiler makes it true for a debug build and false for a release build.

RE: [FlexJS] String.match()

2017-07-20 Thread Yishay Weiss
Good catch. I was misled by the docs [1]. [1] http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/String.html#match() From: Harbs Sent: Thursday, July 20, 2017 9:40 AM To: dev@flex.apache.org Subject: Re: [FlexJS] String.ma

Re: [FlexJS] Debugging package

2017-07-20 Thread piotrz
Harbs, It would be great to have it summarized in jira! Thanks, Piotr - Apache Flex PMC piotrzarzyck...@gmail.com -- View this message in context: http://apache-flex-development.247.n4.nabble.com/FlexJS-Debugging-package-tp63288p63453.html Sent from the Apache Flex Development mailin

Re: [FlexJS] Debugging package

2017-07-20 Thread Harbs
We also need to modify the output for trace in JS to put the goog.DEBUG check at the very start of the function and to not output the @export tag. The rest of the debugging functions need to lose the @export tag as well. Should I put all this in a JIRA? > On Jul 20, 2017, at 11:16 AM, Harbs wr

Re: [8/8] flex-asjs git commit: stopPropogation on the goog BrowserEvent is needed. I don’t know if the stopImmediatePropagation on the real browser event actually does anything and I don’t know how t

2017-07-20 Thread Harbs
Yes. Probably. Still waking up… ;-) > On Jul 20, 2017, at 11:01 AM, Alex Harui wrote: > > To test, wouldn't you just add multiple listeners to the element and the > wrapper? > > HTH, > -Alex > > On 7/20/17, 12:05 AM, "ha...@apache.org" wrote: > >> stopPropogation on the goog BrowserEvent is

Re: [FlexJS] Debugging package

2017-07-20 Thread Harbs
Hard code what? For any function in the org.apache.flex.debugging package it would not output to release SWF? > On Jul 20, 2017, at 11:00 AM, Alex Harui wrote: > > For now, I would just hard code it. > > On 7/20/17, 12:55 AM, "Harbs" wrote: > >> Cool. So what would you recommend the conventi

Re: [FlexJS] stopImmediatePropagation

2017-07-20 Thread Harbs
Yes. It looks like I missed that. > On Jul 20, 2017, at 10:59 AM, Alex Harui wrote: > > I think the FlexJS browser event has logic that, when you access the > target, it checks for a flexjs_wrapper property. I would expect problems > if MouseEvent and KeyboardEvent don't have the same way of fi

Re: [8/8] flex-asjs git commit: stopPropogation on the goog BrowserEvent is needed. I don’t know if the stopImmediatePropagation on the real browser event actually does anything and I don’t know how t

2017-07-20 Thread Alex Harui
To test, wouldn't you just add multiple listeners to the element and the wrapper? HTH, -Alex On 7/20/17, 12:05 AM, "ha...@apache.org" wrote: >stopPropogation on the goog BrowserEvent is needed. >I don???t know if the stopImmediatePropagation on the real browser event >actually does anything and

Re: [FlexJS] Debugging package

2017-07-20 Thread Alex Harui
For now, I would just hard code it. On 7/20/17, 12:55 AM, "Harbs" wrote: >Cool. So what would you recommend the convention to tell the compiler to >do so? A meta tag? a comment directive? (i.e. @debug) > >> On Jul 20, 2017, at 10:51 AM, Alex Harui >>wrote: >> >> I believe there is code that be

Re: [FlexJS] stopImmediatePropagation

2017-07-20 Thread Alex Harui
I think the FlexJS browser event has logic that, when you access the target, it checks for a flexjs_wrapper property. I would expect problems if MouseEvent and KeyboardEvent don't have the same way of finding the element wrapper. -Alex On 7/20/17, 12:15 AM, "Harbs" wrote: >Yes. This appears to

Re: [FlexJS] stopImmediatePropagation

2017-07-20 Thread Harbs
No hurry at all. I don’t need these code changes. > On Jul 20, 2017, at 10:29 AM, piotrz wrote: > > Harbs, > > If you are not in a hurry I may look into your branch on Sunday evening and > check whether our app is not breaking up. Can you wait with this one till > then ? > > Thanks, Piotr > >

Re: [FlexJS] Debugging package

2017-07-20 Thread Harbs
Cool. So what would you recommend the convention to tell the compiler to do so? A meta tag? a comment directive? (i.e. @debug) > On Jul 20, 2017, at 10:51 AM, Alex Harui wrote: > > I believe there is code that becomes part of the optimizer.jar that > removes the trace statements. It might be p

Re: [FlexJS] Debugging package

2017-07-20 Thread Alex Harui
I believe there is code that becomes part of the optimizer.jar that removes the trace statements. It might be possible extend that code to remove other things. -Alex On 7/19/17, 11:47 PM, "Harbs" wrote: >I don’t think there were any responses to this. > >As it stands, the debugging functions w

Re: [FlexJS] stopImmediatePropagation

2017-07-20 Thread piotrz
Harbs, If you are not in a hurry I may look into your branch on Sunday evening and check whether our app is not breaking up. Can you wait with this one till then ? Thanks, Piotr - Apache Flex PMC piotrzarzyck...@gmail.com -- View this message in context: http://apache-flex-development.233

Re: [8/8] flex-asjs git commit: stopPropogation on the goog BrowserEvent is needed. I don’t know if the stopImmediatePropagation on the real browser event actually does anything and I don’t know how t

2017-07-20 Thread piotrz
Great! :) Cool! :) Piotr - Apache Flex PMC piotrzarzyck...@gmail.com -- View this message in context: http://apache-flex-development.247.n4.nabble.com/Re-8-8-flex-asjs-git-commit-stopPropogation-on-the-goog-BrowserEvent-is-needed-I-don-t-know-if-the-s-tp63437p63441.html Sent from the A

Re: flex-asjs git commit: I’m not sure if cljs compiler will rename these. To be on the safe side…

2017-07-20 Thread Piotr Zarzycki
Harbs, What do you think to rename "eventObject" to "event" and before switch create new variable ? var eventObject:Object = event["event_"]; - Later use it in the switch. Just changes for readability. Thanks, Piotr 2017-07-20 9:35 GMT+02:00 : > Repository: flex-asjs > Updated Branches: > r

Re: [8/8] flex-asjs git commit: stopPropogation on the goog BrowserEvent is needed. I don’t know if the stopImmediatePropagation on the real browser event actually does anything and I don’t know how t

2017-07-20 Thread Harbs
Yes. > On Jul 20, 2017, at 10:14 AM, Piotr Zarzycki > wrote: > > Harbs, > > Did it help with your problem on loosing focus when you are using > KeyboardEvent ? > > Thanks, Piotr > > 2017-07-20 9:05 GMT+02:00 : > >> stopPropogation on the goog BrowserEvent is needed. >> I don’t know if the s

Re: [FlexJS] stopImmediatePropagation

2017-07-20 Thread Harbs
Yes. This appears to be it. I did not step through the code, but re-adding in wrappedEvent.stopPropagation(); seems to resolve the issues I was seeing. stopImmediatePropogation() probably does nothing at this point unless event listeners were added directly to HTML elements. Either way, my code

Re: [8/8] flex-asjs git commit: stopPropogation on the goog BrowserEvent is needed. I don’t know if the stopImmediatePropagation on the real browser event actually does anything and I don’t know how t

2017-07-20 Thread Piotr Zarzycki
Harbs, Did it help with your problem on loosing focus when you are using KeyboardEvent ? Thanks, Piotr 2017-07-20 9:05 GMT+02:00 : > stopPropogation on the goog BrowserEvent is needed. > I don’t know if the stopImmediatePropagation on the real browser event > actually does anything and I don’t

Re: [FlexJS] String.match()

2017-07-20 Thread Harbs
Yes. trace is stripped out in release. (We still need to remove the dead code, but that will happen too.) > On Jul 20, 2017, at 9:37 AM, piotrz wrote: > > Hi Harbs, > > I'm not so convinced by the trace. Maybe something from your debugger to > have everything in debug. Does trace stripped out