I'm using the Eclipse editor with JSDT to work through some Firefox add-on examples. The following code generates errors.
const {Cc, Ci} = require("chrome");
var downloadManager = Cc["@mozilla.org/download-manager;1"]
.getService(Ci.nsIDownloadManager);
The first line gives the error - Syntax error on token "}", delete this token
The last line gives the error - Syntax error, insert "}" to complete Block
Is there something wrong with this code or is it JSDT that is wrong?
It seems that you are using ES6 syntax code and JSDT Validator doesn't support this ECMA version (so it's a problem with JSDT). Your issue is the same than EcmaScript 6 - Tern IDE for Eclipse validation errors