Skip to content
Commit 18a961d0 authored by Dominik Haumann's avatar Dominik Haumann
Browse files

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
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment