@@ -25,9 +25,9 @@ requirejs.config( {
2525 }
2626} ) ;
2727
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 ;
3131
3232 return $ ;
3333} ) ;
@@ -53,10 +53,12 @@ function requireModules( dependencies, callback, modules ) {
5353}
5454
5555// 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 = [
5860 "lib/qunit" ,
59- noBackCompat ? "jquery-no -back-compat" : "jquery" ,
61+ backCompat ? "jquery-back-compat" : "jquery" ,
6062 "jquery-simulate"
6163 ] ;
6264
@@ -136,7 +138,7 @@ function migrateUrl() {
136138// - data-widget: A widget to load test modules for
137139// - Automatically loads common, core, events, methods, and options
138140// - 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`
140142( function ( ) {
141143
142144 // Find the script element
@@ -154,7 +156,7 @@ function migrateUrl() {
154156 }
155157 var widget = script . getAttribute ( "data-widget" ) ;
156158 var deprecated = ! ! script . getAttribute ( "data-deprecated" ) ;
157- var noBackCompat = ! ! script . getAttribute ( "data-no -back-compat" ) ;
159+ var backCompat = ! ! script . getAttribute ( "data-back-compat" ) ;
158160
159161 if ( widget ) {
160162 modules = modules . concat ( [
@@ -177,7 +179,7 @@ function migrateUrl() {
177179 modules . unshift ( "ui/jquery-patch" ) ;
178180 }
179181
180- requireTests ( modules , noBackCompat ) ;
182+ requireTests ( modules , { backCompat : backCompat } ) ;
181183} ) ( ) ;
182184
183185} ) ( ) ;
0 commit comments