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 253735

Summary: Local variable recognized as global in try-catch (JavaScript)
Product: javascript Reporter: Eccenux
Component: EditorAssignee: Petr Pisl <ppisl>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P3    
Version: 8.0.2   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:

Description Eccenux 2015-07-24 12:08:58 UTC
Here is a mini example of try-catch that fails in Netbeans:

```
function test() {
	try {
		 throw "myException";
	} catch (error) {
		console.warn('parse error; ', error.name, ': ', error.message);
	}
}
```

Netbeans shows a warning for `error` variable assuming it is a global variable.

It only happens when I use `error.name` and not `error` alone. It's weird because the same example in a function works fine:

```
function errorLog(error) {
	console.warn('parse error; ', error.name, ': ', error.message);
}
```
Comment 1 Svata Dedic 2015-07-24 12:16:11 UTC
Javascript rather than java :)
Comment 2 Eccenux 2015-07-24 12:30:17 UTC
Yes, I forgot to mention that :-). Sorry.
Comment 3 Petr Pisl 2015-07-29 07:55:09 UTC
Fixed for NB 8.1