From feff34b021c567b1b895aaf338d1079cad08e806 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 16 Aug 2012 21:20:54 -0700 Subject: [PATCH] Update vendors. Former-commit-id: 44c2fe9fbfbf50aa64663d46b45d6fd2c778f2b7 --- vendor/benchmark.js/README.md | 14 +++-- vendor/benchmark.js/benchmark.js | 105 ++++++++++++++++++++++--------- vendor/docdown/README.md | 13 +--- vendor/platform.js/README.md | 2 +- vendor/qunit-clib/README.md | 24 +++---- vendor/qunit-clib/qunit-clib.js | 4 +- 6 files changed, 98 insertions(+), 64 deletions(-) diff --git a/vendor/benchmark.js/README.md b/vendor/benchmark.js/README.md index 7a74f5934..1578b4f59 100644 --- a/vendor/benchmark.js/README.md +++ b/vendor/benchmark.js/README.md @@ -2,19 +2,19 @@ A [robust](http://calendar.perfplanet.com/2010/bulletproof-javascript-benchmarks/ "Bulletproof JavaScript benchmarks") benchmarking library that works on nearly all JavaScript platforms1, supports high-resolution timers, and returns statistically significant results. As seen on [jsPerf](http://jsperf.com/). -## BestieJS +## Download -Benchmark.js is part of the BestieJS *"Best in Class"* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation. + * [Development source](https://raw.github.com/bestiejs/benchmark.js/1.0.0/benchmark.js) -## Documentation +## Dive in -The documentation for Benchmark.js can be viewed here: +We’ve got [API docs](http://benchmarkjs.com/docs) and [unit tests](http://benchmarkjs.com/tests). For a list of upcoming features, check out our [roadmap](https://github.com/bestiejs/benchmark.js/wiki/Roadmap). ## Support -Benchmark.js has been tested in at least Adobe AIR 2.6, Chrome 5-21, Firefox 1.5-13, IE 6-9, Opera 9.25-12.01, Safari 3-6, Node.js 0.4.8-0.8.6, Narwhal 0.3.2, RingoJS 0.8, and Rhino 1.7RC3. +Benchmark.js has been tested in at least Adobe AIR 3.1, Chrome 5-21, Firefox 1.5-13, IE 6-9, Opera 9.25-12.01, Safari 3-6, Node.js 0.8.6, Narwhal 0.3.2, RingoJS 0.8, and Rhino 1.7RC5. ## Installation and usage @@ -118,6 +118,10 @@ suite.add('RegExp#test', function() { // > Fastest is String#indexOf ~~~ +## BestieJS + +Benchmark.js is part of the BestieJS *"Best in Class"* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation. + ## Authors * [Mathias Bynens](http://mathiasbynens.be/) diff --git a/vendor/benchmark.js/benchmark.js b/vendor/benchmark.js/benchmark.js index 3661d9f47..cb4e63e41 100644 --- a/vendor/benchmark.js/benchmark.js +++ b/vendor/benchmark.js/benchmark.js @@ -244,6 +244,36 @@ } catch(e) { support.getAllKeys = false; } + + /** + * Detect if own properties are iterated before inherited properties (all but IE < 9). + * + * @name iteratesOwnLast + * @memberOf Benchmark.support + * @type Boolean + */ + support.iteratesOwnFirst = (function() { + var props = []; + function ctor() { this.x = 1; } + ctor.prototype = { 'y': 1 }; + for (var prop in new ctor) { props.push(prop); } + return props[0] == 'x'; + }()); + + /** + * Detect if a node's [[Class]] is resolvable (all but IE < 9) + * and that the JS engine errors when attempting to coerce an object to a + * string without a `toString` property value of `typeof` "function". + * + * @name nodeClass + * @memberOf Benchmark.support + * @type Boolean + */ + try { + support.nodeClass = ({ 'toString': 0 } + '', toString.call(doc || 0) != '[object Object]'); + } catch(e) { + support.nodeClass = true; + } }()); /** @@ -583,14 +613,17 @@ while (++index < length) { if ((index - start) in tail) { object[index] = tail[index - start]; - } else { + } else if (index in object) { delete object[index]; } } // delete excess elements deleteCount = deleteCount > elementCount ? deleteCount - elementCount : 0; while (deleteCount--) { - delete object[length + deleteCount]; + index = length + deleteCount; + if (index in object) { + delete object[index]; + } } object.length = length; return result; @@ -941,7 +974,13 @@ // escape the `{` for Firefox 1 result = (/^[^{]+\{([\s\S]*)}\s*$/.exec(fn) || 0)[1]; } - return (result || '').replace(/^\s+|\s+$/g, ''); + // trim string + result = (result || '').replace(/^\s+|\s+$/g, ''); + + // detect strings containing only the "use strict" directive + return /^(?:\/\*+[\w|\W]*?\*\/|\/\/.*?[\n\r\u2028\u2029]|\s)*(["'])use strict\1;?$/.test(result) + ? '' + : result; } /** @@ -994,36 +1033,43 @@ } /** - * Checks if the specified `value` is an object created by the `Object` - * constructor assuming objects created by the `Object` constructor have no - * inherited enumerable properties and assuming there are no `Object.prototype` - * extensions. + * Checks if a given `value` is an object created by the `Object` constructor + * assuming objects created by the `Object` constructor have no inherited + * enumerable properties and that there are no `Object.prototype` extensions. * * @private * @param {Mixed} value The value to check. - * @returns {Boolean} Returns `true` if `value` is an object, else `false`. + * @returns {Boolean} Returns `true` if the `value` is a plain `Object` object, else `false`. */ - function isObject(value) { - var ctor, - result = !!value && toString.call(value) == '[object Object]'; - - if (result && noArgumentsClass) { - // avoid false positives for `arguments` objects in IE < 9 - result = !isArguments(value); + function isPlainObject(value) { + // avoid non-objects and false positives for `arguments` objects in IE < 9 + var result = false; + if (!(value && typeof value == 'object') || (noArgumentsClass && isArguments(value))) { + return result; } - if (result) { - // IE < 9 presents nodes like `Object` objects: - // IE < 8 are missing the node's constructor property - // IE 8 node constructors are typeof "object" - ctor = value.constructor; - // check if the constructor is `Object` as `Object instanceof Object` is `true` - if ((result = isClassOf(ctor, 'Function') && ctor instanceof ctor)) { - // An object's own properties are iterated before inherited properties. - // If the last iterated key belongs to an object's own property then - // there are no inherited enumerable properties. - forProps(value, function(subValue, subKey) { result = subKey; }); - result = result === true || hasKey(value, result); + // IE < 9 presents DOM nodes as `Object` objects except they have `toString` + // methods that are `typeof` "string" and still can coerce nodes to strings. + // Also check that the constructor is `Object` (i.e. `Object instanceof Object`) + var ctor = value.constructor; + if ((support.nodeClass || !(typeof value.toString != 'function' && typeof (value + '') == 'string')) && + (!isClassOf(ctor, 'Function') || ctor instanceof ctor)) { + // In most environments an object's own properties are iterated before + // its inherited properties. If the last iterated property is an object's + // own property then there are no inherited enumerable properties. + if (support.iteratesOwnFirst) { + forProps(value, function(subValue, subKey) { + result = subKey; + }); + return result === false || hasKey(value, result); } + // IE < 9 iterates inherited properties before own properties. If the first + // iterated property is an object's own property then there are no inherited + // enumerable properties. + forProps(value, function(subValue, subKey) { + result = !hasKey(value, subKey); + return false; + }); + return result === false; } return result; } @@ -1265,7 +1311,7 @@ break; case '[object Object]': - isObject(value) && (clone = new ctor); + isPlainObject(value) && (clone = {}); break; case '[object Number]': @@ -2405,7 +2451,7 @@ var source = { 'setup': getSource(bench.setup, preprocess('m$.setup()')), - 'fn': getSource(fn, preprocess('f$(' + fnArg + ')')), + 'fn': getSource(fn, preprocess('m$.fn(' + fnArg + ')')), 'fnArg': fnArg, 'teardown': getSource(bench.teardown, preprocess('m$.teardown()')) }; @@ -3045,6 +3091,7 @@ /** * The maximum time a benchmark is allowed to run before finishing (secs). + * * Note: Cycle delays aren't counted toward the maximum time. * * @memberOf Benchmark.options diff --git a/vendor/docdown/README.md b/vendor/docdown/README.md index 5b0b38c4b..7581efc72 100644 --- a/vendor/docdown/README.md +++ b/vendor/docdown/README.md @@ -1,4 +1,4 @@ -# Docdown v1.0.0-pre +# Docdown v1.0.0 A simple JSDoc to Markdown documentation generator. @@ -22,17 +22,6 @@ $markdown = docdown(array( )); ~~~ -## Cloning this repo - -To clone this repository just use: - -~~~ bash -git clone https://github.com/docdown/docdown.git -cd docdown -~~~ - -Feel free to fork and send pull requests if you see improvements! - ## Author * [John-David Dalton](http://allyoucanleet.com/) diff --git a/vendor/platform.js/README.md b/vendor/platform.js/README.md index 23a05dadf..e83e43fb7 100644 --- a/vendor/platform.js/README.md +++ b/vendor/platform.js/README.md @@ -18,7 +18,7 @@ For a list of upcoming features, check out our [roadmap](https://github.com/best ## Support -Platform.js has been tested in at least Chrome 5-21, Firefox 1.5-13, IE 6-9, Opera 9.25-12.01, Safari 3-6, Node.js 0.4.8-0.8.6, Narwhal 0.3.2, RingoJS 0.8, and Rhino 1.7RC3. +Platform.js has been tested in at least Adobe AIR 3.1, Chrome 5-21, Firefox 1.5-13, IE 6-9, Opera 9.25-12.01, Safari 3-6, Node.js 0.8.6, Narwhal 0.3.2, RingoJS 0.8, and Rhino 1.7RC5. ## Installation and usage diff --git a/vendor/qunit-clib/README.md b/vendor/qunit-clib/README.md index daacb5e50..8c4259b46 100644 --- a/vendor/qunit-clib/README.md +++ b/vendor/qunit-clib/README.md @@ -1,12 +1,16 @@ -# QUnit CLIB v1.0.0-pre +# QUnit CLIB v1.0.0 ## command-line interface boilerplate -QUnit CLIB helps extend QUnit's CLI support to many common CLI environments1. +QUnit CLIB helps extend QUnit's CLI support to many common CLI environments. ## Screenshot ![QUnit CLIB brings QUnit to your favorite shell.](http://i.imgur.com/jpu9l.png) +## Support + +QUnit CLIB has been tested in at least Node.js 0.4.8-0.8.6, Narwhal v0.3.2, RingoJS v0.8.0, and Rhino v1.7RC3-RC5. + ## Usage ~~~ js @@ -41,23 +45,11 @@ QUnit CLIB helps extend QUnit's CLI support to many common CLI environments }(typeof global == 'object' && global || this)); ~~~ -## Cloning this repo - -To clone this repository just use: - -~~~ bash -git clone https://github.com/jdalton/qunit-clib.git -cd qunit-clib -~~~ - -Feel free to fork and send pull requests if you see improvements! - ## Footnotes - 1. QUnit CLIB has been tested in at least Node.js v0.4.8-0.6.1, Narwhal v0.3.2, RingoJS v0.7.0-0.8.0, and Rhino v1.7RC3. - + 1. QUnit v1.3.0 does not work with Narwhal or Ringo < v0.8.0 - 2. QUnit v1.3.0 does not work with Narwhal or Ringo < v0.8.0 + 2. Rhino v1.7RC4 does not support timeout fallbacks `clearTimeout` and `setTimeout` ## Author diff --git a/vendor/qunit-clib/qunit-clib.js b/vendor/qunit-clib/qunit-clib.js index c5ff65324..e487c03e7 100644 --- a/vendor/qunit-clib/qunit-clib.js +++ b/vendor/qunit-clib/qunit-clib.js @@ -1,5 +1,5 @@ /*! - * QUnit CLI Boilerplate v1.0.0-pre + * QUnit CLI Boilerplate v1.0.0 * Copyright 2011-2012 John-David Dalton * Based on a gist by Jörn Zaefferer * Available under MIT license @@ -92,6 +92,8 @@ * @returns {Number} The the ID of the timeout. */ function schedule(fn, delay, args, repeated) { + // Rhino 1.7RC4 will error assigning `task` below + // https://bugzilla.mozilla.org/show_bug.cgi?id=775566 var task = ids[++counter] = new JavaAdapter(java.util.TimerTask, { 'run': function() { fn.apply(global, args);