Allow operator names as getters/setters

Fixes #919

Fix provided by @kzc
This commit is contained in:
Anthony Van de Gejuchte
2016-01-15 15:58:15 +01:00
committed by Richard van Velzen
parent ebe118dc79
commit 26641f3fb2
3 changed files with 143 additions and 0 deletions

View File

@@ -1178,6 +1178,13 @@ function parse($TEXT, options) {
break;
}
break;
case "operator":
if (!is_identifier_string(tok.value)) {
throw new JS_Parse_Error("Invalid getter/setter name: " + tok.value,
tok.file, tok.line, tok.col, tok.pos);
}
ret = _make_symbol(AST_SymbolRef);
break;
}
next();
return ret;