Bug 526463 - JS-Editor: Nullpointer-Exception while opening .js-File with certain syntax.
Summary: JS-Editor: Nullpointer-Exception while opening .js-File with certain syntax.
Status: NEW
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: 3.9 (Oxygen)   Edit
Hardware: PC Windows 10
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Victor Rubezhny CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-25 10:59 EDT by Jakob Klein CLA
Modified: 2017-11-02 18:24 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jakob Klein CLA 2017-10-25 10:59:17 EDT
JS-Editor: Nullpointer-Exception while opening .js-File with certain syntax.
The .js-File has a syntax-error which should not stop the editor from opening the file.

-- Configuration Details --
Product: Eclipse 4.7.1.20171005-1200 (org.eclipse.epp.package.javascript.product)Installed Features:
 org.eclipse.platform 4.7.1.v20171009-0410

Reproduction:
1. Download a clean "Eclipse IDE for JavaScript and Web Developers" 64bit-zip on Windows 10
2. Start, create a js-Project
3. Outside of eclipse create .js-File with the following content:
app.component("errorComponent", {
	controller: function() {
		var ctrl = this; // Comment;
		var ctrl.x = '';
	}
});
4. Save the file an try to open it in Eclipse WITH THE JS-EDITOR -> Will not be opened -> "Failed to create the part's controls" with a NullpointerException.
5. Can be openend with the normal text editor in eclipse.
6. The error depends on the comment and the broken js-Syntax: remove either "var ctrl.x = '';" or "// Comment;" and the problem disappears.