mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-16 23:30:23 +00:00
parent
5c56011742
commit
4f5dfbc362
2 changed files with 14 additions and 3 deletions
|
|
@ -193,8 +193,8 @@ function JQLiteDealoc(element){
|
|||
}
|
||||
}
|
||||
|
||||
function JQLiteOff(element, type, fn) {
|
||||
if ( arguments.length > 4 ) throw jqLiteMinErr('off_args', 'jqLite#off() does not support the `selector` parameter');
|
||||
function JQLiteOff(element, type, fn, selector) {
|
||||
if (isDefined(selector)) throw jqLiteMinErr('off_args', 'jqLite#off() does not support the `selector` argument');
|
||||
|
||||
var events = JQLiteExpandoStore(element, 'events'),
|
||||
handle = JQLiteExpandoStore(element, 'handle');
|
||||
|
|
|
|||
|
|
@ -901,7 +901,7 @@ describe('jqLite', function() {
|
|||
});
|
||||
|
||||
|
||||
describe('unbind', function() {
|
||||
describe('off', function() {
|
||||
it('should do nothing when no listener was registered with bound', function() {
|
||||
var aElem = jqLite(a);
|
||||
|
||||
|
|
@ -1051,6 +1051,17 @@ describe('jqLite', function() {
|
|||
expect(masterSpy).not.toHaveBeenCalled();
|
||||
expect(extraSpy).toHaveBeenCalledOnce();
|
||||
});
|
||||
|
||||
// Only run this test for jqLite and not normal jQuery
|
||||
if ( _jqLiteMode ) {
|
||||
it('should throw an error if a selector is passed', function () {
|
||||
var aElem = jqLite(a);
|
||||
aElem.on('click', noop);
|
||||
expect(function () {
|
||||
aElem.off('click', noop, '.test');
|
||||
}).toThrowMatching(/\[jqLite:off_args\]/);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue