diff options
author | Timmy Willison <4timmywil@gmail.com> | 2017-12-11 12:58:35 -0500 |
---|---|---|
committer | Timmy Willison <4timmywil@gmail.com> | 2018-01-08 11:28:35 -0500 |
commit | 3a8e44745c014871bc56e94d91e57c45ae4be208 (patch) | |
tree | 35bfd2a7dc382712bbc26a9076c4d865e09ae58f /test/unit/core.js | |
parent | 909e0c99251ee56ec35db0e08d5b1e6219ac8fbc (diff) | |
download | jquery-3a8e44745c014871bc56e94d91e57c45ae4be208.tar.gz jquery-3a8e44745c014871bc56e94d91e57c45ae4be208.zip |
Core: deprecate jQuery.proxy (not slated for removal)
Fixes gh-2958
Close gh-3885
Diffstat (limited to 'test/unit/core.js')
-rw-r--r-- | test/unit/core.js | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/test/unit/core.js b/test/unit/core.js index 6778b14e9..7c7514ccc 100644 --- a/test/unit/core.js +++ b/test/unit/core.js @@ -1531,54 +1531,6 @@ QUnit.test( "jQuery.isEmptyObject", function( assert ) { // equal(true, jQuery.isEmptyObject(null), "isEmptyObject on null" ); } ); -QUnit.test( "jQuery.proxy", function( assert ) { - assert.expect( 9 ); - - var test2, test3, test4, fn, cb, - test = function() { - assert.equal( this, thisObject, "Make sure that scope is set properly." ); - }, - thisObject = { foo: "bar", method: test }; - - // Make sure normal works - test.call( thisObject ); - - // Basic scoping - jQuery.proxy( test, thisObject )(); - - // Another take on it - jQuery.proxy( thisObject, "method" )(); - - // Make sure it doesn't freak out - assert.equal( jQuery.proxy( null, thisObject ), undefined, "Make sure no function was returned." ); - - // Partial application - test2 = function( a ) { - assert.equal( a, "pre-applied", "Ensure arguments can be pre-applied." ); - }; - jQuery.proxy( test2, null, "pre-applied" )(); - - // Partial application w/ normal arguments - test3 = function( a, b ) { - assert.equal( b, "normal", "Ensure arguments can be pre-applied and passed as usual." ); - }; - jQuery.proxy( test3, null, "pre-applied" )( "normal" ); - - // Test old syntax - test4 = { "meth": function( a ) { - assert.equal( a, "boom", "Ensure old syntax works." ); - } }; - jQuery.proxy( test4, "meth" )( "boom" ); - - // jQuery 1.9 improved currying with `this` object - fn = function() { - assert.equal( Array.prototype.join.call( arguments, "," ), "arg1,arg2,arg3", "args passed" ); - assert.equal( this.foo, "bar", "this-object passed" ); - }; - cb = jQuery.proxy( fn, null, "arg1", "arg2" ); - cb.call( thisObject, "arg3" ); -} ); - QUnit.test( "jQuery.parseHTML", function( assert ) { assert.expect( 23 ); |