This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 229637 - Expected an operand but found error
Summary: Expected an operand but found error
Status: CLOSED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.3
Hardware: PC Linux
: P3 normal (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-13 07:21 UTC by rajivpingale
Modified: 2013-06-24 09:36 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (35.83 KB, text/plain)
2013-05-13 07:21 UTC, rajivpingale
Details
screenshot (30.16 KB, image/png)
2013-05-13 10:12 UTC, Vladimir Riha
Details
134352: screenshot (51.37 KB, image/png)
2013-05-13 10:28 UTC, rajivpingale
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rajivpingale 2013-05-13 07:21:49 UTC
Product Version = NetBeans IDE 7.3 (Build 201302132200)
Operating System = Linux version 3.2.0-41-generic running on i386
Java; VM; Vendor = 1.6.0_27
Runtime = OpenJDK Client VM 20.0-b12

Showing following Error to JavaScript code 

Expected an operand but found error

function GetURLParameter(sParam)
    {
        var sPageURL = window.location.search.substring(1);
        var sURLVariables = sPageURL.split('&');
        for (var i = 0; i < sURLVariables.length; i++) 
        {
            var sParameterName = sURLVariables[i].split('=');
            if (sParameterName[0] == sParam) 
            {
                return sParameterName[1];
            }
        }
    }​
Comment 1 rajivpingale 2013-05-13 07:21:57 UTC
Created attachment 134343 [details]
IDE log
Comment 2 rajivpingale 2013-05-13 07:26:31 UTC
Error is shown at last line of this function, after I have one comment and 2 global variable declared
Comment 3 Vladimir Riha 2013-05-13 08:18:54 UTC
Reproducible in trunk, you can "fix" it by removing last character after "}" (closing function). 

I think there is already similar issue but I cannot find it...
Comment 4 Vladimir Riha 2013-05-13 08:27:58 UTC
Easy workaround, maybe nashorn related? I don't think this is P2
Comment 5 rajivpingale 2013-05-13 09:32:57 UTC
@Vladimir Riha I can't remove this brace as it indicate end of function. There might be some other error.
Comment 6 Vladimir Riha 2013-05-13 10:12:34 UTC
Created attachment 134352 [details]
screenshot

Not the brace, when I copied the code above, I had "whitespace" after the closing "}", so in IDE, it looked like on the screenshot. Once I deleted this "whitespace" (I think it is not really whitespace), it was OK

Please check the screenshot to see what I mean. Perhaps I misunderstood the problem
Comment 7 rajivpingale 2013-05-13 10:28:30 UTC
Created attachment 134353 [details]
134352: screenshot

Please attached Image of Error, I do not have any extra white space after braces.
Comment 8 Vladimir Riha 2013-05-13 11:30:32 UTC
If the whitespace/non-printable is not in the original source, try to delete the closing "}" and type it again
Comment 9 Petr Pisl 2013-05-27 09:20:33 UTC
@rajivpingale Is the problem in js file or an html file? If in the html file, could you please attach it?
Comment 10 Petr Pisl 2013-06-24 09:35:01 UTC
Please reopen the issue, if you have still the problem in current dev build. In such case, please attach the reproducible file. Thanks a lot.