faster util.pushMutatorMap aliases
This commit is contained in:
parent
6f0ca947a7
commit
a04513a3c7
@ -58,7 +58,16 @@ exports.sourceMapToComment = function (map) {
|
||||
};
|
||||
|
||||
exports.pushMutatorMap = function (mutatorMap, key, kind, method) {
|
||||
var alias = JSON.stringify(traverse.removeProperties(_.cloneDeep(key)));
|
||||
var alias;
|
||||
|
||||
if (t.isIdentifier(key)) {
|
||||
alias = key.name;
|
||||
if (method.computed) alias = "computed:" + alias;
|
||||
} else if (t.isLiteral(key)) {
|
||||
alias = String(key.value);
|
||||
} else {
|
||||
alias = JSON.stringify(traverse.removeProperties(_.cloneDeep(key)));
|
||||
}
|
||||
|
||||
var map;
|
||||
if (_.has(mutatorMap, alias)) {
|
||||
@ -174,7 +183,7 @@ exports.parse = function (opts, code, callback) {
|
||||
ecmaVersion: Infinity,
|
||||
strictMode: true,
|
||||
onComment: comments,
|
||||
locations: opts.sourceMap,
|
||||
locations: true,
|
||||
onToken: tokens,
|
||||
ranges: true
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user