Add unit files to lint, fix lint errors.

This commit is contained in:
Brendan Dahl 2011-12-23 21:19:15 -08:00
parent 1089c30b56
commit 971f35d165
4 changed files with 118 additions and 118 deletions

View File

@ -129,7 +129,7 @@ browser-test:
#
# <http://code.google.com/closure/utilities/docs/linter_howto.html>
SRC_DIRS := . src utils web test examples/helloworld extensions/firefox \
extensions/firefox/components extensions/chrome
extensions/firefox/components extensions/chrome test/unit
GJSLINT_FILES = $(foreach DIR,$(SRC_DIRS),$(wildcard $(DIR)/*.js))
lint:
gjslint --nojsdoc $(GJSLINT_FILES)

View File

@ -336,7 +336,8 @@ var PDFFunction = (function PDFFunctionClosure() {
};
},
constructPostScript: function pdfFunctionConstructPostScript(fn, dict, xref) {
constructPostScript: function pdfFunctionConstructPostScript(fn, dict,
xref) {
var domain = dict.get('Domain');
var range = dict.get('Range');
@ -344,7 +345,7 @@ var PDFFunction = (function PDFFunctionClosure() {
error('No domain.');
if (!range)
error('No range.')
error('No range.');
var lexer = new PostScriptLexer(fn);
var parser = new PostScriptParser(lexer);
@ -399,7 +400,7 @@ var FunctionCache = (function FunctionCache() {
}
FunctionCache.prototype = {
has: function(key) {
return key in this.cache
return key in this.cache;
},
get: function(key) {
return this.cache[key];
@ -677,12 +678,12 @@ var PostScriptEvaluator = (function PostScriptEvaluator() {
break;
default:
error('Unknown operator ' + operator);
break
break;
}
}
return stack.stack;
}
}
};
return PostScriptEvaluator;
})();

View File

@ -18,7 +18,7 @@ describe('function', function() {
for (var j = 0; j < a.length; j++) {
var suba = a[j], subb = b[j];
if (suba !== subb)
return false
return false;
}
} else {
if (a !== b)
@ -85,7 +85,7 @@ describe('function', function() {
['jz', 3],
['push', 99],
['j', 4],
['push', 44],
['push', 44]
];
expect(program).toMatchArray(expectedProgram);
});
@ -102,7 +102,6 @@ describe('function', function() {
var code = parser.parse();
var evaluator = new PostScriptEvaluator(code);
var output = evaluator.execute();
console.log(output);
return output;
}
it('pushes stack', function() {

View File

@ -3,11 +3,11 @@
'use strict';
describe("obj", function() {
describe('obj', function() {
describe("Name", function() {
it("should retain the given name", function() {
var givenName = "Font";
describe('Name', function() {
it('should retain the given name', function() {
var givenName = 'Font';
var name = new Name(givenName);
expect(name.name).toEqual(givenName);
});