update features
This commit is contained in:
parent
08b3823db2
commit
cad5e8935f
|
|
@ -57,7 +57,7 @@ function replaceMangled(code, file, infered_names) {
|
||||||
//replace variables with inferred names
|
//replace variables with inferred names
|
||||||
stream = OutputStream({
|
stream = OutputStream({
|
||||||
beautify: true, replace_mangled: function (node) {
|
beautify: true, replace_mangled: function (node) {
|
||||||
var label = nodeToString(node);
|
var label = nodeToProperty(node).toString();
|
||||||
if (node.definition() && feature_outputter.string_map.hasId(label) && feature_outputter.string_map.getId(label) in infered_names){
|
if (node.definition() && feature_outputter.string_map.hasId(label) && feature_outputter.string_map.getId(label) in infered_names){
|
||||||
return infered_names[feature_outputter.string_map.getId(label)];
|
return infered_names[feature_outputter.string_map.getId(label)];
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -70,8 +70,8 @@ function replaceMangled(code, file, infered_names) {
|
||||||
//replace variables with placeholders. Using in the online demo for interactive renaming.
|
//replace variables with placeholders. Using in the online demo for interactive renaming.
|
||||||
stream = OutputStream({
|
stream = OutputStream({
|
||||||
beautify: true, replace_mangled: function (node) {
|
beautify: true, replace_mangled: function (node) {
|
||||||
if (node.definition() && feature_outputter.string_map.hasId(nodeToString(node))){
|
if (node.definition() && feature_outputter.string_map.hasId(nodeToProperty(node).toString())){
|
||||||
return "local$$" + feature_outputter.string_map.getId(nodeToString(node));
|
return "local$$" + feature_outputter.string_map.getId(nodeToProperty(node).toString());
|
||||||
} else {
|
} else {
|
||||||
return node.name;
|
return node.name;
|
||||||
}
|
}
|
||||||
|
|
@ -244,10 +244,10 @@ function pathToStringFw(path, start){
|
||||||
}
|
}
|
||||||
|
|
||||||
function pathToStringBw(path, start){
|
function pathToStringBw(path, start){
|
||||||
var res = "";
|
var res = "[" + path[path.length-1].child_id + "]";
|
||||||
for (var i = path.length - 2; i >= start; i--) {
|
for (var i = path.length - 2; i >= start; i--) {
|
||||||
res += nodeType(path[i]);
|
res += nodeType(path[i]);
|
||||||
res += "[" + path[i+1].child_id + "]";
|
res += "[" + path[i].child_id + "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user