@@ -25,9 +25,9 @@ requirejs.config( {
25
25
}
26
26
} ) ;
27
27
28
- // Create a module that disables back compat for UI modules
29
- define ( "jquery-no- back-compat" , [ "jquery" ] , function ( $ ) {
30
- $ . uiBackCompat = false ;
28
+ // Create a module that enables back compat for UI modules
29
+ define ( "jquery-back-compat" , [ "jquery" ] , function ( $ ) {
30
+ $ . uiBackCompat = true ;
31
31
32
32
return $ ;
33
33
} ) ;
@@ -53,10 +53,12 @@ function requireModules( dependencies, callback, modules ) {
53
53
}
54
54
55
55
// Load a set of test file along with the required test infrastructure
56
- function requireTests ( dependencies , noBackCompat ) {
57
- var preDependencies = [
56
+ function requireTests ( dependencies , options ) {
57
+
58
+ var backCompat = ! ! ( options && options . backCompat ) ,
59
+ preDependencies = [
58
60
"lib/qunit" ,
59
- noBackCompat ? "jquery-no -back-compat" : "jquery" ,
61
+ backCompat ? "jquery-back-compat" : "jquery" ,
60
62
"jquery-simulate"
61
63
] ;
62
64
@@ -136,7 +138,7 @@ function migrateUrl() {
136
138
// - data-widget: A widget to load test modules for
137
139
// - Automatically loads common, core, events, methods, and options
138
140
// - data-deprecated: Loads the deprecated test modules for a widget
139
- // - data-no- back-compat: Set $.uiBackCompat to false
141
+ // - data-back-compat: Set $.uiBackCompat to `true`
140
142
( function ( ) {
141
143
142
144
// Find the script element
@@ -154,7 +156,7 @@ function migrateUrl() {
154
156
}
155
157
var widget = script . getAttribute ( "data-widget" ) ;
156
158
var deprecated = ! ! script . getAttribute ( "data-deprecated" ) ;
157
- var noBackCompat = ! ! script . getAttribute ( "data-no -back-compat" ) ;
159
+ var backCompat = ! ! script . getAttribute ( "data-back-compat" ) ;
158
160
159
161
if ( widget ) {
160
162
modules = modules . concat ( [
@@ -177,7 +179,7 @@ function migrateUrl() {
177
179
modules . unshift ( "ui/jquery-patch" ) ;
178
180
}
179
181
180
- requireTests ( modules , noBackCompat ) ;
182
+ requireTests ( modules , { backCompat : backCompat } ) ;
181
183
} ) ( ) ;
182
184
183
185
} ) ( ) ;
0 commit comments