From b6348d4939381f9c7496648043e396ed61c76ce7 Mon Sep 17 00:00:00 2001 From: David Glasser Date: Thu, 14 May 2015 11:05:26 -0700 Subject: [PATCH] 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. --- tools/linker.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/linker.js b/tools/linker.js index 153bc5f6c8..c49b517d30 100644 --- a/tools/linker.js +++ b/tools/linker.js @@ -72,6 +72,14 @@ _.extend(Module.prototype, { 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 var assignedVariables = []; _.each(self.files, function (file) {