Skip to content

Commit c69673f

Browse files
committed
Release: remove revert artefacts
1 parent 2d9d1f0 commit c69673f

21 files changed

+258
-243
lines changed

src/data.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ jQuery.fn.extend( {
120120
// will result in `undefined` for elem = this[ 0 ] which will
121121
// throw an exception if an attempt to read a data cache is made.
122122
if ( elem && value === undefined ) {
123+
123124
// Attempt to get data from the cache
124125
// with the key as-is
125126
data = dataUser.get( elem, key );
@@ -128,6 +129,7 @@ jQuery.fn.extend( {
128129
}
129130

130131
camelKey = jQuery.camelCase( key );
132+
131133
// Attempt to get data from the cache
132134
// with the key camelized
133135
data = dataUser.get( elem, camelKey );
@@ -148,7 +150,8 @@ jQuery.fn.extend( {
148150

149151
// Set the data...
150152
camelKey = jQuery.camelCase( key );
151-
this.each(function() {
153+
this.each( function() {
154+
152155
// First, attempt to store a copy or reference of any
153156
// data that might've been store with a camelCased key.
154157
var data = dataUser.get( this, camelKey );
@@ -161,10 +164,10 @@ jQuery.fn.extend( {
161164
// *... In the case of properties that might _actually_
162165
// have dashes, we need to also store a copy of that
163166
// unchanged property.
164-
if ( key.indexOf("-") > -1 && data !== undefined ) {
167+
if ( key.indexOf( "-" ) > -1 && data !== undefined ) {
165168
dataUser.set( this, key, value );
166169
}
167-
});
170+
} );
168171
}, null, value, arguments.length > 1, null, true );
169172
},
170173

src/data/Data.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,12 @@ Data.prototype = {
2828
value: value,
2929
writable: true,
3030
configurable: true
31-
});
31+
} );
3232
}
3333
return owner[ this.expando ];
3434
},
35-
cache: function( owner, initial ) {
35+
cache: function( owner ) {
36+
3637
// We can accept data for non-element nodes in modern browsers,
3738
// but we should not, see #8335.
3839
// Always return an empty object.
@@ -81,6 +82,7 @@ Data.prototype = {
8182

8283
// Handle: [ owner, { properties } ] args
8384
} else {
85+
8486
// Copy the properties one-by-one to the cache object
8587
for ( prop in data ) {
8688
cache[ prop ] = data[ prop ];
@@ -91,10 +93,11 @@ Data.prototype = {
9193
get: function( owner, key ) {
9294
return key === undefined ?
9395
this.cache( owner ) :
94-
owner[ this.expando ] && owner[ this.expando ][ key ]
96+
owner[ this.expando ] && owner[ this.expando ][ key ];
9597
},
9698
access: function( owner, key, value ) {
9799
var stored;
100+
98101
// In cases where either:
99102
//
100103
// 1. No key was specified
@@ -107,12 +110,12 @@ Data.prototype = {
107110
// 2. The data stored at the key
108111
//
109112
if ( key === undefined ||
110-
((key && typeof key === "string") && value === undefined) ) {
113+
( ( key && typeof key === "string" ) && value === undefined ) ) {
111114

112115
stored = this.get( owner, key );
113116

114117
return stored !== undefined ?
115-
stored : this.get( owner, jQuery.camelCase(key) );
118+
stored : this.get( owner, jQuery.camelCase( key ) );
116119
}
117120

118121
// When the key is not a string, or both a key and value
@@ -139,8 +142,10 @@ Data.prototype = {
139142
this.register( owner );
140143

141144
} else {
145+
142146
// Support array or space separated string of keys
143147
if ( jQuery.isArray( key ) ) {
148+
144149
// If "name" is an array of keys...
145150
// When data is initially created, via ("key", "val") signature,
146151
// keys will be converted to camelCase.
@@ -150,10 +155,12 @@ Data.prototype = {
150155
name = key.concat( key.map( jQuery.camelCase ) );
151156
} else {
152157
camel = jQuery.camelCase( key );
158+
153159
// Try the string as a key before any manipulation
154160
if ( key in cache ) {
155161
name = [ key, camel ];
156162
} else {
163+
157164
// If a key with the spaces exists, use it.
158165
// Otherwise, create an array by matching non-whitespace
159166
name = camel;

src/deferred.js

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ define( [
44
"./callbacks"
55
], function( jQuery, slice ) {
66

7-
jQuery.extend({
7+
jQuery.extend( {
88

99
Deferred: function( func ) {
1010
var tuples = [
11+
1112
// action, add listener, listener list, final state
12-
[ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
13-
[ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
14-
[ "notify", "progress", jQuery.Callbacks("memory") ]
13+
[ "resolve", "done", jQuery.Callbacks( "once memory" ), "resolved" ],
14+
[ "reject", "fail", jQuery.Callbacks( "once memory" ), "rejected" ],
15+
[ "notify", "progress", jQuery.Callbacks( "memory" ) ]
1516
],
1617
state = "pending",
1718
promise = {
@@ -24,11 +25,12 @@ jQuery.extend({
2425
},
2526
then: function( /* fnDone, fnFail, fnProgress */ ) {
2627
var fns = arguments;
27-
return jQuery.Deferred(function( newDefer ) {
28+
return jQuery.Deferred( function( newDefer ) {
2829
jQuery.each( tuples, function( i, tuple ) {
2930
var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
31+
3032
// deferred[ done | fail | progress ] for forwarding actions to newDefer
31-
deferred[ tuple[1] ](function() {
33+
deferred[ tuple[ 1 ] ]( function() {
3234
var returned = fn && fn.apply( this, arguments );
3335
if ( returned && jQuery.isFunction( returned.promise ) ) {
3436
returned.promise()
@@ -46,6 +48,7 @@ jQuery.extend({
4648
fns = null;
4749
} ).promise();
4850
},
51+
4952
// Get a promise for this deferred
5053
// If obj is provided, the promise aspect is added to the object
5154
promise: function( obj ) {
@@ -63,11 +66,12 @@ jQuery.extend({
6366
stateString = tuple[ 3 ];
6467

6568
// promise[ done | fail | progress ] = list.add
66-
promise[ tuple[1] ] = list.add;
69+
promise[ tuple[ 1 ] ] = list.add;
6770

6871
// Handle state
6972
if ( stateString ) {
70-
list.add(function() {
73+
list.add( function() {
74+
7175
// state = [ resolved | rejected ]
7276
state = stateString;
7377

@@ -76,12 +80,13 @@ jQuery.extend({
7680
}
7781

7882
// deferred[ resolve | reject | notify ]
79-
deferred[ tuple[0] ] = function() {
80-
deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
83+
deferred[ tuple[ 0 ] ] = function() {
84+
deferred[ tuple[ 0 ] + "With" ]( this === deferred ? promise : this, arguments );
8185
return this;
8286
};
83-
deferred[ tuple[0] + "With" ] = list.fireWith;
84-
});
87+
deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
88+
} );
89+
8590
// Make the deferred a promise
8691
promise.promise( deferred );
8792

src/offset.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ jQuery.fn.extend( {
7777
if ( arguments.length ) {
7878
return options === undefined ?
7979
this :
80-
this.each(function( i ) {
80+
this.each( function( i ) {
8181
jQuery.offset.setOffset( this, options, i );
82-
});
82+
} );
8383
}
8484

8585
var docElem, win,

src/wrap.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ jQuery.fn.extend( {
6464
},
6565

6666
unwrap: function() {
67-
return this.parent().each(function() {
67+
return this.parent().each( function() {
6868
if ( !jQuery.nodeName( this, "body" ) ) {
6969
jQuery( this ).replaceWith( this.childNodes );
7070
}
71-
}).end();
71+
} ).end();
7272
}
7373
} );
7474

test/data/badjson.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{bad: toTheBone}
1+
{bad: toTheBone;}

test/data/testinit.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ this.iframeCallback = undefined;
269269
// Tests are always loaded async
270270
QUnit.config.autostart = false;
271271
this.loadTests = function() {
272+
272273
// Leverage QUnit URL parsing to detect testSwarm environment and "basic" testing mode
273274
var loadSwarm = ( QUnit.urlParams[ "swarmURL" ] + "" ).indexOf( "http" ) === 0,
274275
basicTests = ( QUnit.urlParams[ "module" ] + "" ) === "basic";
@@ -277,6 +278,7 @@ this.loadTests = function() {
277278
require( [ "data/testrunner.js" ], function() {
278279
var i = 0,
279280
tests = [
281+
280282
// A special module with basic tests, meant for
281283
// not fully supported environments like Android 2.3,
282284
// jsdom or PhantomJS. We run it everywhere, though,

test/unit/ajax.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1586,11 +1586,11 @@ if ( typeof window.ArrayBuffer === "undefined" || typeof new XMLHttpRequest().re
15861586
} else {
15871587

15881588
// No built-in support for binary data, but it's easy to add via a prefilter
1589-
jQuery.ajaxPrefilter( "arraybuffer", function ( s ) {
1589+
jQuery.ajaxPrefilter( "arraybuffer", function( s ) {
15901590
s.xhrFields = { responseType: "arraybuffer" };
15911591
s.responseFields.arraybuffer = "response";
15921592
s.converters[ "binary arraybuffer" ] = true;
1593-
});
1593+
} );
15941594

15951595
ajaxTest( "gh-2498 - jQuery.ajax() - binary data shouldn't throw an exception", 2, function( assert ) {
15961596
return {
@@ -1828,7 +1828,7 @@ if ( typeof window.ArrayBuffer === "undefined" || typeof new XMLHttpRequest().re
18281828
url: url( "data/ajax/content-type.php" ),
18291829
data: {
18301830
"content-type": "test/jsontest",
1831-
"response": JSON.stringify({test: "test"})
1831+
"response": JSON.stringify( { test: "test" } )
18321832
},
18331833
success: function( result ) {
18341834
assert.strictEqual(

test/unit/attributes.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -737,9 +737,9 @@ QUnit.test( "prop('tabindex')", function( assert ) {
737737

738738
QUnit.test( "image.prop( 'tabIndex' )", function( assert ) {
739739
assert.expect( 1 );
740-
var image = jQuery("<img src='data/1x1.jpg' />")
741-
.appendTo("#qunit-fixture");
742-
assert.equal( image.prop("tabIndex" ), -1, "tabIndex on image" );
740+
var image = jQuery( "<img src='data/1x1.jpg' />" )
741+
.appendTo( "#qunit-fixture" );
742+
assert.equal( image.prop( "tabIndex" ), -1, "tabIndex on image" );
743743
} );
744744

745745
QUnit.test( "prop('tabindex', value)", function( assert ) {

test/unit/core.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ QUnit.test( "jQuery()", function( assert ) {
3838
}
3939
if ( jQuery.fn.offset ) {
4040
expected++;
41-
attrObj["offset"] = { "top": 1, "left": 1 };
41+
attrObj[ "offset" ] = { "top": 1, "left": 1 };
4242
}
4343
if ( jQuery.fn.css ) {
4444
expected += 2;
@@ -95,7 +95,7 @@ QUnit.test( "jQuery()", function( assert ) {
9595
assert.equal( div.length, 4, "Correct number of elements generated for div hr code b" );
9696
assert.equal( div.parent().length, 0, "Make sure that the generated HTML has no parent." );
9797

98-
assert.equal( jQuery( [ 1,2,3 ] ).get( 1 ), 2, "Test passing an array to the factory" );
98+
assert.equal( jQuery( [ 1, 2, 3 ] ).get( 1 ), 2, "Test passing an array to the factory" );
9999

100100
assert.equal( jQuery( document.body ).get( 0 ), jQuery( "body" ).get( 0 ), "Test passing an html node to the factory" );
101101

@@ -105,14 +105,14 @@ QUnit.test( "jQuery()", function( assert ) {
105105
elem = jQuery( "\n\n<em>world</em>" )[ 0 ];
106106
assert.equal( elem.nodeName.toLowerCase(), "em", "leading newlines" );
107107

108-
elem = jQuery("<div/>", attrObj );
108+
elem = jQuery( "<div/>", attrObj );
109109

110110
if ( jQuery.fn.width ) {
111111
assert.equal( elem[ 0 ].style.width, "10px", "jQuery() quick setter width" );
112112
}
113113

114114
if ( jQuery.fn.offset ) {
115-
equal( elem[0].style.top, "1px", "jQuery() quick setter offset");
115+
assert.equal( elem[ 0 ].style.top, "1px", "jQuery() quick setter offset" );
116116
}
117117

118118
if ( jQuery.fn.css ) {
@@ -273,8 +273,9 @@ QUnit.test( "type", function( assert ) {
273273
} );
274274

275275
QUnit.test( "type for `Symbol`", function( assert ) {
276+
276277
// Prevent reference errors
277-
if( typeof Symbol !== "function" ) {
278+
if ( typeof Symbol !== "function" ) {
278279
assert.expect( 0 );
279280
return;
280281
}
@@ -283,7 +284,7 @@ QUnit.test( "type for `Symbol`", function( assert ) {
283284

284285
assert.equal( jQuery.type( Symbol() ), "symbol", "Symbol" );
285286
assert.equal( jQuery.type( Object( Symbol() ) ), "symbol", "Symbol" );
286-
});
287+
} );
287288

288289
QUnit.asyncTest( "isPlainObject", function( assert ) {
289290
assert.expect( 15 );
@@ -361,7 +362,6 @@ QUnit[ typeof Symbol === "function" ? "test" : "skip" ]( "isPlainObject(Symbol)"
361362
assert.equal( jQuery.isPlainObject( Object( Symbol() ) ), false, "Symbol inside an object" );
362363
} );
363364

364-
365365
QUnit.test( "isFunction", function( assert ) {
366366
assert.expect( 19 );
367367

@@ -913,7 +913,7 @@ QUnit.test( "jQuery.map", function( assert ) {
913913
assert.ok( !result, "empty NodeList treated like array" );
914914

915915
result = jQuery.map( Array( 4 ), function( v, k ) {
916-
return k % 2 ? k : [ k,k,k ];
916+
return k % 2 ? k : [ k, k, k ];
917917
} );
918918
assert.equal( result.join( "" ), "00012223", "Array results flattened (#2616)" );
919919
} );
@@ -1065,7 +1065,7 @@ QUnit.test( "jQuery.grep(Array-like)", function( assert ) {
10651065
[],
10661066
"Satisfying elements absent, Array-like object used, and grep explicitly uninverted"
10671067
);
1068-
});
1068+
} );
10691069

10701070
QUnit.test( "jQuery.extend(Object, Object)", function( assert ) {
10711071
assert.expect( 28 );
@@ -1183,19 +1183,19 @@ QUnit.test( "jQuery.extend(Object, Object)", function( assert ) {
11831183
QUnit.test( "jQuery.extend(Object, Object {created with \"defineProperties\"})", function( assert ) {
11841184
assert.expect( 2 );
11851185

1186-
var definedObj = Object.defineProperties({}, {
1186+
var definedObj = Object.defineProperties( {}, {
11871187
"enumerableProp": {
1188-
get: function () {
1188+
get: function() {
11891189
return true;
11901190
},
11911191
enumerable: true
11921192
},
11931193
"nonenumerableProp": {
1194-
get: function () {
1194+
get: function() {
11951195
return true;
11961196
}
11971197
}
1198-
}),
1198+
} ),
11991199
accessorObj = {};
12001200

12011201
jQuery.extend( accessorObj, definedObj );
@@ -1253,7 +1253,7 @@ QUnit.test( "jQuery.each(Object,Function)", function( assert ) {
12531253
assert.deepEqual( seen, [ 1, 2 ], "Broken array iteration" );
12541254

12551255
seen = [];
1256-
jQuery.each( { "a": 1, "b": 2,"c": 3 }, function( k, v ) {
1256+
jQuery.each( { "a": 1, "b": 2, "c": 3 }, function( k, v ) {
12571257
seen.push( v );
12581258
return false;
12591259
} );
@@ -1373,7 +1373,7 @@ QUnit.test( "jQuery.makeArray", function( assert ) {
13731373

13741374
assert.equal( ( function() { return jQuery.makeArray( arguments ); } )( 1, 2 ).join( "" ), "12", "Pass makeArray an arguments array" );
13751375

1376-
assert.equal( jQuery.makeArray( [ 1,2,3 ] ).join( "" ), "123", "Pass makeArray a real array" );
1376+
assert.equal( jQuery.makeArray( [ 1, 2, 3 ] ).join( "" ), "123", "Pass makeArray a real array" );
13771377

13781378
assert.equal( jQuery.makeArray().length, 0, "Pass nothing to makeArray and expect an empty array" );
13791379

0 commit comments

Comments
 (0)