Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.{yml}]
[*.yml]
indent_style = space
indent_size = 2
2 changes: 1 addition & 1 deletion src/disablePatches.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
var disabledPatches = Object.create( null );

// Don't apply patches for specified codes. Helpful for code bases
// where some Migrate warnings have been addressed and it's desirable
// where some Migrate warnings have been addressed, and it's desirable
// to avoid needless patches or false positives.
jQuery.migrateDisablePatches = function() {
var i;
Expand Down
2 changes: 1 addition & 1 deletion src/jquery/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ migratePatchFunc( jQuery.fn, "toggleClass", function( state ) {

// If the element has a class name or if we're passed `false`,
// then remove the whole classname (if there was one, the above saved it).
// Otherwise bring back whatever was previously saved (if anything),
// Otherwise, bring back whatever was previously saved (if anything),
// falling back to the empty string if nothing was stored.
if ( this.setAttribute ) {
this.setAttribute( "class",
Expand Down
4 changes: 2 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ window.console.log( "JQMIGRATE: Migrate is installed" +

var warnedAbout = {};

// By default each warning is only reported once.
// By default, each warning is only reported once.
jQuery.migrateDeduplicateWarnings = true;

// List of warnings already given; public read only
jQuery.migrateWarnings = [];

// Set to false to disable traces that appear with warnings
// Set to `false` to disable traces that appear with warnings
if ( jQuery.migrateTrace === undefined ) {
jQuery.migrateTrace = true;
}
Expand Down
4 changes: 2 additions & 2 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ export function camelCase( string ) {
} );
}

// Insert an additional object in the prototype chain between `objrvy`
// and `Object.prototype`; that intermediate object proxies properties
// Make `object` inherit from `Object.prototype` via an additional object
// in between; that intermediate object proxies properties
// to `Object.prototype`, warning about their usage first.
export function patchProto( object, options ) {

Expand Down
9 changes: 6 additions & 3 deletions test/data/test-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,18 @@ window.expectWarning = function expectWarning( assert, name, expected, fn ) {
if ( expected === 0 ) {
assert.deepEqual( jQuery.migrateWarnings, [], name + ": did not warn" );

// Simple numeric equality assertion for warnings matching an explicit count
// Simple numeric equality assertion for warnings matching an explicit
// count
} else if ( expected && jQuery.migrateWarnings.length === expected ) {
assert.equal( jQuery.migrateWarnings.length, expected, name + ": warned" );

// Simple ok assertion when we saw at least one warning and weren't looking for an explict count
// Simple ok assertion when we saw at least one warning and weren't
// looking for an explicit count
} else if ( !expected && jQuery.migrateWarnings.length ) {
assert.ok( true, name + ": warned" );

// Failure; use deepEqual to show the warnings that *were* generated and the expectation
// Failure; use deepEqual to show the warnings that *were* generated
// and the expectation
} else {
assert.deepEqual( jQuery.migrateWarnings,
"<warnings: " + ( expected || "1+" ) + ">", name + ": warned"
Expand Down
2 changes: 1 addition & 1 deletion test/unit/jquery/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ QUnit[
} );

// z-index is tested explicitly as raw jQuery 4.0 will not have `jQuery.cssNumber`
// so iterating over it won't find anything and we'd like to ensure number values
// so iterating over it won't find anything, and we'd like to ensure number values
// are not warned against for safe CSS props like z-index (gh-438).
expectNoWarning( assert, "z-index", function() {
jQuery( "<div />" ).css( "z-index", 1 );
Expand Down
54 changes: 31 additions & 23 deletions warnings.md

Large diffs are not rendered by default.

Loading