From 4122ae5db9084ca5cccaa74086b0fe8a133bf0d2 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Wed, 9 May 2012 19:01:22 -0700 Subject: [PATCH] Update utility docs --- lib/utils/addMethod.js | 6 +++--- lib/utils/addProperty.js | 6 +++--- lib/utils/overwriteMethod.js | 8 ++++---- lib/utils/overwriteProperty.js | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/utils/addMethod.js b/lib/utils/addMethod.js index d7e0b10..165f71f 100644 --- a/lib/utils/addMethod.js +++ b/lib/utils/addMethod.js @@ -9,7 +9,7 @@ * * Adds a method to the prototype of an object. * - * utils.addMethod(chai.Assertion, 'foo', function (str) { + * utils.addMethod(chai.Assertion.prototype, 'foo', function (str) { * var obj = utils.flag(this, 'object'); * new chai.Assertion(obj).to.be.equal(str); * }); @@ -18,9 +18,9 @@ * * expect(fooStr).to.be.foo('bar'); * - * @param {Function|Object} context (such as `chai.Assertion.prototype`) + * @param {Object} ctx object to which the method is added * @param {String} name of method to add - * @param {Function} method function to used for name + * @param {Function} method function to be used for name * @api public */ diff --git a/lib/utils/addProperty.js b/lib/utils/addProperty.js index 545b62f..3ba8238 100644 --- a/lib/utils/addProperty.js +++ b/lib/utils/addProperty.js @@ -9,7 +9,7 @@ * * Adds a property to the prototype of an object. * - * utils.addProperty(chai.Assertion, 'foo', function () { + * utils.addProperty(chai.Assertion.prototype, 'foo', function () { * var obj = utils.flag(this, 'object'); * new chai.Assertion(obj).to.be.instanceof(Foo); * }); @@ -18,9 +18,9 @@ * * expect(myFoo).to.be.foo; * - * @param {Function|Object} context (such as `chai.Assertion.prototype`) + * @param {Object} ctx object to which the property is added * @param {String} name of property to add - * @param {Function} getter function to used for name + * @param {Function} getter function to be used for name * @api public */ diff --git a/lib/utils/overwriteMethod.js b/lib/utils/overwriteMethod.js index 3cd28f5..7efc321 100644 --- a/lib/utils/overwriteMethod.js +++ b/lib/utils/overwriteMethod.js @@ -5,13 +5,13 @@ */ /** - * # overwriteProperty (ctx, name, fn) + * # overwriteMethod (ctx, name, fn) * * Overwites an already existing method and provides * access to previous function. Must return function * to be used for name. * - * utils.overwriteMethod(chai.Assertion, 'equal', function (_super) { + * utils.overwriteMethod(chai.Assertion.prototype, 'equal', function (_super) { * return function (str) { * var obj = utils.flag(this, 'object'); * if (obj instanceof Foo) { @@ -26,9 +26,9 @@ * * expect(myFoo).to.equal('bar'); * - * @param {Function|Object} context chai.Assertion || chai.Assertion.prototype + * @param {Object} ctx object whose method is to be overwritten * @param {String} name of method to overwrite - * @param {Function} method function to be used for name + * @param {Function} method function that returns a function to be used for name * @api public */ diff --git a/lib/utils/overwriteProperty.js b/lib/utils/overwriteProperty.js index cd7a34f..20c0d99 100644 --- a/lib/utils/overwriteProperty.js +++ b/lib/utils/overwriteProperty.js @@ -10,7 +10,7 @@ * Overwites an already existing property getter and provides * access to previous value. Must return function to use as getter. * - * utils.overwriteProperty(chai.Assertion, 'ok', function (_super) { + * utils.overwriteProperty(chai.Assertion.prototype, 'ok', function (_super) { * return function () { * var obj = utils.flag(this, 'object'); * if (obj instanceof Foo) { @@ -25,9 +25,9 @@ * * expect(myFoo).to.be.ok; * - * @param {Function|Object} context chai.Assertion || chai.Assertion.prototype + * @param {Object} ctx object whose property is to be overwritten * @param {String} name of property to overwrite - * @param {Function} method must return function to be used for name + * @param {Function} getter function that returns a getter function to be used for name * @api public */