diff --git a/extensions/firefox/tools/l10n.js b/extensions/firefox/tools/l10n.js index 1258f0777..9cb97428f 100644 --- a/extensions/firefox/tools/l10n.js +++ b/extensions/firefox/tools/l10n.js @@ -1,5 +1,6 @@ /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ +/* globals FirefoxCom */ 'use strict'; @@ -42,7 +43,8 @@ return; // get the related l10n object - var data = getL10nData(element.dataset.l10nId); + var key = element.dataset.l10nId; + var data = getL10nData(key); if (!data) return; diff --git a/make.js b/make.js index 1d5ac353f..08c4b065b 100644 --- a/make.js +++ b/make.js @@ -23,6 +23,7 @@ require('./external/shelljs/make'); var builder = require('./external/builder/builder.js'); var crlfchecker = require('./external/crlfchecker/crlfchecker.js'); +var path = require('path'); var ROOT_DIR = __dirname + '/', // absolute path to project's root BUILD_DIR = 'build/', @@ -971,49 +972,30 @@ target.server = function() { target.lint = function() { cd(ROOT_DIR); echo(); - echo('### Linting JS files (this can take a while!)'); - - var LINT_FILES = ['make.js', - 'external/builder/*.js', - 'external/crlfchecker/*.js', - 'src/*.js', - 'web/*.js', - 'test/*.js', - 'test/unit/*.js', - 'extensions/firefox/*.js', - 'extensions/firefox/components/*.js', - 'extensions/chrome/*.js']; - - exec('gjslint --nojsdoc ' + LINT_FILES.join(' ')); - - echo('Discarding the results by printing \"files checked, no errors found\"'); - echo('Use \"node make jshint\"'); - - crlfchecker.checkIfCrlfIsPresent(LINT_FILES); -}; - -// -// make jshint -// -target.jshint = function() { - cd(ROOT_DIR); - echo(); - echo('### Linting JS files (this can take a while!)'); + echo('### Linting JS files'); var LINT_FILES = ['make.js', 'external/builder/', 'external/crlfchecker/', 'src/', - 'web/*.js', - 'test/*.js', - 'test/unit/*.js', - 'extensions/firefox/*.js', - 'extensions/firefox/components/*.js', - 'extensions/chrome/*.js' + 'web/', + 'test/driver.js', + 'test/reporter.js', + 'test/unit/', + 'extensions/firefox/', + 'extensions/chrome/' ]; - exit(exec('./node_modules/.bin/jshint --reporter test/reporter.js ' + + var jshintPath = path.normalize('./node_modules/.bin/jshint'); + if (!test('-f', jshintPath)) { + echo('jshint is not installed -- installing...'); + exec('npm install jshint'); + } + + exit(exec('"' + jshintPath + '" --reporter test/reporter.js ' + LINT_FILES.join(' ')).code); + + crlfchecker.checkIfCrlfIsPresent(LINT_FILES); }; // diff --git a/package.json b/package.json index 050543767..e0c2e8b6c 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "jshint": "git://github.com/jshint/jshint.git#42ace75a" }, "scripts": { - "test": "node make jshint" + "test": "node make lint" }, "repository": { "type": "git", diff --git a/test/reporter.js b/test/reporter.js index cd7e4bc90..4c3275e82 100644 --- a/test/reporter.js +++ b/test/reporter.js @@ -43,6 +43,7 @@ module.exports = { ((len === 1) ? '' : 's') + '\n'); process.exit(2); } else { + process.stdout.write('files checked, no errors found\n'); process.exit(0); } }