mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 12:57:42 +08:00
Add a flag we can use to skip string template calcs in release
This commit is contained in:
@ -138,7 +138,9 @@ export class FileNameResolver implements definition.FileNameResolver {
|
||||
var candidates = this.getFileCandidatesFromFolder(path, ext);
|
||||
result = findFileMatch(path, ext, candidates, this._context);
|
||||
|
||||
trace.write("Resolved file name for \"" + path + ext + "\" result: " + (result ? result : "no match found"), trace.categories.Navigation);
|
||||
if (trace.enabled) {
|
||||
trace.write("Resolved file name for \"" + path + ext + "\" result: " + (result ? result : "no match found"), trace.categories.Navigation);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -160,7 +162,9 @@ export class FileNameResolver implements definition.FileNameResolver {
|
||||
});
|
||||
}
|
||||
else {
|
||||
trace.write("Could not find folder " + folderPath + " when loading " + path + ext, trace.categories.Navigation);
|
||||
if (trace.enabled) {
|
||||
trace.write("Could not find folder " + folderPath + " when loading " + path + ext, trace.categories.Navigation);
|
||||
}
|
||||
}
|
||||
|
||||
return candidates;
|
||||
@ -171,7 +175,9 @@ export function findFileMatch(path: string, ext: string, candidates: Array<strin
|
||||
var bestValue = -1
|
||||
var result: string = null;
|
||||
|
||||
trace.write("Candidates for " + path + ext + ": " + candidates.join(", "), trace.categories.Navigation);
|
||||
if (trace.enabled) {
|
||||
trace.write("Candidates for " + path + ext + ": " + candidates.join(", "), trace.categories.Navigation);
|
||||
}
|
||||
for (var i = 0; i < candidates.length; i++) {
|
||||
var filePath = candidates[i];
|
||||
var qualifiersStr: string = filePath.substr(path.length, filePath.length - path.length - ext.length);
|
||||
|
Reference in New Issue
Block a user