Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 1 addition & 16 deletions src/jsifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,6 @@ function ${name}(${args}) {

const original = LibraryManager.library[ident];
let snippet = original;
let redirectedIdent = null;
const deps = LibraryManager.library[ident + '__deps'] || [];
if (!Array.isArray(deps)) {
error(`JS library directive ${ident}__deps=${deps.toString()} is of type ${typeof deps}, but it should be an array!`);
Expand All @@ -307,18 +306,7 @@ function ${name}(${args}) {
});
let isFunction = false;

if (typeof snippet == 'string') {
if (snippet[0] != '=') {
const target = LibraryManager.library[snippet];
if (target) {
// Redirection for aliases. We include the parent, and at runtime make ourselves equal to it.
// This avoid having duplicate functions with identical content.
redirectedIdent = snippet;
deps.push(snippet);
snippet = mangleCSymbolName(snippet);
}
}
} else if (typeof snippet == 'object') {
if (typeof snippet == 'object') {
snippet = stringifyWithFunctions(snippet);
addImplicitDeps(snippet, deps);
} else if (typeof snippet == 'function') {
Expand Down Expand Up @@ -349,9 +337,6 @@ function ${name}(${args}) {
}
}

if (redirectedIdent) {
deps = deps.concat(LibraryManager.library[redirectedIdent + '__deps'] || []);
}
if (VERBOSE) {
printErr(`adding ${finalName} and deps ${deps} : ` + (snippet + '').substr(0, 40));
}
Expand Down