Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit 09bc17f

Browse files
committed
Fixed the issues mentioned in the code review.
Removed the debug/console output.
1 parent cc5cc6b commit 09bc17f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/language/CodeInspection.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ define(function (require, exports, module) {
183183
*/
184184
function run() {
185185
if (!_enabled) {
186+
_lastResult = null;
186187
Resizer.hide($problemsPanel);
187188
StatusBar.updateIndicator(INDICATOR_ID, true, "inspection-disabled", Strings.LINT_DISABLED);
188189
setGotoEnabled(false);
@@ -206,7 +207,7 @@ define(function (require, exports, module) {
206207
providers.forEach(function (provider) {
207208
perfTimerInspector = PerfUtils.markStart("CodeInspection '" + provider.name + "':\t" + currentDoc.file.fullPath);
208209

209-
if (getProviderState(provider) === true) {
210+
if (getProviderState(provider)) {
210211
var result = provider.scanFile(currentDoc.getText(), currentDoc.file.fullPath);
211212
_lastResult = result;
212213

@@ -245,7 +246,9 @@ define(function (require, exports, module) {
245246
});
246247

247248
// Update results table
248-
var html = Mustache.render(ResultsTemplate, {reportList: resultList});
249+
// compile creates a cached function to render the template
250+
var resultsTemplate = Mustache.compile(ResultsTemplate);
251+
var html = resultsTemplate({reportList: resultList});
249252
var $selectedRow;
250253

251254
$problemsPanel.find(".table-container")
@@ -256,8 +259,6 @@ define(function (require, exports, module) {
256259
.on("click", function (e) {
257260
var $row = $(e.target).closest("tr");
258261

259-
console.log("Target: " + e.target.toString());
260-
console.log("Header clicked" + $row.toString());
261262
if ($row.length) {
262263
if ($selectedRow) {
263264
$selectedRow.removeClass("selected");

0 commit comments

Comments
 (0)