Skip to content

Commit

Permalink
1.0.3 - use name to find symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
robintindale committed Oct 13, 2017
1 parent 7aa0cef commit 7bddd15
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
3 changes: 3 additions & 0 deletions images/cover.layer

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name" : "Library Symbol Replacer",
"identifier" : "com.zeroheight.library-symbol-replacer",
"version" : "1.0.2",
"version" : "1.0.3",
"description" : "replace local symbols with library symbols",
"authorEmail" : "support@zeroheight.com",
"author" : "zeroheight team",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,19 @@ var replaceSymbols = function(context) {
var mySymbols = documentData.localSymbols();
var localLookup = {};
for(var i = 0 ; i < mySymbols.length ; ++i){
var symbolID = String(mySymbols[i].symbolID());
localLookup[symbolID] = mySymbols[i];
var symbolName = String(mySymbols[i].name());
localLookup[symbolName] = mySymbols[i];
}

var imports = [];
var totalInstances = 0;

// find any local symbols in the current document which are now provided by the library

var librarySymbols = library.document().documentData().localSymbols();
for(var i = 0 ; i < librarySymbols.length ; ++i){
var librarySymbol = librarySymbols[i];
var symbolID = String(librarySymbol.symbolID());
var localSymbol = localLookup[symbolID];
var symbolName = String(librarySymbol.name());
var localSymbol = localLookup[symbolName];
if(localSymbol){
var instances = localSymbol.allInstances();
if(instances.length > 0){
Expand Down

0 comments on commit 7bddd15

Please sign in to comment.