mooz / js2-mode

Improved JavaScript editing mode for GNU Emacs
GNU General Public License v3.0
1.33k stars 186 forks source link

V8 natives syntax #243

Open eush77 opened 9 years ago

eush77 commented 9 years ago

V8 engine (and hence the Node) can provide access to its internal C++ runtime functions if --allow-natives-syntax flag is set (or configured at runtime with thlorenz/v8-flags).

The special syntax for this is a function call expression with a percent sign in front of a function name:

%GetOptimizationStatus(fn)

Any chance this extension could fit into js2-mode and not cause syntax errors?

dgutov commented 9 years ago

What is required exactly? Supporting percent sign in front of function names?

eush77 commented 9 years ago

@dgutov Yes, that is accurate. I updated my first comment.

dgutov commented 9 years ago

Shouldn't be too hard. If someone would like to propose a patch, a new user option and a small change to js2-parse-unary-expr should do it. But see Contributing in README.