facebook

javascript syntax error not reported in jsp/javascript eds

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #226048 Reply

    pholister
    Member

    After testing a jsp, I went to add a few comments and inadvertantly deleted an opening brace in a javascript function…

    Even after putting this little javascript function in its own .js file, myeclipse did not report an error.. by leaving off one opening brace, the code closes off the function, and leaves a couple of statements dangling with the original closing brace..that should definitely trigger a syntax error,right?

    my question’s are
    1) is the JSP editor not javascript aware (it seems to only notice the html script tag)
    2) is the javascript editor just highlighting keywords and nothing more?
    3) what is the ‘best practices’ for avoiding this kind of issue (ie. javascript bugs).

    
     <script>
        function exec_form( frm, reqAction ) {
            if (reqAction == "test") {
                       frm.dotest.value="go";
                   frm.DFS__Step.value = 2;
             }
             if (reqAction == 'cancel')    // brace missing
                window.close();
                    return false;
             } // to compiler/interpreter, this closes the fucntion
    
             frm.submit(); // next 3 statements are dangling
             return true;
        } //this should be syntax error
      </script>
    
    #226051 Reply

    pholister
    Member

    spaced on the env:
    eclipse 3.0.1
    myeclipse 3.8.4
    jdk 1.4.2_04
    win2k

    #226094 Reply

    Riyad Kalla
    Member

    pholister,
    Currently the JavaScript editor provides syntax highlighting and autocomplete, real-time error (reconciler) checking is not part of the editor *yet*.

    #226102 Reply

    pholister
    Member

    rkalla,

    I realize JSP parsing cannot be pretty.. your mixing several languages, 2 server side, 2 client side.. still, in an IDE, you get used to relying on the syntax/semantic checking, and if one of the languages is left out, it really is a shortcoming.

    Is there a committed release/timeframe for javascript reconciling?

    thx.

    #226105 Reply

    Riyad Kalla
    Member

    There is not an ETA for this functionality right now, I appologize for the ‘fuzziness’.

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: javascript syntax error not reported in jsp/javascript eds

You must be logged in to post in the forum log in