Fix: AST_Accessor missing start / end tokens - #1492
This commit is contained in:
parent
eb55d8a9bb
commit
e587f3b760
10
lib/parse.js
10
lib/parse.js
|
|
@ -1320,11 +1320,17 @@ function parse($TEXT, options) {
|
||||||
var type = start.type;
|
var type = start.type;
|
||||||
var name = as_property_name();
|
var name = as_property_name();
|
||||||
if (type == "name" && !is("punc", ":")) {
|
if (type == "name" && !is("punc", ":")) {
|
||||||
|
var createAccessor = function() {
|
||||||
|
var func = function_(AST_Accessor);
|
||||||
|
func.start = start;
|
||||||
|
func.end = prev();
|
||||||
|
return func;
|
||||||
|
};
|
||||||
if (name == "get") {
|
if (name == "get") {
|
||||||
a.push(new AST_ObjectGetter({
|
a.push(new AST_ObjectGetter({
|
||||||
start : start,
|
start : start,
|
||||||
key : as_atom_node(),
|
key : as_atom_node(),
|
||||||
value : function_(AST_Accessor),
|
value : createAccessor(),
|
||||||
end : prev()
|
end : prev()
|
||||||
}));
|
}));
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -1333,7 +1339,7 @@ function parse($TEXT, options) {
|
||||||
a.push(new AST_ObjectSetter({
|
a.push(new AST_ObjectSetter({
|
||||||
start : start,
|
start : start,
|
||||||
key : as_atom_node(),
|
key : as_atom_node(),
|
||||||
value : function_(AST_Accessor),
|
value : createAccessor(),
|
||||||
end : prev()
|
end : prev()
|
||||||
}));
|
}));
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user