Skip to content

Commit 40af58c

Browse files
committed
Merge pull request NV#67 from Jimdo/jshint-fixes
Fixes all JSHint problems.
2 parents 2fdd182 + 1130801 commit 40af58c

16 files changed

+71
-67
lines changed

Jakefile.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@ task("default", ["build/CSSOM.js"]);
1515

1616
directory("build");
1717

18-
file("build/CSSOM.js", ["src/files.js", "src/CSSOM.js", "build"], function() {
19-
var parts = [readFile("src/CSSOM.js")];
18+
file("build/CSSOM.js", ["src/files.js", "src/CSSOM_START.js", "src/CSSOM_END.js", "build"], function() {
19+
var parts = [readFile("src/CSSOM_START.js")];
2020
require("./src/files").files.forEach(function(path) {
2121
var text = readFile("lib/" + path + ".js");
2222
parts.push(stripCommonJS(text).trimLeft());
2323
});
24+
parts.push(readFile("src/CSSOM_END.js"));
2425
FS.writeFileSync("build/CSSOM.js", parts.join(""));
2526
process.stdout.write("build/CSSOM.js is done\n");
2627
});

lib/CSSDocumentRule.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ var CSSOM = {
1212
*/
1313
CSSOM.CSSDocumentRule = function CSSDocumentRule() {
1414
CSSOM.CSSRule.call(this);
15-
this.matcher = new CSSOM.MatcherList;
15+
this.matcher = new CSSOM.MatcherList();
1616
this.cssRules = [];
1717
};
1818

19-
CSSOM.CSSDocumentRule.prototype = new CSSOM.CSSRule;
19+
CSSOM.CSSDocumentRule.prototype = new CSSOM.CSSRule();
2020
CSSOM.CSSDocumentRule.prototype.constructor = CSSOM.CSSDocumentRule;
2121
CSSOM.CSSDocumentRule.prototype.type = 10;
2222
//FIXME

lib/CSSFontFaceRule.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ var CSSOM = {
1212
*/
1313
CSSOM.CSSFontFaceRule = function CSSFontFaceRule() {
1414
CSSOM.CSSRule.call(this);
15-
this.style = new CSSOM.CSSStyleDeclaration;
15+
this.style = new CSSOM.CSSStyleDeclaration();
1616
this.style.parentRule = this;
1717
};
1818

19-
CSSOM.CSSFontFaceRule.prototype = new CSSOM.CSSRule;
19+
CSSOM.CSSFontFaceRule.prototype = new CSSOM.CSSRule();
2020
CSSOM.CSSFontFaceRule.prototype.constructor = CSSOM.CSSFontFaceRule;
2121
CSSOM.CSSFontFaceRule.prototype.type = 5;
2222
//FIXME

lib/CSSImportRule.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ var CSSOM = {
1515
CSSOM.CSSImportRule = function CSSImportRule() {
1616
CSSOM.CSSRule.call(this);
1717
this.href = "";
18-
this.media = new CSSOM.MediaList;
19-
this.styleSheet = new CSSOM.CSSStyleSheet;
18+
this.media = new CSSOM.MediaList();
19+
this.styleSheet = new CSSOM.CSSStyleSheet();
2020
};
2121

22-
CSSOM.CSSImportRule.prototype = new CSSOM.CSSRule;
22+
CSSOM.CSSImportRule.prototype = new CSSOM.CSSRule();
2323
CSSOM.CSSImportRule.prototype.constructor = CSSOM.CSSImportRule;
2424
CSSOM.CSSImportRule.prototype.type = 3;
2525

@@ -42,8 +42,7 @@ Object.defineProperty(CSSOM.CSSImportRule.prototype, "cssText", {
4242

4343
var buffer = '';
4444
var index;
45-
var mediaText = '';
46-
for (var character; character = cssText.charAt(i); i++) {
45+
for (var character; (character = cssText.charAt(i)); i++) {
4746

4847
switch (character) {
4948
case ' ':

lib/CSSKeyframeRule.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ var CSSOM = {
1313
CSSOM.CSSKeyframeRule = function CSSKeyframeRule() {
1414
CSSOM.CSSRule.call(this);
1515
this.keyText = '';
16-
this.style = new CSSOM.CSSStyleDeclaration;
16+
this.style = new CSSOM.CSSStyleDeclaration();
1717
this.style.parentRule = this;
1818
};
1919

20-
CSSOM.CSSKeyframeRule.prototype = new CSSOM.CSSRule;
20+
CSSOM.CSSKeyframeRule.prototype = new CSSOM.CSSRule();
2121
CSSOM.CSSKeyframeRule.prototype.constructor = CSSOM.CSSKeyframeRule;
2222
CSSOM.CSSKeyframeRule.prototype.type = 9;
2323
//FIXME

lib/CSSKeyframesRule.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ CSSOM.CSSKeyframesRule = function CSSKeyframesRule() {
1515
this.cssRules = [];
1616
};
1717

18-
CSSOM.CSSKeyframesRule.prototype = new CSSOM.CSSRule;
18+
CSSOM.CSSKeyframesRule.prototype = new CSSOM.CSSRule();
1919
CSSOM.CSSKeyframesRule.prototype.constructor = CSSOM.CSSKeyframesRule;
2020
CSSOM.CSSKeyframesRule.prototype.type = 8;
2121
//FIXME

lib/CSSMediaRule.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ var CSSOM = {
1313
*/
1414
CSSOM.CSSMediaRule = function CSSMediaRule() {
1515
CSSOM.CSSRule.call(this);
16-
this.media = new CSSOM.MediaList;
16+
this.media = new CSSOM.MediaList();
1717
this.cssRules = [];
1818
};
1919

20-
CSSOM.CSSMediaRule.prototype = new CSSOM.CSSRule;
20+
CSSOM.CSSMediaRule.prototype = new CSSOM.CSSRule();
2121
CSSOM.CSSMediaRule.prototype.constructor = CSSOM.CSSMediaRule;
2222
CSSOM.CSSMediaRule.prototype.type = 4;
2323
//FIXME

lib/CSSStyleRule.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ var CSSOM = {
1414
CSSOM.CSSStyleRule = function CSSStyleRule() {
1515
CSSOM.CSSRule.call(this);
1616
this.selectorText = "";
17-
this.style = new CSSOM.CSSStyleDeclaration;
17+
this.style = new CSSOM.CSSStyleDeclaration();
1818
this.style.parentRule = this;
1919
};
2020

21-
CSSOM.CSSStyleRule.prototype = new CSSOM.CSSRule;
21+
CSSOM.CSSStyleRule.prototype = new CSSOM.CSSRule();
2222
CSSOM.CSSStyleRule.prototype.constructor = CSSOM.CSSStyleRule;
2323
CSSOM.CSSStyleRule.prototype.type = 1;
2424

@@ -58,10 +58,10 @@ CSSOM.CSSStyleRule.parse = function(ruleText) {
5858
"value": true
5959
};
6060

61-
var styleRule = new CSSOM.CSSStyleRule;
62-
var selector, name, value, priority="";
61+
var styleRule = new CSSOM.CSSStyleRule();
62+
var name, priority="";
6363

64-
for (var character; character = ruleText.charAt(i); i++) {
64+
for (var character; (character = ruleText.charAt(i)); i++) {
6565

6666
switch (character) {
6767

lib/CSSStyleSheet.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ CSSOM.CSSStyleSheet = function CSSStyleSheet() {
1616
};
1717

1818

19-
CSSOM.CSSStyleSheet.prototype = new CSSOM.StyleSheet;
19+
CSSOM.CSSStyleSheet.prototype = new CSSOM.StyleSheet();
2020
CSSOM.CSSStyleSheet.prototype.constructor = CSSOM.CSSStyleSheet;
2121

2222

lib/CSSValue.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ CSSOM.CSSValue.prototype = {
1919
set cssText(text) {
2020
var name = this._getConstructorName();
2121

22-
throw new Exception('DOMException: property "cssText" of "' + name + '" is readonly!');
22+
throw new Error('DOMException: property "cssText" of "' + name + '" is readonly and can not be replaced with "' + text + '"!');
2323
},
2424

2525
get cssText() {
2626
var name = this._getConstructorName();
2727

28-
throw new Exception('getter "cssText" of "' + name + '" is not implemented!');
28+
throw new Error('getter "cssText" of "' + name + '" is not implemented!');
2929
},
3030

3131
_getConstructorName: function() {

0 commit comments

Comments
 (0)