|
1 | 1 | /*! |
2 | | - * jQuery Migrate - v4.0.0-beta.1 - 2025-08-11T21:16Z |
| 2 | + * jQuery Migrate - v4.0.1 - 2026-01-18T00:35Z |
3 | 3 | * Copyright OpenJS Foundation and other contributors |
4 | 4 | * Released under the MIT license |
5 | 5 | * https://jquery.com/license/ |
|
26 | 26 | } )( function( jQuery, window ) { |
27 | 27 | "use strict"; |
28 | 28 |
|
29 | | -jQuery.migrateVersion = "4.0.0-beta.1"; |
| 29 | +jQuery.migrateVersion = "4.0.1"; |
30 | 30 |
|
31 | 31 | // Returns 0 if v1 == v2, -1 if v1 < v2, 1 if v1 > v2 |
32 | 32 | function compareVersions( v1, v2 ) { |
@@ -55,7 +55,7 @@ function jQueryVersionSince( version ) { |
55 | 55 | var disabledPatches = Object.create( null ); |
56 | 56 |
|
57 | 57 | // Don't apply patches for specified codes. Helpful for code bases |
58 | | -// where some Migrate warnings have been addressed and it's desirable |
| 58 | +// where some Migrate warnings have been addressed, and it's desirable |
59 | 59 | // to avoid needless patches or false positives. |
60 | 60 | jQuery.migrateDisablePatches = function() { |
61 | 61 | var i; |
@@ -260,6 +260,10 @@ var arr = [], |
260 | 260 | splice = arr.splice, |
261 | 261 | class2type = {}, |
262 | 262 |
|
| 263 | + // Matches dashed string for camelizing |
| 264 | + rmsPrefix = /^-ms-/, |
| 265 | + rdashAlpha = /-([a-z])/g, |
| 266 | + |
263 | 267 | // Require that the "whitespace run" starts from a non-whitespace |
264 | 268 | // to avoid O(N^2) behavior when the engine would try matching "\s+$" at each space position. |
265 | 269 | rtrim = /^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g; |
@@ -338,6 +342,26 @@ migratePatchAndWarnFunc( jQuery, "isWindow", |
338 | 342 | "jQuery.isWindow() is removed" |
339 | 343 | ); |
340 | 344 |
|
| 345 | +migratePatchAndWarnFunc( jQuery, "now", Date.now, "now", |
| 346 | + "jQuery.now() is removed; use Date.now()" |
| 347 | +); |
| 348 | + |
| 349 | +// Used by camelCase as callback to replace() |
| 350 | +function fcamelCase( _all, letter ) { |
| 351 | + return letter.toUpperCase(); |
| 352 | +} |
| 353 | + |
| 354 | +migratePatchAndWarnFunc( jQuery, "camelCase", |
| 355 | + function( string ) { |
| 356 | + |
| 357 | + // Convert dashed to camelCase; used by the css and data modules |
| 358 | + // Support: IE <=9 - 11, Edge 12 - 15 |
| 359 | + // Microsoft forgot to hump their vendor prefix (trac-9572) |
| 360 | + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); |
| 361 | + }, "camelCase", |
| 362 | + "jQuery.camelCase() is removed" |
| 363 | +); |
| 364 | + |
341 | 365 | // Bind a function to a context, optionally partially applying any |
342 | 366 | // arguments. |
343 | 367 | // jQuery.proxy is deprecated to promote standards (specifically Function#bind) |
@@ -652,7 +676,7 @@ migratePatchFunc( jQuery.fn, "toggleClass", function( state ) { |
652 | 676 |
|
653 | 677 | // If the element has a class name or if we're passed `false`, |
654 | 678 | // then remove the whole classname (if there was one, the above saved it). |
655 | | - // Otherwise bring back whatever was previously saved (if anything), |
| 679 | + // Otherwise, bring back whatever was previously saved (if anything), |
656 | 680 | // falling back to the empty string if nothing was stored. |
657 | 681 | if ( this.setAttribute ) { |
658 | 682 | this.setAttribute( "class", |
|
0 commit comments