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

Summary: Provide option to ignore errors even for plain JS Files
Product: javascript Reporter: mym
Component: EditorAssignee: Petr Pisl <ppisl>
Status: REOPENED ---    
Severity: normal CC: alaksundar, dusty, rweaver, vriha
Priority: P3    
Version: 8.2   
Hardware: Macintosh (x86)   
OS: Mac OS X   
Issue Type: ENHANCEMENT Exception Reporter:
Attachments: File on which error shows
Error screenshot
Error screenshot

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)}());

while

(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)}())"

and

   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"?



[1] http://www.nearinfinity.com/blogs/jeff_kunkle/2012/06/13/secret-sauce-of-nodejs-modules.html
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.'));
			return;
		}

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.