aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/callbacks.js
diff options
context:
space:
mode:
authorjaubourg <j@ubourg.net>2012-08-16 19:12:59 +0200
committerjaubourg <j@ubourg.net>2012-08-16 19:12:59 +0200
commit9d07525a71e7bc12f606d8015d21425c5580e262 (patch)
treec10b8a4d577ac21e8bafef17f6dbb174402e734d /test/unit/callbacks.js
parentb292c4c2df673d17d8c720e13d4d81ecae4ec499 (diff)
downloadjquery-9d07525a71e7bc12f606d8015d21425c5580e262.tar.gz
jquery-9d07525a71e7bc12f606d8015d21425c5580e262.zip
Makes sure "adding" a string to a Callbacks object doesn't cause a stack overflow, just ignore the value like 1.7.x righfully did. Fixes #12233. Unit tests added.
Diffstat (limited to 'test/unit/callbacks.js')
-rw-r--r--test/unit/callbacks.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/unit/callbacks.js b/test/unit/callbacks.js
index 2bc5c92d6..2c708bb59 100644
--- a/test/unit/callbacks.js
+++ b/test/unit/callbacks.js
@@ -250,3 +250,12 @@ test( "jQuery.Callbacks.remove - should remove all instances", function() {
ok( true, "end of test" );
}).remove( fn ).fire();
});
+
+test( "jQuery.Callbacks() - adding a string doesn't cause a stack overflow", function() {
+
+ expect( 1 );
+
+ jQuery.Callbacks().add( "hello world" );
+
+ ok( true, "no stack overflow" );
+});