Permalink
Browse files

Allow aok.result() overloads.

  • Loading branch information...
1 parent 28f6691 commit 39ed34164b6f9ab8bb5c559cc84680157e6c57b5 @ryanve committed Nov 3, 2013
Showing with 10 additions and 12 deletions.
  1. +4 −5 aok.js
  2. +2 −2 aok.min.js
  3. +1 −1 package.json
  4. +3 −4 src/index.js
View
9 aok.js
@@ -1,5 +1,5 @@
/*!
- * aok 1.6.0+201311030705
+ * aok 1.6.1+201311030740
* https://github.com/ryanve/aok
* MIT License 2013 Ryan Van Etten
*/
@@ -100,11 +100,10 @@
* @param {Object=} guard array methods
* @example result([1], 0) // 1
*/
- function result(o, k, guard) {
+ aok['result'] = function(o, k, guard) {
guard || k === guard ? (k = o, o = this) : (typeof k == 'function' ? k : k = o[k]);
return typeof k == 'function' ? k.call(o) : k;
- }
- aok['result'] = result;
+ };
/**
* Get a new function that uses try/catch to test if `fn` can run.
@@ -138,7 +137,7 @@
*/
implement['run'] = function() {
if (this === globe) throw new Error('@this');
- this['test'] = !!result(this, 'test');
+ this['test'] = !!aok['result'](this, 'test');
return this['handler']();
};
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -1,7 +1,7 @@
{
"name": "aok",
"description": "Extensible test suite API.",
- "version": "1.6.0",
+ "version": "1.6.1",
"homepage": "https://github.com/ryanve/aok",
"author": "Ryan Van Etten",
"keywords": ["testing", "test suite", "javascript", "ender", "browser", "server"],
View
@@ -94,11 +94,10 @@
* @param {Object=} guard array methods
* @example result([1], 0) // 1
*/
- function result(o, k, guard) {
+ aok['result'] = function(o, k, guard) {
guard || k === guard ? (k = o, o = this) : (typeof k == 'function' ? k : k = o[k]);
return typeof k == 'function' ? k.call(o) : k;
- }
- aok['result'] = result;
+ };
/**
* Get a new function that uses try/catch to test if `fn` can run.
@@ -132,7 +131,7 @@
*/
implement['run'] = function() {
if (this === globe) throw new Error('@this');
- this['test'] = !!result(this, 'test');
+ this['test'] = !!aok['result'](this, 'test');
return this['handler']();
};

0 comments on commit 39ed341

Please sign in to comment.