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.
Summary: | Provide option to ignore errors even for plain JS Files | ||
---|---|---|---|
Product: | javascript | Reporter: | mym |
Component: | Editor | Assignee: | 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
Created attachment 132113 [details]
File on which error shows
Created attachment 132114 [details]
Error screenshot
Created attachment 132115 [details]
Error screenshot
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 (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. 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 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). *** Bug 227077 has been marked as a duplicate of this bug. *** *** Bug 242580 has been marked as a duplicate of this bug. *** 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. 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. |