Don't run static analysis on app code

The static analysis is used to determine what "var"s need to be
automatically inserted by the linker at the package level.  But for app
code, we never actually insert these vars, since apps run in "global
namespace" mode.  So it's a waste of time to run the static analysis at
all.
This commit is contained in:
David Glasser
2015-05-14 11:05:26 -07:00
parent 43efe54c22
commit b6348d4939

View File

@@ -72,6 +72,14 @@ _.extend(Module.prototype, {
return self.declaredExports; return self.declaredExports;
} }
// The assigned variables in the app aren't actually used for anything:
// we're using the global namespace, so there's no header where we declare
// all of the assigned variables as vars. So there's no use wasting time
// running static analysis on app code.
if (self.useGlobalNamespace) {
return [];
}
// Find all global references in any files // Find all global references in any files
var assignedVariables = []; var assignedVariables = [];
_.each(self.files, function (file) { _.each(self.files, function (file) {