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 226948 - Provide option to ignore errors even for plain JS Files
Summary: Provide option to ignore errors even for plain JS Files
Alias: None
Product: javascript
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.2
Hardware: Macintosh (x86) Mac OS X
: P3 normal (vote)
Assignee: Petr Pisl
: 227077 242580 (view as bug list)
Depends on:
Reported: 2013-03-03 19:04 UTC by mym
Modified: 2017-02-19 08:37 UTC (History)
4 users (show)

See Also:
Exception Reporter:

File on which error shows (1.36 KB, text/javascript)
2013-03-03 19:06 UTC, mym
Error screenshot (140.75 KB, image/png)
2013-03-03 19:07 UTC, mym
Error screenshot (173.78 KB, image/png)
2013-03-03 19:09 UTC, mym

Note You need to log in before you can comment on or make changes to this bug.
Description mym 2013-03-03 19:04:31 UTC

Comment 1 mym 2013-03-03 19:06:58 UTC
Created attachment 132113 [details]
File on which error shows
Comment 2 mym 2013-03-03 19:07:32 UTC
Created attachment 132114 [details]
Error screenshot
Comment 3 mym 2013-03-03 19:09:47 UTC
Created attachment 132115 [details]
Error screenshot
Comment 4 Vladimir Riha 2013-03-04 07:22:38 UTC
I don't think this is valid code. "Return" statement should be inside function body and in your code it is not.

I tried following in Chrome and Firefox and in neither of them work, both throw exception:

return (function(){console.log(1)}());



works fine
Comment 5 mym 2013-03-04 18:18:44 UTC
(In reply to comment #4)

This is valid in node.js and mongodb.
Anyway please make it possible to ignore some errors and make error badges optional.
Comment 6 Vladimir Riha 2013-03-04 22:38:19 UTC
Interesting :) Maybe something like [1] helps to bypass this "issue" (at least in case of require()). I tried running these commands:

   node -e "(function(){console.log(1)}())"


   node -e "return (function(){console.log(1)}())"

The second one fails with "Illegal return statement". Is there a difference in your case if you omit the "return"?

Comment 7 mym 2013-03-05 00:01:37 UTC
The code provided is executed by mongo and "return" is required there.
Anyway, the best solution seems to be an option to ignore error(s).
Comment 8 Petr Pisl 2013-05-30 15:32:55 UTC
*** Bug 227077 has been marked as a duplicate of this bug. ***
Comment 9 Vladimir Riha 2014-03-05 15:49:10 UTC
*** Bug 242580 has been marked as a duplicate of this bug. ***
Comment 10 rweaver 2016-12-15 17:30:21 UTC
I see this error on code that has a return with no value as well (which is valid JS):

const timestamp = new Date().getTime();
		const data = JSON.parse(event.body);
		if (typeof data.text !== 'string') {
			console.error('Validation Failed'); // eslint-disable-line no-console
			callback(new Error('Couldn\'t create the users item.'));

The error shows on the return, which is strictly speaking valid.
Comment 11 RAM518 2017-02-19 08:37:20 UTC
I would like the option to disable error "badges", "hints", "error lines", completely, regardless of language. 

Sometimes it may be a feature that I want, but almost always, it's not. Those little warning explamation points just burn my eyes and annoy the hell out of me. 

I know there's an error. It's because I haven't finished writing a declaration yet. I don't need a damn red exclamation flashing and warning me about it.