static properties

This commit is contained in:
Fábio Santos
2015-10-27 00:51:47 +00:00
parent 5f7cb6939c
commit 9ffed2bea6
4 changed files with 50 additions and 4 deletions

View File

@@ -1533,9 +1533,16 @@ function parse($TEXT, options) {
}
function concise_method_or_getset(name, start) {
var is_static = false;
if (name === "static" && !is("punc", "(")) {
is_static = true;
name = S.token.value;
next();
}
if (is("punc", "(")) {
return new AST_ConciseMethod({
start : start,
static : is_static,
name : new AST_SymbolMethod({ name: name }),
argnames : params_or_seq_().as_params(croak),
body : _function_body(true),
@@ -1545,6 +1552,7 @@ function parse($TEXT, options) {
if (name == "get") {
return new AST_ObjectGetter({
start : start,
static: is_static,
key : as_atom_node(),
value : function_(AST_Accessor),
end : prev()
@@ -1553,6 +1561,7 @@ function parse($TEXT, options) {
if (name == "set") {
return new AST_ObjectSetter({
start : start,
static: is_static,
key : as_atom_node(),
value : function_(AST_Accessor),
end : prev()