Skip to content

Commit 164391f

Browse files
SergioCrisostomotimwienk
authored andcommitted
Code style & polish.
1 parent d461371 commit 164391f

34 files changed

+231
-215
lines changed

Grunt/options/options.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ var path = require('path');
44
var browsers = require('./browsers');
55

66
module.exports = function(grunt){
7-
var dir = grunt.config.get('environment.dir'),
8-
build = grunt.config.get('environment.build'),
9-
travis = grunt.config.get('environment.travis'),
7+
var travis = grunt.config.get('environment.travis'),
108
sauceLabs = grunt.config.get('environment.sauceLabs');
119

1210
var config = {

Grunt/plugins/karma/syn/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
var path = require('path');
22

3-
var createPattern = function(path) {
3+
var createPattern = function(path){
44
return {pattern: path, included: true, served: true, watched: false};
55
};
66

7-
//var initSyn = function(files) {
7+
//var initSyn = function(files){
88
// files.unshift(createPattern(path.join(__dirname, 'post-amd.js')));
99
// files.unshift(createPattern(path.resolve(require.resolve('syn'), '../../syn.js')));
1010
// files.unshift(createPattern(path.join(__dirname, 'pre-amd.js')));
1111
//};
1212

13-
var initSyn = function(files) {
13+
var initSyn = function(files){
1414
// Local version that works in IE9 and IE10.
1515
files.unshift(createPattern(path.join(__dirname, 'lib/syn.js')));
1616
};

Source/Browser/Browser.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ document.html = document.documentElement;
188188
if (!document.head) document.head = document.getElementsByTagName('head')[0];
189189

190190
if (document.execCommand) try {
191-
document.execCommand("BackgroundImageCache", false, true);
191+
document.execCommand('BackgroundImageCache', false, true);
192192
} catch (e){}
193193

194194
/*<ltIE9>*/
@@ -205,7 +205,7 @@ if (this.attachEvent && !this.addEventListener){
205205
var arrayFrom = Array.from;
206206
try {
207207
arrayFrom(document.html.childNodes);
208-
} catch(e){
208+
} catch (e){
209209
Array.from = function(item){
210210
if (typeof item != 'string' && Type.isEnumerable(item) && typeOf(item) != 'array'){
211211
var i = item.length, array = new Array(i);
@@ -278,7 +278,7 @@ if (Browser.name == 'unknown'){
278278
case 'webkit':
279279
case 'khtml':
280280
Browser.Engine.webkit = true;
281-
break;
281+
break;
282282
case 'gecko':
283283
Browser.Engine.gecko = true;
284284
}

Source/Class/Class.Thenable.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,9 @@ function resolve(thenable, value){
105105
if (thenable === value){
106106
reject(thenable, new TypeError('Tried to resolve a thenable with itself.'));
107107
} else if (value && (typeof value === 'object' || typeof value === 'function')){
108+
var then;
108109
try {
109-
var then = value.then;
110+
then = value.then;
110111
} catch (exception){
111112
reject(thenable, exception);
112113
}
@@ -129,7 +130,7 @@ function resolve(thenable, value){
129130
}
130131
}
131132
);
132-
} catch (exception) {
133+
} catch (exception){
133134
if (!resolved){
134135
resolved = true;
135136
reject(thenable, exception);
@@ -201,7 +202,7 @@ function handle(result, reactions, type){
201202
} else {
202203
try {
203204
resolve(reaction.thenable, handler(result));
204-
} catch (exception) {
205+
} catch (exception){
205206
reject(reaction.thenable, exception);
206207
}
207208
}

Source/Class/Class.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ var reset = function(object){
5353
var F = function(){};
5454
F.prototype = value;
5555
object[key] = reset(new F);
56-
break;
56+
break;
5757
case 'array': object[key] = value.clone(); break;
5858
}
5959
}

Source/Core/Core.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ var hasOwnProperty = Object.prototype.hasOwnProperty;
6363
var enumerables = true;
6464
for (var i in {toString: 1}) enumerables = null;
6565
if (enumerables) enumerables = ['hasOwnProperty', 'valueOf', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'constructor'];
66-
function forEachObjectEnumberableKey(object, fn, bind) {
66+
function forEachObjectEnumberableKey(object, fn, bind){
6767
if (enumerables) for (var i = enumerables.length; i--;){
6868
var k = enumerables[i];
6969
// signature has key-value, so overloadSetter can directly pass the
@@ -378,7 +378,7 @@ var mergeOne = function(source, key, current){
378378
case 'object':
379379
if (typeOf(source[key]) == 'object') Object.merge(source[key], current);
380380
else source[key] = Object.clone(current);
381-
break;
381+
break;
382382
case 'array': source[key] = current.clone(); break;
383383
default: source[key] = current;
384384
}

Source/Element/Element.Dimensions.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ Element.implement({
7575
// This svg section under, calling `svgCalculateSize()`, can be removed when FF fixed the svg size bug.
7676
// Bug info: https://bugzilla.mozilla.org/show_bug.cgi?id=530985
7777
if (this.get('tag') == 'svg') return svgCalculateSize(this);
78-
78+
7979
try {
8080
var bounds = this.getBoundingClientRect();
8181
return {x: bounds.width, y: bounds.height};
82-
} catch(e) {
82+
} catch (e){
8383
return {x: 0, y: 0};
8484
}
8585
},
@@ -119,14 +119,14 @@ Element.implement({
119119

120120
try {
121121
return element.offsetParent;
122-
} catch(e){}
122+
} catch (e){}
123123
return null;
124124
},
125125

126126
getOffsets: function(){
127127
var hasGetBoundingClientRect = this.getBoundingClientRect;
128128
//<1.4compat>
129-
hasGetBoundingClientRect = hasGetBoundingClientRect && !Browser.Platform.ios
129+
hasGetBoundingClientRect = hasGetBoundingClientRect && !Browser.Platform.ios;
130130
//</1.4compat>
131131
if (hasGetBoundingClientRect){
132132
var bound = this.getBoundingClientRect(),

Source/Element/Element.Style.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ var floatName = (html.style.cssFloat == null) ? 'styleFloat' : 'cssFloat',
9090

9191
var camelCase = function(property){
9292
return property.replace(prefixPattern, '$1-').camelCase();
93-
}
93+
};
9494

9595
//<ltIE9>
9696
var removeStyle = function(style, property){

Source/Element/Element.js

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -217,13 +217,13 @@ var escapeQuotes = function(html){
217217
/*<ltIE9>*/
218218
// #2479 - IE8 Cannot set HTML of style element
219219
var canChangeStyleHTML = (function(){
220-
var div = document.createElement('style'),
221-
flag = false;
222-
try {
223-
div.innerHTML = '#justTesing{margin: 0px;}';
224-
flag = !!div.innerHTML;
225-
} catch(e){}
226-
return flag;
220+
var div = document.createElement('style'),
221+
flag = false;
222+
try {
223+
div.innerHTML = '#justTesing{margin: 0px;}';
224+
flag = !!div.innerHTML;
225+
} catch (e){}
226+
return flag;
227227
})();
228228
/*</ltIE9>*/
229229

@@ -232,7 +232,7 @@ Document.implement({
232232
newElement: function(tag, props){
233233
if (props){
234234
if (props.checked != null) props.defaultChecked = props.checked;
235-
if ((props.type == 'checkbox' || props.type == 'radio') && props.value == null) props.value = 'on';
235+
if ((props.type == 'checkbox' || props.type == 'radio') && props.value == null) props.value = 'on';
236236
/*<ltIE9>*/ // IE needs the type to be set before changing content of style element
237237
if (!canChangeStyleHTML && tag == 'style'){
238238
var styleElement = document.createElement('style');
@@ -560,7 +560,7 @@ Object.forEach(properties, function(real, key){
560560
});
561561

562562
/*<ltIE9>*/
563-
propertySetters.text = (function(setter){
563+
propertySetters.text = (function(){
564564
return function(node, value){
565565
if (node.get('tag') == 'style') node.set('html', value);
566566
else node[properties.text] = value;
@@ -624,7 +624,7 @@ propertyGetters['class'] = function(node){
624624
/* <webkit> */
625625
var el = document.createElement('button');
626626
// IE sets type as readonly and throws
627-
try { el.type = 'button'; } catch(e){}
627+
try { el.type = 'button'; } catch (e){}
628628
if (el.type != 'button') propertySetters.type = function(node, value){
629629
node.setAttribute('type', value);
630630
};
@@ -636,13 +636,13 @@ el = null;
636636
/*<ltIE9>*/
637637
// #2479 - IE8 Cannot set HTML of style element
638638
var canChangeStyleHTML = (function(){
639-
var div = document.createElement('style'),
640-
flag = false;
641-
try {
642-
div.innerHTML = '#justTesing{margin: 0px;}';
643-
flag = !!div.innerHTML;
644-
} catch(e){}
645-
return flag;
639+
var div = document.createElement('style'),
640+
flag = false;
641+
try {
642+
div.innerHTML = '#justTesing{margin: 0px;}';
643+
flag = !!div.innerHTML;
644+
} catch (e){}
645+
return flag;
646646
})();
647647
/*</ltIE9>*/
648648

@@ -658,7 +658,7 @@ try {
658658
input.value = '';
659659
input.type = 'email';
660660
html5InputSupport = input.type == 'email';
661-
} catch(e){}
661+
} catch (e){}
662662

663663
input = null;
664664

@@ -688,9 +688,9 @@ var hasCloneBug = (function(test){
688688
var hasClassList = !!document.createElement('div').classList;
689689

690690
var classes = function(className){
691-
var classNames = (className || '').clean().split(" "), uniques = {};
691+
var classNames = (className || '').clean().split(' '), uniques = {};
692692
return classNames.filter(function(className){
693-
if (className !== "" && !uniques[className]) return uniques[className] = className;
693+
if (className !== '' && !uniques[className]) return uniques[className] = className;
694694
});
695695
};
696696

@@ -1085,11 +1085,12 @@ var supportsHTML5Elements = true, supportsTableInnerHTML = true, supportsTRInner
10851085
/*<ltIE9>*/
10861086
// technique by jdbarlett - http://jdbartlett.com/innershiv/
10871087
var div = document.createElement('div');
1088+
var fragment;
10881089
div.innerHTML = '<nav></nav>';
10891090
supportsHTML5Elements = (div.childNodes.length == 1);
10901091
if (!supportsHTML5Elements){
1091-
var tags = 'abbr article aside audio canvas datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video'.split(' '),
1092-
fragment = document.createDocumentFragment(), l = tags.length;
1092+
var tags = 'abbr article aside audio canvas datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video'.split(' ');
1093+
fragment = document.createDocumentFragment(), l = tags.length;
10931094
while (l--) fragment.createElement(tags[l]);
10941095
}
10951096
div = null;

Source/Fx/Fx.CSS.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Fx.CSS = new Class({
5757
return value.map(function(val){
5858
val = String(val);
5959
var found = false;
60-
Object.each(Fx.CSS.Parsers, function(parser, key){
60+
Object.each(Fx.CSS.Parsers, function(parser){
6161
if (found) return;
6262
var parsed = parser.parse(val);
6363
if (parsed || parsed === 0) found = {value: parsed, parser: parser};
@@ -102,7 +102,7 @@ Fx.CSS = new Class({
102102
var to = {}, selectorTest = new RegExp('^' + selector.escapeRegExp() + '$');
103103

104104
var searchStyles = function(rules){
105-
Array.each(rules, function(rule, i){
105+
Array.each(rules, function(rule){
106106
if (rule.media){
107107
searchStyles(rule.rules || rule.cssRules);
108108
return;
@@ -120,7 +120,7 @@ Fx.CSS = new Class({
120120
});
121121
};
122122

123-
Array.each(document.styleSheets, function(sheet, j){
123+
Array.each(document.styleSheets, function(sheet){
124124
var href = sheet.href;
125125
if (href && href.indexOf('://') > -1 && href.indexOf(document.domain) == -1) return;
126126
var rules = sheet.rules || sheet.cssRules;

Source/Fx/Fx.Tween.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Element.implement({
6767
return this;
6868
},
6969

70-
fade: function(how){
70+
fade: function(){
7171
var fade = this.get('tween'), method, args = ['opacity'].append(arguments), toggle;
7272
if (args[1] == null) args[1] = 'toggle';
7373
switch (args[1]){
@@ -81,13 +81,13 @@ Element.implement({
8181
args[1] = flag ? 0 : 1;
8282
this.store('fade:flag', !flag);
8383
toggle = true;
84-
break;
84+
break;
8585
default: method = 'start';
8686
}
8787
if (!toggle) this.eliminate('fade:flag');
8888
fade[method].apply(fade, args);
8989
var to = args[args.length - 1];
90-
90+
9191
if (method == 'set'){
9292
this.setStyle('visibility', to == 0 ? 'hidden' : 'visible');
9393
} else if (to != 0){

0 commit comments

Comments
 (0)