I think that mediation of objects by JS can be designed in such a way to understand when a particular object (by the count of references to it) is no longer needed to the rest objects. http://www.slideshare.net/Adieu/advanced-javascript/
On Nov 20, 5:42 pm, "Ian Petersen" <[email protected]> wrote: > On Thu, Nov 20, 2008 at 6:13 AM, Garo.Garabedyan <[email protected]> wrote: > > I think that this is possible if you implement a JS code that behaves > > like a java.lang.ref.* references between Java objects to be > > translation to JS. And I think that this is not a heavy task to > > produce a heavy environment. Something like pay-to-use feature. > > Yes, if you "implement a JS code that behaves like a java.lang.ref.* > reference", then you've implemented java.lang.ref.* and the rest of > your requests are trivial. Jason Morris and I have already tried to > highlight the impossibility of implementing any such thing. The > Javascript interpreter doesn't provide any hooks for doing what you're > asking. > > If you want to get all technical, Javascript is a Turing-complete > language so you could, in principle, simulate an entire JVM and run > .class files on top of that. Do so would be largely ludicrous--if you > want to run Java in the browser, write an applet and run Java in the > browser, don't reinvent the wheel badly. > > Restricting ourselves to things that have a chance of being > incorporated into GWT leaves us with the conclusion that > java.lang.ref.* can't and won't be done. > > > JS code can be a mediator between objects and let them erase > > references when the letter are not needed anymore. > > I don't understand what you mean here. Javascript code is nothing > except a mediator between objects because Javascript is an > object-oriented language. Every single Javascript program ever > written and ever to be written will do nothing _except_ mediate > objects. That doesn't give such programs some kind of magical ability > to peer into the Javascript interpreter and divine when a particular > reference is no longer needed. > > > A change must be > > made in Java-to-JavaScript compiler. > > No, a change must be made in your design such that you no longer need > or want java.lang.ref.* because the Java-to-Javascript compiler can't > create features in the Javascript interpreter. > > Ian --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
