Refactor as required (scope, naming).
This commit is contained in:
parent
452e2d37ed
commit
8aff2332e5
11
lib/parse.js
11
lib/parse.js
|
|
@ -1308,6 +1308,10 @@ function parse($TEXT, options) {
|
|||
});
|
||||
});
|
||||
|
||||
var create_accessor = embed_tokens(function() {
|
||||
return function_(AST_Accessor);
|
||||
});
|
||||
|
||||
var object_ = embed_tokens(function() {
|
||||
expect("{");
|
||||
var first = true, a = [];
|
||||
|
|
@ -1320,14 +1324,11 @@ function parse($TEXT, options) {
|
|||
var type = start.type;
|
||||
var name = as_property_name();
|
||||
if (type == "name" && !is("punc", ":")) {
|
||||
var createAccessor = embed_tokens(function() {
|
||||
return function_(AST_Accessor);
|
||||
});
|
||||
if (name == "get") {
|
||||
a.push(new AST_ObjectGetter({
|
||||
start : start,
|
||||
key : as_atom_node(),
|
||||
value : createAccessor(),
|
||||
value : create_accessor(),
|
||||
end : prev()
|
||||
}));
|
||||
continue;
|
||||
|
|
@ -1336,7 +1337,7 @@ function parse($TEXT, options) {
|
|||
a.push(new AST_ObjectSetter({
|
||||
start : start,
|
||||
key : as_atom_node(),
|
||||
value : createAccessor(),
|
||||
value : create_accessor(),
|
||||
end : prev()
|
||||
}));
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user