On Tuesday, July 22, 2014 10:25:50 AM UTC+2, Jens wrote:
I got an answer that my function TestObj.member1 has to return 'this'. I'm still new to JavaScript but I think a call of new TestObj.member1 should return the object that is created?!You are calling the function "member1" on a newly created TestObj. So "return new TestObj.member1(..)" returns what the function returns. As your function does not return anything currently, your code fails.
No: TestObj.member1 is evaluated to a function and then called as a constructor with the arguments: http://www.ecma-international.org/ecma-262/5.1/#sec-11.2.2
Live sample: http://jsfiddle.net/28MA2/
(and the suggestion to "return this" in gwt-contrib was also an error)
I honestly don't understand what's going on.
Also, is the outcome different if you run in prod mode? (replace your System.out.println with java.util.logging to get the output to the console, or replace it with DOM manipulation to get it in the HTML)
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment