tamzinblake / js3-mode

A chimeric fork of js2-mode and js-mode
GNU General Public License v3.0
181 stars 13 forks source link

methods called delete kill the parser #72

Open jaclar opened 11 years ago

jaclar commented 11 years ago

Consider the following piece of javascript, which could be quiet common in an express.js node application:

function router(app) {
    app.post("/some/route", function (req, res, next) {
        next();
    });
    // this will break the parser:
    app.delete("/some/route", function (req,res, next) {
        next();
    });
}

The second route will break the syntax highlighter (and in general the javascript parser) because of the delete method.

tamzinblake commented 11 years ago

Yeah, the parser is old - reserved words as property names were disallowed until recently. Not sure if this is something to fix or wait till the new version with a new parser.