From b3087421f20241f9bcb9b1f00ee9a30efc8b0899 Mon Sep 17 00:00:00 2001 From: Igor Minar Date: Fri, 9 Aug 2013 00:16:27 -0700 Subject: docs(jqLite): update the minErr codes for on() and off() --- docs/content/error/jqLite/off_args.ngdoc | 7 ------- docs/content/error/jqLite/offargs.ngdoc | 7 +++++++ docs/content/error/jqLite/on_args.ngdoc | 8 -------- docs/content/error/jqLite/onargs.ngdoc | 8 ++++++++ src/jqLite.js | 4 ++-- test/jqLiteSpec.js | 8 ++++---- 6 files changed, 21 insertions(+), 21 deletions(-) delete mode 100644 docs/content/error/jqLite/off_args.ngdoc create mode 100644 docs/content/error/jqLite/offargs.ngdoc delete mode 100644 docs/content/error/jqLite/on_args.ngdoc create mode 100644 docs/content/error/jqLite/onargs.ngdoc diff --git a/docs/content/error/jqLite/off_args.ngdoc b/docs/content/error/jqLite/off_args.ngdoc deleted file mode 100644 index 04147242..00000000 --- a/docs/content/error/jqLite/off_args.ngdoc +++ /dev/null @@ -1,7 +0,0 @@ -@ngdoc error -@name jqLite:off_args -@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. \ No newline at end of file diff --git a/docs/content/error/jqLite/offargs.ngdoc b/docs/content/error/jqLite/offargs.ngdoc new file mode 100644 index 00000000..44e2ca7c --- /dev/null +++ b/docs/content/error/jqLite/offargs.ngdoc @@ -0,0 +1,7 @@ +@ngdoc error +@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. diff --git a/docs/content/error/jqLite/on_args.ngdoc b/docs/content/error/jqLite/on_args.ngdoc deleted file mode 100644 index cba1e530..00000000 --- a/docs/content/error/jqLite/on_args.ngdoc +++ /dev/null @@ -1,8 +0,0 @@ -@ngdoc error -@name jqLite:on_args -@fullName Invalid jqLite#on() Parameters -@description - -This error occurs when trying to pass too many arguments to `jqLite#on`. Note -that `jqLite#on` does not support the `selector` or `eventData` parameters as -jQuery does. diff --git a/docs/content/error/jqLite/onargs.ngdoc b/docs/content/error/jqLite/onargs.ngdoc new file mode 100644 index 00000000..34a96b3a --- /dev/null +++ b/docs/content/error/jqLite/onargs.ngdoc @@ -0,0 +1,8 @@ +@ngdoc error +@name jqLite:onargs +@fullName Invalid jqLite#on() Parameters +@description + +This error occurs when trying to pass too many arguments to `jqLite#on`. Note +that `jqLite#on` does not support the `selector` or `eventData` parameters as +jQuery does. diff --git a/src/jqLite.js b/src/jqLite.js index 76031182..6ac99987 100644 --- a/src/jqLite.js +++ b/src/jqLite.js @@ -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'); @@ -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'); diff --git a/test/jqLiteSpec.js b/test/jqLiteSpec.js index f8d71bc9..abfad064 100644 --- a/test/jqLiteSpec.js +++ b/test/jqLiteSpec.js @@ -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\]/); }); } @@ -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\]/); }); } }); -- cgit v1.2.3