Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd2436df

Browse files
authored
Core: Drop the root parameter of jQuery.fn.init
The third parameter of `jQuery.fn.init` - `root` - was just needed to support`jQuery.sub`. Since this API has been removed in jQuery 1.9.0 and Migrate 3.xis not filling it in, this parameter is no longer needed.This parameter has never been documented but it's safer to remove it in a majorupdate.Closesgh-5096
1 parent8cf39b7 commitd2436df

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

‎src/core/init.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,14 @@ var rootjQuery,
1515
// Shortcut simple #id case for speed
1616
rquickExpr=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,
1717

18-
init=jQuery.fn.init=function(selector,context,root){
18+
init=jQuery.fn.init=function(selector,context){
1919
varmatch,elem;
2020

2121
// HANDLE: $(""), $(null), $(undefined), $(false)
2222
if(!selector){
2323
returnthis;
2424
}
2525

26-
// Method init() accepts an alternate rootjQuery
27-
// so migrate can support jQuery.sub (gh-2101)
28-
root=root||rootjQuery;
29-
3026
// HANDLE: $(DOMElement)
3127
if(selector.nodeType){
3228
this[0]=selector;
@@ -36,8 +32,8 @@ var rootjQuery,
3632
// HANDLE: $(function)
3733
// Shortcut for document ready
3834
}elseif(typeofselector==="function"){
39-
returnroot.ready!==undefined ?
40-
root.ready(selector) :
35+
returnrootjQuery.ready!==undefined ?
36+
rootjQuery.ready(selector) :
4137

4238
// Execute immediately if ready is not present
4339
selector(jQuery);
@@ -108,7 +104,7 @@ var rootjQuery,
108104

109105
// HANDLE: $(expr) & $(expr, $(...))
110106
}elseif(!context||context.jquery){
111-
return(context||root).find(selector);
107+
return(context||rootjQuery).find(selector);
112108

113109
// HANDLE: $(expr, context)
114110
// (which is just equivalent to: $(context).find(expr)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp