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: | Customizable JavaScript target environments (e.g. browser, Nashorn, Node.js, ...) | ||
---|---|---|---|
Product: | javascript | Reporter: | pekarna <pekarna> |
Component: | Editor | Assignee: | Petr Pisl <ppisl> |
Status: | NEW --- | ||
Severity: | normal | CC: | terje7601 |
Priority: | P3 | ||
Version: | 7.1 | ||
Hardware: | PC | ||
OS: | Linux | ||
Issue Type: | ENHANCEMENT | Exception Reporter: |
Description
pekarna
2011-10-02 23:33:43 UTC
I fully agree with this report. There are numerous different host environments for ECMAScript, each adding their own extensions (syntax extensions, global objects, ...). I think the most important ones to support are: "browsers", Node.js, Nashorn. For example, if I want to write a Nashorn script, there's currently no support for many of its extensions: no syntax highlighting (issue 248105), parsing/formatting issues (cf. issue 252936 & issue 252937), code completion which proposes global objects that don't exist (e.g. document) & doesn't know about global objects that do (e.g. Java.type("...")). As the reporter already says: NetBeans should allow users to specify a specific host environment for JavaScript files. I believe an easy way would be by using a naming convention: myScript.js for browsers myScript.node.js for Node.js myScript.nashorn.js or myScript.jjs for Nashorn This convention could be "enforced" by adding new entries in the "New File" wizard. Another idea would be to have an option on the project-level to specify what environment the .js files target. Or to have a comment at the start of the file to denote the target environment. |