For syntax highlighting, allow .js-files to start with a shebang
When writing node.js scripts it is common to include a shebang at the top, like `#!/usr/bin/env node`, and save it in a .js-file. However, the syntax highlighter for JavaScript does not understand the shebang, and tries to highlight it as JavaScript. It is understood as two literal regular expressions (/usr/bin and /env node), the last of which is not closed, meaning that the rest of the file is attempted understood as part of the last regular expression. This defeats syntax highlighting for .js-files that start with a shebang. This patch allows .js files to start with a shebang. CCBUG: 325805
parent
243c1bc6
Please register or sign in to comment