( function() {
// Support: IE9 only
// IE9 only creates console object when dev tools are first opened
// Also, avoid Function#bind here to simplify PhantomJS usage
var log = window.console && window.console.log &&
function() { window.console.log.apply( window.console, arguments ); },
rbadVersions = /^[12]\./;
Iif ( !log ) {
return;
}
// Need jQuery 3.0.0+ and no older Migrate loaded
Iif ( !jQuery || rbadVersions.test( jQuery.fn.jquery ) ) {
log( "JQMIGRATE: jQuery 3.0.0+ REQUIRED" );
}
Iif ( jQuery.migrateWarnings ) {
log( "JQMIGRATE: Migrate plugin loaded multiple times" );
}
// Show a message on the console so devs know we're active
log( "JQMIGRATE: Migrate is installed" +
( jQuery.migrateMute ? "" : " with logging active" ) +
", version " + jQuery.migrateVersion );
} )();
var warnedAbout = {};
// List of warnings already given; public read only
jQuery.migrateWarnings = [];
// Set to false to disable traces that appear with warnings
Eif ( jQuery.migrateTrace === undefined ) {
jQuery.migrateTrace = true;
}
// Forget any warnings we've already given; public
jQuery.migrateReset = function() {
warnedAbout = {};
jQuery.migrateWarnings.length = 0;
};
function migrateWarn( msg ) {
var console = window.console;
if ( !warnedAbout[ msg ] ) {
warnedAbout[ msg ] = true;
jQuery.migrateWarnings.push( msg );
Iif ( console && console.warn && !jQuery.migrateMute ) {
console.warn( "JQMIGRATE: " + msg );
if ( jQuery.migrateTrace && console.trace ) {
console.trace();
}
}
}
}
function migrateWarnProp( obj, prop, value, msg ) {
Object.defineProperty( obj, prop, {
configurable: true,
enumerable: true,
get: function() {
migrateWarn( msg );
return value;
}
} );
}
Iif ( document.compatMode === "BackCompat" ) {
// JQuery has never supported or tested Quirks Mode
migrateWarn( "jQuery is not compatible with Quirks Mode" );
}
|