Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Commit

Permalink
docs(jqLite): update the minErr codes for on() and off()
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorMinar committed Aug 9, 2013
1 parent 3824e40 commit b308742
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@ngdoc error
@name jqLite:off_args
@name jqLite:offargs
@fullName Invalid jqLite#off() parameter
@description

This error occurs when trying to pass too many arguments to `jqLite#off`. Note
that `jqLite#off` does not support namespaces or selectors like jQuery.
that `jqLite#off` does not support namespaces or selectors like jQuery.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@ngdoc error
@name jqLite:on_args
@name jqLite:onargs
@fullName Invalid jqLite#on() Parameters
@description

Expand Down
4 changes: 2 additions & 2 deletions src/jqLite.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ function JQLiteDealoc(element){
}

function JQLiteOff(element, type, fn, unsupported) {
if (isDefined(unsupported)) throw jqLiteMinErr('off_args', 'jqLite#off() does not support the `selector` argument');
if (isDefined(unsupported)) throw jqLiteMinErr('offargs', 'jqLite#off() does not support the `selector` argument');

var events = JQLiteExpandoStore(element, 'events'),
handle = JQLiteExpandoStore(element, 'handle');
Expand Down Expand Up @@ -633,7 +633,7 @@ forEach({
dealoc: JQLiteDealoc,

on: function onFn(element, type, fn, unsupported){
if (isDefined(unsupported)) throw jqLiteMinErr('on_args', 'jqLite#on() does not support the `selector` or `eventData` parameters');
if (isDefined(unsupported)) throw jqLiteMinErr('onargs', 'jqLite#on() does not support the `selector` or `eventData` parameters');

var events = JQLiteExpandoStore(element, 'events'),
handle = JQLiteExpandoStore(element, 'handle');
Expand Down
8 changes: 4 additions & 4 deletions test/jqLiteSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -886,15 +886,15 @@ describe('jqLite', function() {

expect(function() {
elm.on('click', anObj, callback);
}).toThrow();
}).toThrowMatching(/\[jqLite\:onargs\]/);

expect(function() {
elm.on('click', null, aString, callback);
}).toThrow();
}).toThrowMatching(/\[jqLite\:onargs\]/);

expect(function() {
elm.on('click', aValue, callback);
}).toThrow();
}).toThrowMatching(/\[jqLite\:onargs\]/);

});
}
Expand Down Expand Up @@ -1059,7 +1059,7 @@ describe('jqLite', function() {
aElem.on('click', noop);
expect(function () {
aElem.off('click', noop, '.test');
}).toThrowMatching(/\[jqLite:off_args\]/);
}).toThrowMatching(/\[jqLite:offargs\]/);
});
}
});
Expand Down

0 comments on commit b308742

Please sign in to comment.