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

Commit b308742

Browse files
committed
docs(jqLite): update the minErr codes for on() and off()
1 parent 3824e40 commit b308742

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@ngdoc error
2-
@name jqLite:off_args
2+
@name jqLite:offargs
33
@fullName Invalid jqLite#off() parameter
44
@description
55

66
This error occurs when trying to pass too many arguments to `jqLite#off`. Note
7-
that `jqLite#off` does not support namespaces or selectors like jQuery.
7+
that `jqLite#off` does not support namespaces or selectors like jQuery.

docs/content/error/jqLite/on_args.ngdoc renamed to docs/content/error/jqLite/onargs.ngdoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@ngdoc error
2-
@name jqLite:on_args
2+
@name jqLite:onargs
33
@fullName Invalid jqLite#on() Parameters
44
@description
55

src/jqLite.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ function JQLiteDealoc(element){
194194
}
195195

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

199199
var events = JQLiteExpandoStore(element, 'events'),
200200
handle = JQLiteExpandoStore(element, 'handle');
@@ -633,7 +633,7 @@ forEach({
633633
dealoc: JQLiteDealoc,
634634

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

638638
var events = JQLiteExpandoStore(element, 'events'),
639639
handle = JQLiteExpandoStore(element, 'handle');

test/jqLiteSpec.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -886,15 +886,15 @@ describe('jqLite', function() {
886886

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

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

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

899899
});
900900
}
@@ -1059,7 +1059,7 @@ describe('jqLite', function() {
10591059
aElem.on('click', noop);
10601060
expect(function () {
10611061
aElem.off('click', noop, '.test');
1062-
}).toThrowMatching(/\[jqLite:off_args\]/);
1062+
}).toThrowMatching(/\[jqLite:offargs\]/);
10631063
});
10641064
}
10651065
});

0 commit comments

Comments
 (0)