More JSDoc cleanup. [closes #334]

Former-commit-id: dcb55079320e3bcd35c3bf4f36d18f393f16e426
This commit is contained in:
John-David Dalton
2013-08-26 22:01:44 -07:00
parent e322f6dbe2
commit c3f5bc6bfb
23 changed files with 1659 additions and 1631 deletions

View File

@@ -105,8 +105,8 @@
*
* @static
* @memberOf Benchmark
* @param {object} [context=window] The context object.
* @returns {function} Returns the `Benchmark` function.
* @param {Object} [context=window] The context object.
* @returns {Function} Returns the `Benchmark` function.
*/
function runInContext(context) {
// exit early if unable to acquire lodash
@@ -181,7 +181,7 @@
*
* @static
* @memberOf Benchmark
* @type object
* @type Object
*/
var support = {};
@@ -245,7 +245,7 @@
* Timer object used by `clock()` and `Deferred#resolve`.
*
* @private
* @type object
* @type Object
*/
var timer = {
@@ -254,7 +254,7 @@
*
* @private
* @memberOf timer
* @type {(function|object)}
* @type {Function|Object}
*/
'ns': Date,
@@ -263,7 +263,7 @@
*
* @private
* @memberOf timer
* @param {object} deferred The deferred instance.
* @param {Object} deferred The deferred instance.
*/
'start': null, // lazy defined in `clock()`
@@ -272,7 +272,7 @@
*
* @private
* @memberOf timer
* @param {object} deferred The deferred instance.
* @param {Object} deferred The deferred instance.
*/
'stop': null // lazy defined in `clock()`
};
@@ -284,8 +284,8 @@
*
* @constructor
* @param {string} name A name to identify the benchmark.
* @param {(function|string)} fn The test to benchmark.
* @param {object} [options={}] Options object.
* @param {Function|string} fn The test to benchmark.
* @param {Object} [options={}] Options object.
* @example
*
* // basic usage (the `new` operator is optional)
@@ -394,7 +394,7 @@
*
* @constructor
* @memberOf Benchmark
* @param {object} clone The cloned benchmark instance.
* @param {Object} clone The cloned benchmark instance.
*/
function Deferred(clone) {
var deferred = this;
@@ -410,7 +410,7 @@
*
* @constructor
* @memberOf Benchmark
* @param {(object|string)} type The event type.
* @param {Object|string} type The event type.
*/
function Event(type) {
var event = this;
@@ -428,7 +428,7 @@
* @constructor
* @memberOf Benchmark
* @param {string} name A name to identify the suite.
* @param {object} [options={}] Options object.
* @param {Object} [options={}] Options object.
* @example
*
* // basic usage (the `new` operator is optional)
@@ -499,7 +499,7 @@
* @private
* @param {string} args The comma separated function arguments.
* @param {string} body The function body.
* @returns {function} The new function.
* @returns {Function} The new function.
*/
function createFunction() {
// lazy define
@@ -523,8 +523,8 @@
* Delay the execution of a function based on the benchmark's `delay` property.
*
* @private
* @param {object} bench The benchmark instance.
* @param {object} fn The function to execute.
* @param {Object} bench The benchmark instance.
* @param {Object} fn The function to execute.
*/
function delay(bench, fn) {
bench._timerId = _.delay(fn, bench.delay * 1e3);
@@ -545,7 +545,7 @@
* Gets the name of the first argument from a function's source.
*
* @private
* @param {function} fn The function.
* @param {Function} fn The function.
* @returns {string} The argument name.
*/
function getFirstArgument(fn) {
@@ -558,7 +558,7 @@
* See http://en.wikipedia.org/wiki/Geometric_mean#Relationship_with_arithmetic_mean_of_logarithms.
*
* @private
* @param {array} sample The sample.
* @param {Array} sample The sample.
* @returns {number} The geometric mean.
*/
function getGeometricMean(sample) {
@@ -571,7 +571,7 @@
* Computes the arithmetic mean of a sample.
*
* @private
* @param {array} sample The sample.
* @param {Array} sample The sample.
* @returns {number} The mean.
*/
function getMean(sample) {
@@ -584,7 +584,7 @@
* Gets the source code of a function.
*
* @private
* @param {function} fn The function.
* @param {Function} fn The function.
* @param {string} altSource A string used when a function's source code is unretrievable.
* @returns {string} The function's source code.
*/
@@ -704,8 +704,8 @@
* A helper function for setting options/event handlers.
*
* @private
* @param {object} object The benchmark or suite instance.
* @param {object} [options={}] Options object.
* @param {Object} object The benchmark or suite instance.
* @param {Object} [options={}] Options object.
*/
function setOptions(object, options) {
options = _.extend({}, object.constructor.options, options);
@@ -758,10 +758,10 @@
*
* @static
* @memberOf Benchmark
* @param {array} array The array to iterate over.
* @param {(function|string)} callback The function/alias called per iteration.
* @param {Array} array The array to iterate over.
* @param {Function|string} callback The function/alias called per iteration.
* @param {*} thisArg The `this` binding for the callback.
* @returns {array} A new array of values that passed callback filter.
* @returns {Array} A new array of values that passed callback filter.
* @example
*
* // get odd numbers
@@ -818,10 +818,10 @@
*
* @static
* @memberOf Benchmark
* @param {array} benches Array of benchmarks to iterate over.
* @param {(object|string)} name The name of the method to invoke OR options object.
* @param {Array} benches Array of benchmarks to iterate over.
* @param {Object|string} name The name of the method to invoke OR options object.
* @param {...*} [arg] Arguments to invoke the method with.
* @returns {array} A new array of values returned from each method invoked.
* @returns {Array} A new array of values returned from each method invoked.
* @example
*
* // invoke `reset` on all benchmarks
@@ -999,7 +999,7 @@
*
* @static
* @memberOf Benchmark
* @param {(array|object)} object The object to operate on.
* @param {Array|Object} object The object to operate on.
* @param {string} [separator1=','] The separator used between key-value pairs.
* @param {string} [separator2=': '] The separator used between keys and values.
* @returns {string} The joined result.
@@ -1023,7 +1023,7 @@
*
* @name abort
* @memberOf Benchmark.Suite
* @returns {object} The suite instance.
* @returns {Object} The suite instance.
*/
function abortSuite() {
var event,
@@ -1053,9 +1053,9 @@
*
* @memberOf Benchmark.Suite
* @param {string} name A name to identify the benchmark.
* @param {(function|string)} fn The test to benchmark.
* @param {object} [options={}] Options object.
* @returns {object} The benchmark instance.
* @param {Function|string} fn The test to benchmark.
* @param {Object} [options={}] Options object.
* @returns {Object} The benchmark instance.
* @example
*
* // basic usage
@@ -1101,8 +1101,8 @@
*
* @name clone
* @memberOf Benchmark.Suite
* @param {object} options Options object to overwrite cloned options.
* @returns {object} The new suite instance.
* @param {Object} options Options object to overwrite cloned options.
* @returns {Object} The new suite instance.
*/
function cloneSuite(options) {
var suite = this,
@@ -1124,8 +1124,8 @@
*
* @name filter
* @memberOf Benchmark.Suite
* @param {(function|string)} callback The function/alias called per iteration.
* @returns {object} A new suite of benchmarks that passed callback filter.
* @param {Function|string} callback The function/alias called per iteration.
* @returns {Object} A new suite of benchmarks that passed callback filter.
*/
function filterSuite(callback) {
var suite = this,
@@ -1140,7 +1140,7 @@
*
* @name reset
* @memberOf Benchmark.Suite
* @returns {object} The suite instance.
* @returns {Object} The suite instance.
*/
function resetSuite() {
var event,
@@ -1169,8 +1169,8 @@
*
* @name run
* @memberOf Benchmark.Suite
* @param {object} [options={}] Options object.
* @returns {object} The suite instance.
* @param {Object} [options={}] Options object.
* @returns {Object} The suite instance.
* @example
*
* // basic usage
@@ -1215,7 +1215,7 @@
* Executes all registered listeners of the specified event type.
*
* @memberOf Benchmark, Benchmark.Suite
* @param {(object|string)} type The event type or object.
* @param {Object|string} type The event type or object.
* @returns {*} Returns the return value of the last listener executed.
*/
function emit(type) {
@@ -1246,7 +1246,7 @@
*
* @memberOf Benchmark, Benchmark.Suite
* @param {string} type The event type.
* @returns {array} The listeners array.
* @returns {Array} The listeners array.
*/
function listeners(type) {
var object = this,
@@ -1262,8 +1262,8 @@
*
* @memberOf Benchmark, Benchmark.Suite
* @param {string} [type] The event type.
* @param {function} [listener] The function to unregister.
* @returns {object} The benchmark instance.
* @param {Function} [listener] The function to unregister.
* @returns {Object} The benchmark instance.
* @example
*
* // unregister a listener for an event type
@@ -1313,8 +1313,8 @@
*
* @memberOf Benchmark, Benchmark.Suite
* @param {string} type The event type.
* @param {function} listener The function to register.
* @returns {object} The benchmark instance.
* @param {Function} listener The function to register.
* @returns {Object} The benchmark instance.
* @example
*
* // register a listener for an event type
@@ -1342,7 +1342,7 @@
* Aborts the benchmark without recording times.
*
* @memberOf Benchmark
* @returns {object} The benchmark instance.
* @returns {Object} The benchmark instance.
*/
function abort() {
var event,
@@ -1375,8 +1375,8 @@
* Creates a new benchmark using the same test and options.
*
* @memberOf Benchmark
* @param {object} options Options object to overwrite cloned options.
* @returns {object} The new benchmark instance.
* @param {Object} options Options object to overwrite cloned options.
* @returns {Object} The new benchmark instance.
* @example
*
* var bizarro = bench.clone({
@@ -1405,7 +1405,7 @@
* Determines if a benchmark is faster than another.
*
* @memberOf Benchmark
* @param {object} other The benchmark to compare.
* @param {Object} other The benchmark to compare.
* @returns {number} Returns `-1` if slower, `1` if faster, and `0` if indeterminate.
*/
function compare(other) {
@@ -1459,7 +1459,7 @@
* Reset properties and abort if running.
*
* @memberOf Benchmark
* @returns {object} The benchmark instance.
* @returns {Object} The benchmark instance.
*/
function reset() {
var data,
@@ -1557,7 +1557,7 @@
* Clocks the time taken to execute a test per cycle (secs).
*
* @private
* @param {object} bench The benchmark instance.
* @param {Object} bench The benchmark instance.
* @returns {number} The time taken.
*/
function clock() {
@@ -1872,8 +1872,8 @@
* Computes stats on benchmark results.
*
* @private
* @param {object} bench The benchmark instance.
* @param {object} options The options object.
* @param {Object} bench The benchmark instance.
* @param {Object} options The options object.
*/
function compute(bench, options) {
options || (options = {});
@@ -2026,8 +2026,8 @@
* Cycles a benchmark until a run `count` can be established.
*
* @private
* @param {object} clone The cloned benchmark instance.
* @param {object} options The options object.
* @param {Object} clone The cloned benchmark instance.
* @param {Object} options The options object.
*/
function cycle(clone, options) {
options || (options = {});
@@ -2130,8 +2130,8 @@
* Runs the benchmark.
*
* @memberOf Benchmark
* @param {object} [options={}] Options object.
* @returns {object} The benchmark instance.
* @param {Object} [options={}] Options object.
* @returns {Object} The benchmark instance.
* @example
*
* // basic usage
@@ -2187,7 +2187,7 @@
*
* @static
* @memberOf Benchmark
* @type object
* @type Object
*/
'options': {
@@ -2270,7 +2270,7 @@
* An event listener called when the benchmark is aborted.
*
* @memberOf Benchmark.options
* @type function
* @type Function
*/
'onAbort': undefined,
@@ -2278,7 +2278,7 @@
* An event listener called when the benchmark completes running.
*
* @memberOf Benchmark.options
* @type function
* @type Function
*/
'onComplete': undefined,
@@ -2286,7 +2286,7 @@
* An event listener called after each run cycle.
*
* @memberOf Benchmark.options
* @type function
* @type Function
*/
'onCycle': undefined,
@@ -2294,7 +2294,7 @@
* An event listener called when a test errors.
*
* @memberOf Benchmark.options
* @type function
* @type Function
*/
'onError': undefined,
@@ -2302,7 +2302,7 @@
* An event listener called when the benchmark is reset.
*
* @memberOf Benchmark.options
* @type function
* @type Function
*/
'onReset': undefined,
@@ -2310,7 +2310,7 @@
* An event listener called when the benchmark starts running.
*
* @memberOf Benchmark.options
* @type function
* @type Function
*/
'onStart': undefined
},
@@ -2321,7 +2321,7 @@
*
* @static
* @memberOf Benchmark
* @type object
* @type Object
*/
'platform': context.platform || req('platform') || ({
'description': context.navigator && context.navigator.userAgent || null,
@@ -2393,7 +2393,7 @@
* The compiled test function.
*
* @memberOf Benchmark
* @type function|...string
* @type {Function|string}
*/
'compiled': undefined,
@@ -2401,7 +2401,7 @@
* The error object if the test failed.
*
* @memberOf Benchmark
* @type object
* @type Object
*/
'error': undefined,
@@ -2409,7 +2409,7 @@
* The test to benchmark.
*
* @memberOf Benchmark
* @type function|...string
* @type {Function|string}
*/
'fn': undefined,
@@ -2433,7 +2433,7 @@
* Compiled into the test and executed immediately **before** the test loop.
*
* @memberOf Benchmark
* @type function|...string
* @type {Function|string}
* @example
*
* // basic usage
@@ -2496,7 +2496,7 @@
* Compiled into the test and executed immediately **after** the test loop.
*
* @memberOf Benchmark
* @type function|...string
* @type {Function|string}
*/
'teardown': noop,
@@ -2504,7 +2504,7 @@
* An object of stats including mean, margin or error, and standard deviation.
*
* @memberOf Benchmark
* @type object
* @type Object
*/
'stats': {
@@ -2569,7 +2569,7 @@
* An object of timing data including cycle, elapsed, period, start, and stop.
*
* @memberOf Benchmark
* @type object
* @type Object
*/
'times': {
@@ -2628,7 +2628,7 @@
* The deferred benchmark instance.
*
* @memberOf Benchmark.Deferred
* @type object
* @type Object
*/
'benchmark': null,
@@ -2685,7 +2685,7 @@
* The object whose listeners are currently being processed.
*
* @memberOf Benchmark.Event
* @type object
* @type Object
*/
'currentTarget': undefined,
@@ -2701,7 +2701,7 @@
* The object to which the event was originally emitted.
*
* @memberOf Benchmark.Event
* @type object
* @type Object
*/
'target': undefined,
@@ -2729,7 +2729,7 @@
*
* @static
* @memberOf Benchmark.Suite
* @type object
* @type Object
*/
Suite.options = {

View File

@@ -9,7 +9,7 @@ require(dirname(__FILE__) . '/src/DocDown/MarkdownGenerator.php');
/**
* Generates Markdown from JSDoc entries in a given file.
*
* @param {array} [$options=array()] The options array.
* @param {Array} [$options=array()] The options array.
* @returns {string} The generated Markdown.
* @example
*

View File

@@ -20,7 +20,7 @@ class Alias {
*
* @constructor
* @param {string} $name The alias name.
* @param {object} $owner The alias owner.
* @param {Object} $owner The alias owner.
*/
public function __construct( $name, $owner ) {
$this->owner = $owner;
@@ -48,7 +48,7 @@ class Alias {
*
* @memberOf Alias
* @param {number} $index The index of the array value to return.
* @returns {(array|string)} The entry's `alias` objects.
* @returns {Array|string} The entry's `alias` objects.
*/
public function getAliases( $index = null ) {
$result = array();
@@ -172,7 +172,7 @@ class Alias {
*
* @memberOf Alias
* @param {number} $index The index of the array value to return.
* @returns {(array|string)} The owner entry's `member` data.
* @returns {Array|string} The owner entry's `member` data.
*/
public function getMembers( $index = null ) {
return $index !== null
@@ -195,7 +195,7 @@ class Alias {
*
* @memberOf Alias
* @param {number} $index The index of the array value to return.
* @returns {array} The owner entry's `param` data.
* @returns {Array} The owner entry's `param` data.
*/
public function getParams( $index = null ) {
return $index !== null

View File

@@ -55,7 +55,7 @@ class Entry {
* @static
* @memberOf Entry
* @param {string} $source The source code.
* @returns {array} The array of entries.
* @returns {Array} The array of entries.
*/
public static function getEntries( $source ) {
preg_match_all('#/\*\*(?![-!])[\s\S]*?\*/\s*.+#', $source, $result);
@@ -90,7 +90,7 @@ class Entry {
*
* @memberOf Entry
* @param {number} $index The index of the array value to return.
* @returns {(array|string)} The entry's `alias` objects.
* @returns {Array|string} The entry's `alias` objects.
*/
public function getAliases( $index = null ) {
if (!isset($this->_aliases)) {
@@ -167,7 +167,7 @@ class Entry {
if (count($result)) {
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
} else {
$result = $this->getType() == 'function' ? 'Methods' : 'Properties';
$result = $this->getType() == 'Function' ? 'Methods' : 'Properties';
}
$this->_category = $result;
return $result;
@@ -191,7 +191,7 @@ class Entry {
$result = preg_replace('/(?:^|\n)[\t ]*\*\n[\t ]*\*[\t ]*/', "\n\n", $result);
$result = preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result);
$result = trim($result);
$result = ($type == 'function' ? '' : '(' . str_replace('|', ', ', trim($type, '{}')) . '): ') . $result;
$result = ($type == 'Function' ? '' : '(' . str_replace('|', ', ', trim($type, '{}')) . '): ') . $result;
}
$this->_desc = $result;
return $result;
@@ -330,7 +330,7 @@ class Entry {
*
* @memberOf Entry
* @param {number} $index The index of the array value to return.
* @returns {(array|string)} The entry's `member` data.
* @returns {Array|string} The entry's `member` data.
*/
public function getMembers( $index = null ) {
if (!isset($this->_members)) {
@@ -373,7 +373,7 @@ class Entry {
*
* @memberOf Entry
* @param {number} $index The index of the array value to return.
* @returns {array} The entry's `param` data.
* @returns {Array} The entry's `param` data.
*/
public function getParams( $index = null ) {
if (!isset($this->_params)) {
@@ -434,9 +434,12 @@ class Entry {
preg_match('#\*[\t ]*@type\s(?:\{\(?)?([^)}\n]+)#', $this->entry, $result);
if (count($result)) {
$result = trim(strtolower($result[1]));
$result = trim($result[1]);
if (preg_match('/^(?:array|function|object|regexp)$/', $result)) {
$result = ucfirst($result);
}
} else {
$result = $this->isFunction() ? 'function' : 'unknown';
$result = $this->isFunction() ? 'Function' : 'unknown';
}
$this->_type = $result;
return $result;

View File

@@ -56,7 +56,7 @@ class MarkdownGenerator {
*
* @constructor
* @param {string} $source The source code to parse.
* @param {array} $options The options array.
* @param {Array} $options The options array.
*/
public function __construct( $source, $options = array() ) {
// juggle arguments
@@ -139,7 +139,7 @@ class MarkdownGenerator {
* @static
* @memberOf MarkdownGenerator
* @param {string} $string The string to modify.
* @param {(array|object)} $object The template object.
* @param {Array|Object} $object The template object.
* @returns {string} The modified string.
*/
private static function interpolate( $string, $object ) {
@@ -175,8 +175,8 @@ class MarkdownGenerator {
*
* @private
* @memberOf MarkdownGenerator
* @param {array} $result The result array to modify.
* @param {array} $entries The entries to add to the `$result`.
* @param {Array} $result The result array to modify.
* @param {Array} $entries The entries to add to the `$result`.
*/
private function addEntries( &$result, $entries ) {
foreach ($entries as $entry) {
@@ -235,7 +235,7 @@ class MarkdownGenerator {
*
* @private
* @memberOf MarkdownGenerator
* @param {(number|object)} $entry The entry object.
* @param {number|Object} $entry The entry object.
* @param {string} $member The name of the member.
* @returns {string} The url hash.
*/
@@ -255,7 +255,7 @@ class MarkdownGenerator {
*
* @private
* @memberOf MarkdownGenerator
* @param {(number|object)} $entry The entry object.
* @param {number|Object} $entry The entry object.
* @returns {string} The url.
*/
private function getLineUrl( $entry ) {
@@ -268,7 +268,7 @@ class MarkdownGenerator {
*
* @private
* @memberOf MarkdownGenerator
* @param {(number|object)} $entry The entry object.
* @param {number|Object} $entry The entry object.
* @returns {string} The separator.
*/
private function getSeparator( $entry ) {
@@ -315,7 +315,7 @@ class MarkdownGenerator {
}
// append entry to api member
if (!$member || $entry->isCtor() || ($entry->getType() == 'object' &&
if (!$member || $entry->isCtor() || ($entry->getType() == 'Object' &&
!preg_match('/[=:]\s*(?:null|undefined)\s*[,;]?$/', $entry->entry))) {
// assign the real entry, replacing the temporary entry if it exist
@@ -400,7 +400,7 @@ class MarkdownGenerator {
foreach ($entry->{$kind} as $subentry) {
$name = $subentry->getName();
// functions w/o ALL-CAPs names are last
$sortBy['a'][] = $subentry->getType() == 'function' && !preg_match('/^[A-Z_]+$/', $name);
$sortBy['a'][] = $subentry->getType() == 'Function' && !preg_match('/^[A-Z_]+$/', $name);
// ALL-CAPs properties first
$sortBy['b'][] = preg_match('/^[A-Z_]+$/', $name);
// lowercase alphanumeric sort
@@ -541,7 +541,7 @@ class MarkdownGenerator {
$subentries = is_string($kind) ? $entry->{$kind} : array($kind);
// add sub-entry name
if ($kind != 'static' && $entry->getType() != 'object' &&
if ($kind != 'static' && $entry->getType() != 'Object' &&
count($subentries) && $subentries[0] != $kind) {
if ($kind == 'plugin') {
$result[] = $closeTag;

View File

@@ -77,8 +77,8 @@
* An iteration utility for arrays and objects.
*
* @private
* @param {(array|object)} object The object to iterate over.
* @param {function} callback The function called per iteration.
* @param {Array|Object} object The object to iterate over.
* @param {Function} callback The function called per iteration.
*/
function each(object, callback) {
var index = -1,
@@ -111,8 +111,8 @@
* Iterates over an object's own properties, executing the `callback` for each.
*
* @private
* @param {object} object The object to iterate over.
* @param {function} callback The function executed per own property.
* @param {Object} object The object to iterate over.
* @param {Function} callback The function executed per own property.
*/
function forOwn(object, callback) {
for (var key in object) {
@@ -137,7 +137,7 @@
* Checks if an object has the specified key as a direct property.
*
* @private
* @param {object} object The object to check.
* @param {Object} object The object to check.
* @param {string} key The key to check for.
* @returns {boolean} Returns `true` if key is a direct property, else `false`.
*/
@@ -199,8 +199,8 @@
* A bare-bones` Array#reduce` like utility function.
*
* @private
* @param {array} array The array to iterate over.
* @param {function} callback The function called per iteration.
* @param {Array} array The array to iterate over.
* @param {Function} callback The function called per iteration.
* @param {*} accumulator Initial value of the accumulator.
* @returns {*} The accumulator.
*/
@@ -230,7 +230,7 @@
*
* @memberOf platform
* @param {string} [ua = navigator.userAgent] The user agent string.
* @returns {object} A platform object.
* @returns {Object} A platform object.
*/
function parse(ua) {
@@ -377,8 +377,8 @@
* Picks the layout engine from an array of guesses.
*
* @private
* @param {array} guesses An array of guesses.
* @returns {(null|string)} The detected layout engine.
* @param {Array} guesses An array of guesses.
* @returns {null|string} The detected layout engine.
*/
function getLayout(guesses) {
return reduce(guesses, function(result, guess) {
@@ -392,8 +392,8 @@
* Picks the manufacturer from an array of guesses.
*
* @private
* @param {array} guesses An array of guesses.
* @returns {(null|string)} The detected manufacturer.
* @param {Array} guesses An array of guesses.
* @returns {null|string} The detected manufacturer.
*/
function getManufacturer(guesses) {
return reduce(guesses, function(result, value, key) {
@@ -410,8 +410,8 @@
* Picks the browser name from an array of guesses.
*
* @private
* @param {array} guesses An array of guesses.
* @returns {(null|string)} The detected browser name.
* @param {Array} guesses An array of guesses.
* @returns {null|string} The detected browser name.
*/
function getName(guesses) {
return reduce(guesses, function(result, guess) {
@@ -425,8 +425,8 @@
* Picks the OS name from an array of guesses.
*
* @private
* @param {array} guesses An array of guesses.
* @returns {(null|string)} The detected OS name.
* @param {Array} guesses An array of guesses.
* @returns {null|string} The detected OS name.
*/
function getOS(guesses) {
return reduce(guesses, function(result, guess) {
@@ -475,8 +475,8 @@
* Picks the product name from an array of guesses.
*
* @private
* @param {array} guesses An array of guesses.
* @returns {(null|string)} The detected product name.
* @param {Array} guesses An array of guesses.
* @returns {null|string} The detected product name.
*/
function getProduct(guesses) {
return reduce(guesses, function(result, guess) {
@@ -504,8 +504,8 @@
* Resolves the version using an array of UA patterns.
*
* @private
* @param {array} patterns An array of UA patterns.
* @returns {(null|string)} The detected version.
* @param {Array} patterns An array of UA patterns.
* @returns {null|string} The detected version.
*/
function getVersion(patterns) {
return reduce(patterns, function(result, pattern) {
@@ -862,7 +862,7 @@
* The platform object.
*
* @name platform
* @type object
* @type Object
*/
return {
@@ -870,7 +870,7 @@
* The browser/environment version.
*
* @memberOf platform
* @type string|Null
* @type string|null
*/
'version': name && version && (description.unshift(version), version),
@@ -878,7 +878,7 @@
* The name of the browser/environment.
*
* @memberOf platform
* @type string|Null
* @type string|null
*/
'name': name && (description.unshift(name), name),
@@ -886,7 +886,7 @@
* The name of the operating system.
*
* @memberOf platform
* @type object
* @type Object
*/
'os': os
? (name &&
@@ -898,7 +898,7 @@
* The CPU architecture the OS is built for.
*
* @memberOf platform.os
* @type number|Null
* @type number|null
*/
'architecture': null,
@@ -906,7 +906,7 @@
* The family of the OS.
*
* @memberOf platform.os
* @type string|Null
* @type string|null
*/
'family': null,
@@ -914,7 +914,7 @@
* The version of the OS.
*
* @memberOf platform.os
* @type string|Null
* @type string|null
*/
'version': null,
@@ -931,7 +931,7 @@
* The platform description.
*
* @memberOf platform
* @type string|Null
* @type string|null
*/
'description': description.length ? description.join(' ') : ua,
@@ -939,7 +939,7 @@
* The name of the browser layout engine.
*
* @memberOf platform
* @type string|Null
* @type string|null
*/
'layout': layout && layout[0],
@@ -947,7 +947,7 @@
* The name of the product's manufacturer.
*
* @memberOf platform
* @type string|Null
* @type string|null
*/
'manufacturer': manufacturer,
@@ -955,7 +955,7 @@
* The alpha/beta release indicator.
*
* @memberOf platform
* @type string|Null
* @type string|null
*/
'prerelease': prerelease,
@@ -963,7 +963,7 @@
* The name of the product hosting the browser.
*
* @memberOf platform
* @type string|Null
* @type string|null
*/
'product': product,
@@ -971,7 +971,7 @@
* The browser's user agent string.
*
* @memberOf platform
* @type string|Null
* @type string|null
*/
'ua': ua,

View File

@@ -22,7 +22,7 @@
* Installs the CLI boilerplate additions on the given `context` object.
*
* @memberOf exports
* @param {object} context The context object.
* @param {Object} context The context object.
*/
function runInContext(context) {
// exit early if no `context` is provided or if `QUnit` does not exist
@@ -34,7 +34,7 @@
* Schedules timer-based callbacks.
*
* @private
* @param {(function|string)} fn The function to call.
* @param {Function|string} fn The function to call.
* @param {number} delay The number of milliseconds to delay the `fn` call.
* @param [arg1, arg2, ...] Arguments to invoke `fn` with.
* @param {boolean} repeated A flag to specify whether `fn` is called repeatedly.
@@ -84,7 +84,7 @@
* Executes a code snippet or function repeatedly, with a delay between each call.
*
* @memberOf context
* @param {(function|string)} fn The function to call or string to evaluate.
* @param {Function|string} fn The function to call or string to evaluate.
* @param {number} delay The number of milliseconds to delay each `fn` call.
* @param [arg1, arg2, ...] Arguments to invoke `fn` with.
* @returns {number} The the ID of the timeout.
@@ -97,7 +97,7 @@
* Executes a code snippet or a function after specified delay.
*
* @memberOf context
* @param {(function|string)} fn The function to call or string to evaluate.
* @param {Function|string} fn The function to call or string to evaluate.
* @param {number} delay The number of milliseconds to delay the `fn` call.
* @param [arg1, arg2, ...] Arguments to invoke `fn` with.
* @returns {number} The the ID of the timeout.
@@ -121,7 +121,7 @@
* A logging callback triggered when all testing is completed.
*
* @memberOf QUnit
* @param {object} details An object with properties `failed`, `passed`, `runtime`, and `total`.
* @param {Object} details An object with properties `failed`, `passed`, `runtime`, and `total`.
*/
QUnit.done(function() {
var ran;
@@ -160,7 +160,7 @@
* A logging callback triggered after every assertion.
*
* @memberOf QUnit
* @param {object} details An object with properties `actual`, `expected`, `message`, and `result`.
* @param {Object} details An object with properties `actual`, `expected`, `message`, and `result`.
*/
QUnit.log(function(details) {
var expected = details.expected,
@@ -183,7 +183,7 @@
* A logging callback triggered at the start of every test module.
*
* @memberOf QUnit
* @param {object} details An object with property `name`.
* @param {Object} details An object with property `name`.
*/
QUnit.moduleStart(function(details) {
console.log(hr);
@@ -195,8 +195,8 @@
* Converts an object into a string representation.
*
* @memberOf QUnit
* @type function
* @param {object} object The object to stringify.
* @type Function
* @param {Object} object The object to stringify.
* @returns {string} The result string.
*/
QUnit.jsDump.parsers.object = (function() {
@@ -217,7 +217,7 @@
* A logging callback triggered after a test is completed.
*
* @memberOf QUnit
* @param {object} details An object with properties `failed`, `name`, `passed`, and `total`.
* @param {Object} details An object with properties `failed`, `name`, `passed`, and `total`.
*/
QUnit.testDone(function(details) {
var assertions = QUnit.config.testStats.assertions,
@@ -239,7 +239,7 @@
* An object used to hold information about the current running test.
*
* @memberOf QUnit.config
* @type object
* @type Object
*/
QUnit.config.testStats = {