NetBeans Ruby JavaScript Support

View: New views
12 Messages — Rating Filter:   Alert me  

NetBeans Ruby JavaScript Support

by bruparel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I just started playing with JavaScript using NetBeans.  I must say I am impressed!  Really good support for HTML/CSS/Javascript editing.

One thing that puzzles me about the NetBeans JavaScript editor is its insistence on saying "Anonymous function does not always return a value..." even when the function really does.  The following JavaScript function is from the second Chapter of JQuery in Action book:

$.toSource = function(target) {
   if (typeof target.toSource !== 'undefined' && typeof target.callee === 'undefined') {
      return target.toSource().slice(1,-1);
   }
   switch (typeof target) {
      case 'number':
      case 'boolean':
      case 'function':
         return target;
         break;
      case 'string':
         return '\'' + target + '\'';
         break;
      case 'object':
         var result;
         if (target instanceof Date) {
            result = 'new Date('+target.getTime()+')';
         }
         else if (target.constructor === Array || typeof target.callee !== 'undefined') {
            result = '[';
            var i, length = target.length;
            for (i = 0; i < length-1; i++) { result += $.toSource(target[i]) + ','; }
            result += $.toSource(target[i]) + ']';
         }
         else {
            result = '{';
            var key;
            for (key in target) { result += key + ':' + $.toSource(target[key]) + ','; }
            result = result.replace(/\,$/, '') + '}';
         }
         return result;
         break;
      default:
         return '?unsupported-type?';
         break;
   }
}

You can see that every return statement returns a value.  Why is NetBeans popping up Hints?

Bharat

Re: NetBeans Ruby JavaScript Support

by Tor Norbye :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On May 8, 2008, at 7:14 AM, bruparel wrote:

>
> I just started playing with JavaScript using NetBeans.  I must say I  
> am
> impressed!  Really good support for HTML/CSS/Javascript editing.
>
> One thing that puzzles me about the NetBeans JavaScript editor is its
> insistence on saying "Anonymous function does not always return a  
> value..."
> even when the function really does.  The following JavaScript  
> function is
> from the second Chapter of JQuery in Action book:

Hi Bharat,
sorry about the delay -- I took a week off after the JavaOne conference.

Anyway, the below is a bug - specifically the return value analysis  
was incorrect for switch statements.  I've just integrated a fix for  
this problem (and a related problem related to the "code has no side  
effects" check which also had a couple of false positives.

The fix will be in build #1976 and later from the 6.5 daily builds - http://deadlock.netbeans.org/hudson/job/trunk/ 
  .

-- Tor


>
>
> $.toSource = function(target) {
>   if (typeof target.toSource !== 'undefined' && typeof target.callee  
> ===
> 'undefined') {
>      return target.toSource().slice(1,-1);
>   }
>   switch (typeof target) {
>      case 'number':
>      case 'boolean':
>      case 'function':
>         return target;
>         break;
>      case 'string':
>         return '\'' + target + '\'';
>         break;
>      case 'object':
>         var result;
>         if (target instanceof Date) {
>            result = 'new Date('+target.getTime()+')';
>         }
>         else if (target.constructor === Array || typeof  
> target.callee !==
> 'undefined') {
>            result = '[';
>            var i, length = target.length;
>            for (i = 0; i < length-1; i++) { result +=  
> $.toSource(target[i])
> + ','; }
>            result += $.toSource(target[i]) + ']';
>         }
>         else {
>            result = '{';
>            var key;
>            for (key in target) { result += key + ':' +
> $.toSource(target[key]) + ','; }
>            result = result.replace(/\,$/, '') + '}';
>         }
>         return result;
>         break;
>      default:
>         return '?unsupported-type?';
>         break;
>   }
> }
>
> You can see that every return statement returns a value.  Why is  
> NetBeans
> popping up Hints?
>
> Bharat
> --
> View this message in context: http://www.nabble.com/NetBeans-Ruby-JavaScript-Support-tp17126465p17126465.html
> Sent from the NetBeans Ruby - Users mailing list archive at  
> Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: NetBeans Ruby JavaScript Support

by bruparel :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Tor,
Thanks for the response.  I have been playing with Firefox/Firebug combination and was thinking that Firebug incorporated into NetBeans would be fantastic for debugging Javascript code.  What do you think?
Regards,
Bharat

Re: NetBeans Ruby JavaScript Support

by Tor Norbye :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On May 19, 2008, at 2:40 PM, bruparel wrote:

>
> Hello Tor,
> Thanks for the response.  I have been playing with Firefox/Firebug
> combination and was thinking that Firebug incorporated into NetBeans  
> would
> be fantastic for debugging Javascript code.  What do you think?

Hi Bharat -
Try the dailys!  We demoed a JavaScript client side (e.g. browser)  
debugger at JavaOne two weeks ago, and just a day or two ago that  
debugger was integrated with Rails projects as well (the initial  
support was for Java EE web based projects only).

I haven't tried the Rails integration myself, but I believe you go to  
the project settings and configure client side debugging there, then  
run the debugger as usual and now any breakpoints you've set in  
JavaScript (and hopefully RHTML files, gotta check that) will cause  
the -browser- to fire the breakpoint and you can single step through  
your code etc. etc.  (Frames are mapped to threads, and so on.)

-- Tor

>
> Regards,
> Bharat
>
> --
> View this message in context: http://www.nabble.com/NetBeans-Ruby-JavaScript-Support-tp17126465p17328779.html
> Sent from the NetBeans Ruby - Users mailing list archive at  
> Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@...
> For additional commands, e-mail: users-help@...
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: NetBeans Ruby JavaScript Support

by urlwolf :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Tor Norbye wrote:
On May 19, 2008, at 2:40 PM, bruparel wrote:

>
> Hello Tor,
> Thanks for the response.  I have been playing with Firefox/Firebug
> combination and was thinking that Firebug incorporated into NetBeans  
> would
> be fantastic for debugging Javascript code.  What do you think?

Hi Bharat -
Try the dailys!  We demoed a JavaScript client side (e.g. browser)  
debugger at JavaOne two weeks ago, and just a day or two ago that  
debugger was integrated with Rails projects as well (the initial  
support was for Java EE web based projects only).

I haven't tried the Rails integration myself, but I believe you go to  
the project settings and configure client side debugging there, then  
run the debugger as usual and now any breakpoints you've set in  
JavaScript (and hopefully RHTML files, gotta check that) will cause  
the -browser- to fire the breakpoint and you can single step through  
your code etc. etc.  (Frames are mapped to threads, and so on.)

-- Tor
Wow, that is impressive. Congrats to the netbeans team, integrated jscript debugger is a dream come true for me. I didn't even think it was possible.

Re: NetBeans Ruby JavaScript Support

by Anthony Richardson-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



On Tue, May 20, 2008 at 8:34 AM, Tor Norbye <tor.norbye@...> wrote:
On May 19, 2008, at 2:40 PM, bruparel wrote:


Hello Tor,
Thanks for the response.  I have been playing with Firefox/Firebug
combination and was thinking that Firebug incorporated into NetBeans would
be fantastic for debugging Javascript code.  What do you think?

Hi Bharat -
Try the dailys!  We demoed a JavaScript client side (e.g. browser) debugger at JavaOne two weeks ago, and just a day or two ago that debugger was integrated with Rails projects as well (the initial support was for Java EE web based projects only).

I haven't tried the Rails integration myself, but I believe you go to the project settings and configure client side debugging there, then run the debugger as usual and now any breakpoints you've set in JavaScript (and hopefully RHTML files, gotta check that) will cause the -browser- to fire the breakpoint and you can single step through your code etc. etc.  (Frames are mapped to threads, and so on.)

-- Tor

I have just tried the client side javascript debugger under Ubuntu 8.04 with Firefox 3.0b (release candidate). Netbeans promoted to install the firefox plugin and that installed fine. Restart Firefox, however when I launch the debug session the firefox window sits on "NetBeans JavaScript Debugger Launching. Please wait..." and never goes any further.

Should I take discussion of this feature to the nbajax group?


Re: NetBeans Ruby JavaScript Support

by Erno Mononen :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Anthony Richardson wrote:

>
>
> On Tue, May 20, 2008 at 8:34 AM, Tor Norbye <tor.norbye@...
> <mailto:tor.norbye@...>> wrote:
>
>     On May 19, 2008, at 2:40 PM, bruparel wrote:
>
>
>         Hello Tor,
>         Thanks for the response.  I have been playing with Firefox/Firebug
>         combination and was thinking that Firebug incorporated into
>         NetBeans would
>         be fantastic for debugging Javascript code.  What do you think?
>
>
>     Hi Bharat -
>     Try the dailys!  We demoed a JavaScript client side (e.g. browser)
>     debugger at JavaOne two weeks ago, and just a day or two ago that
>     debugger was integrated with Rails projects as well (the initial
>     support was for Java EE web based projects only).
>
>     I haven't tried the Rails integration myself, but I believe you go
>     to the project settings and configure client side debugging there,
>     then run the debugger as usual and now any breakpoints you've set
>     in JavaScript (and hopefully RHTML files, gotta check that) will
>     cause the -browser- to fire the breakpoint and you can single step
>     through your code etc. etc.  (Frames are mapped to threads, and so
>     on.)
>
>     -- Tor
>
>
> I have just tried the client side javascript debugger under Ubuntu
> 8.04 with Firefox 3.0b (release candidate). Netbeans promoted to
> install the firefox plugin and that installed fine. Restart Firefox,
> however when I launch the debug session the firefox window sits on
> "NetBeans JavaScript Debugger Launching. Please wait..." and never
> goes any further.

I think the plugin is supported only on Firefox 2.x, but I could be wrong.

>
> Should I take discussion of this feature to the nbajax group?
>
Yes, I think that would be the best mailing list for this feature - not
sure if any of the javascript debugger developers are monitoring this list.

Thanks,
Erno


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: NetBeans Ruby JavaScript Support

by Tor Norbye :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Jun 17, 2008, at 4:58 PM, Erno Mononen wrote:

> Anthony Richardson wrote:
>> I have just tried the client side javascript debugger under Ubuntu  
>> 8.04 with Firefox 3.0b (release candidate). Netbeans promoted to  
>> install the firefox plugin and that installed fine. Restart  
>> Firefox, however when I launch the debug session the firefox window  
>> sits on "NetBeans JavaScript Debugger Launching. Please wait..."  
>> and never goes any further.
>
> I think the plugin is supported only on Firefox 2.x, but I could be  
> wrong.

I think that's true; I think that (for now) you need
Firefox 2.x
Firebug 1.1 (beta?)

I've CC'ed the lead developer on the JavaScript debugger, Sandip  
Chitale, in case he can comment on this.

-- Tor


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: NetBeans Ruby JavaScript Support

by Sandip Chitale :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Tor Norbye wrote:

> On Jun 17, 2008, at 4:58 PM, Erno Mononen wrote:
>
>> Anthony Richardson wrote:
>>> I have just tried the client side javascript debugger under Ubuntu
>>> 8.04 with Firefox 3.0b (release candidate). Netbeans promoted to
>>> install the firefox plugin and that installed fine. Restart Firefox,
>>> however when I launch the debug session the firefox window sits on
>>> "NetBeans JavaScript Debugger Launching. Please wait..." and never
>>> goes any further.
>>
>> I think the plugin is supported only on Firefox 2.x, but I could be
>> wrong.
>
> I think that's true; I think that (for now) you need
> Firefox 2.x
> Firebug 1.1 (beta?)

This is correct. The debugging APIs of Firefox 3 as well as Firebug 1.2
which goes with it are not very stable yet. Therefore for NetBeans 6.5
(Sep/Oct) timeframe we are going to support

Firefox 2.x
Firebug 1.1 beta12

combination.

--
Sandip

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: NetBeans Ruby JavaScript Support

by Tor Norbye :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Jun 17, 2008, at 9:35 AM, Sandip Chitale wrote:

> Tor Norbye wrote:
>> On Jun 17, 2008, at 4:58 PM, Erno Mononen wrote:
>>
>>> Anthony Richardson wrote:
>>>> I have just tried the client side javascript debugger under  
>>>> Ubuntu 8.04 with Firefox 3.0b (release candidate). Netbeans  
>>>> promoted to install the firefox plugin and that installed fine.  
>>>> Restart Firefox, however when I launch the debug session the  
>>>> firefox window sits on "NetBeans JavaScript Debugger Launching.  
>>>> Please wait..." and never goes any further.
>>>
>>> I think the plugin is supported only on Firefox 2.x, but I could  
>>> be wrong.
>>
>> I think that's true; I think that (for now) you need
>> Firefox 2.x
>> Firebug 1.1 (beta?)
>
> This is correct. The debugging APIs of Firefox 3 as well as Firebug  
> 1.2 which goes with it are not very stable yet. Therefore for  
> NetBeans 6.5 (Sep/Oct) timeframe we are going to support
>
> Firefox 2.x
> Firebug 1.1 beta12
>
> combination.

Is there something you can do to detect which browser and firebug  
plugin versions the user has, and present an error or upgrade screen  
rather than a stalled splash/launch screen?

-- Tor


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Re: NetBeans Ruby JavaScript Support

by Anthony Richardson-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



On Wed, Jun 18, 2008 at 2:05 AM, Sandip Chitale <Sandip.Chitale@...> wrote:
Tor Norbye wrote:
On Jun 17, 2008, at 4:58 PM, Erno Mononen wrote:

Anthony Richardson wrote:
I have just tried the client side javascript debugger under Ubuntu 8.04 with Firefox 3.0b (release candidate). Netbeans promoted to install the firefox plugin and that installed fine. Restart Firefox, however when I launch the debug session the firefox window sits on "NetBeans JavaScript Debugger Launching. Please wait..." and never goes any further.

I think the plugin is supported only on Firefox 2.x, but I could be wrong.

I think that's true; I think that (for now) you need
Firefox 2.x
Firebug 1.1 (beta?)

This is correct. The debugging APIs of Firefox 3 as well as Firebug 1.2 which goes with it are not very stable yet. Therefore for NetBeans 6.5 (Sep/Oct) timeframe we are going to support

Firefox 2.x
Firebug 1.1 beta12

combination.


 Hi Sandip,

That's a pity as FireFox 3 was just released and a lots (I mean a lot) will upgrade to FireFox 3 pretty quickly. I suggest adding the firefox supported version checks to the XPI to prevent confusion. I have logged an issue:

http://ruby.netbeans.org/issues/show_bug.cgi?id=137505

I will test under FireFox 2.

Cheers,

Anthony


Re: NetBeans Ruby JavaScript Support

by Sandip Chitale :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Tor Norbye wrote:

> On Jun 17, 2008, at 9:35 AM, Sandip Chitale wrote:
>
>> Tor Norbye wrote:
>>> On Jun 17, 2008, at 4:58 PM, Erno Mononen wrote:
>>>
>>>> Anthony Richardson wrote:
>>>>> I have just tried the client side javascript debugger under Ubuntu
>>>>> 8.04 with Firefox 3.0b (release candidate). Netbeans promoted to
>>>>> install the firefox plugin and that installed fine. Restart
>>>>> Firefox, however when I launch the debug session the firefox
>>>>> window sits on "NetBeans JavaScript Debugger Launching. Please
>>>>> wait..." and never goes any further.
>>>>
>>>> I think the plugin is supported only on Firefox 2.x, but I could be
>>>> wrong.
>>>
>>> I think that's true; I think that (for now) you need
>>> Firefox 2.x
>>> Firebug 1.1 (beta?)
>>
>> This is correct. The debugging APIs of Firefox 3 as well as Firebug
>> 1.2 which goes with it are not very stable yet. Therefore for
>> NetBeans 6.5 (Sep/Oct) timeframe we are going to support
>>
>> Firefox 2.x
>> Firebug 1.1 beta12
>>
>> combination.
>
> Is there something you can do to detect which browser and firebug
> plugin versions the user has, and present an error or upgrade screen
> rather than a stalled splash/launch screen?
http://www.netbeans.org/issues/show_bug.cgi?id=137505 has been filed
related to this.
>
> -- Tor
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...