From d6bdce11c90fab5a641b9409be3c44047e16dce3 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Mon, 23 May 2016 00:34:24 -0700 Subject: [PATCH 1/5] Update lodash to 4.13.1. --- package.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index c8a2c93c..c90e29cf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "benchmark", - "version": "2.1.1", + "version": "2.1.0", "description": "A benchmarking library that supports high-resolution timers & returns statistically significant results.", "homepage": "https://benchmarkjs.com/", "license": "MIT", @@ -14,19 +14,19 @@ ], "repository": "bestiejs/benchmark.js", "scripts": { - "doc": "docdown benchmark.js doc/README.md style=github title=\"Benchmark.js v${npm_package_version}\" toc=categories url=https://github.com/bestiejs/benchmark.js/blob/${npm_package_version}/benchmark.js", + "doc": "docdown benchmark.js doc/README.md toc='categories' url=\"https://github.com/bestiejs/benchmark.js/blob/${npm_package_version}/benchmark.js\" title=\"Benchmark.js v${npm_package_version}\" hash='github'", "test": "node test/test" }, "dependencies": { - "lodash": "^4.14.2", + "lodash": "^4.13.1", "platform": "^1.3.1" }, "devDependencies": { - "coveralls": "^2.11.12", - "docdown": "~0.7.1", - "istanbul": "0.4.4", - "qunit-extras": "^2.1.0", - "qunitjs": "^2.0.1", + "coveralls": "^2.11.9", + "docdown": "~0.5.1", + "istanbul": "0.4.3", + "qunit-extras": "^2.0.0", + "qunitjs": "~1.23.1", "requirejs": "^2.2.0" }, "files": [ From 598242b4b8f53b16f8681c8f1cba184d8832ed6f Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sat, 18 Jun 2016 11:01:53 -0700 Subject: [PATCH 2/5] Update qunitjs to 2.0.0. --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index c90e29cf..29e9f464 100644 --- a/package.json +++ b/package.json @@ -25,8 +25,8 @@ "coveralls": "^2.11.9", "docdown": "~0.5.1", "istanbul": "0.4.3", - "qunit-extras": "^2.0.0", - "qunitjs": "~1.23.1", + "qunit-extras": "^2.0.1", + "qunitjs": "^2.0.0", "requirejs": "^2.2.0" }, "files": [ From 1c418780796f7813c65a9285b1d357193012fa4c Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sat, 18 Jun 2016 11:01:53 -0700 Subject: [PATCH 3/5] Update qunitjs to 2.0.0 and istanbul to 0.4.4. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 29e9f464..3aed7215 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "devDependencies": { "coveralls": "^2.11.9", "docdown": "~0.5.1", - "istanbul": "0.4.3", + "istanbul": "0.4.4", "qunit-extras": "^2.0.1", "qunitjs": "^2.0.0", "requirejs": "^2.2.0" From cc3f222ff1be5b3ff12bcda93d251efd9f1760f5 Mon Sep 17 00:00:00 2001 From: Bradley Stafford Date: Mon, 20 Jun 2016 21:58:35 -0700 Subject: [PATCH 4/5] Add fallback runScript insertion location There's an issue wherein having no script tags on the page (but having the js in memory executing) causes errors since runScript has no reference point to inject scripts. This commit allows for two cases: 1) If there are no script tags on the page, it will grab the last element node in the body and insert scripts next to that element. 2) If there are no script tags on the page and the body element is EMPTY, a script tag will be created and appended to body. Subsequent calls to runScript will allow the first use case of inserting next to scripts to be called. --- benchmark.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/benchmark.js b/benchmark.js index 803811ea..ed6d2d2c 100644 --- a/benchmark.js +++ b/benchmark.js @@ -660,7 +660,9 @@ function runScript(code) { var anchor = freeDefine ? define.amd : Benchmark, script = doc.createElement('script'), - sibling = doc.getElementsByTagName('script')[0], + sibling = doc.getElementsByTagName('script')[0] || + doc.body.children[doc.body.children.length - 1] || // Last Element Node in OR + doc.body.appendChild(doc.createElement('script')), // Create element to insert next to parent = sibling.parentNode, prop = uid + 'runScript', prefix = '(' + (freeDefine ? 'define.amd.' : 'Benchmark.') + prop + '||function(){})();'; From f8e7c0902b66ddd7dac85a23226feffbcc832bad Mon Sep 17 00:00:00 2001 From: Bradley Stafford Date: Mon, 20 Jun 2016 22:22:05 -0700 Subject: [PATCH 5/5] trim whitespace, convert to tabs --- benchmark.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark.js b/benchmark.js index ed6d2d2c..c22c0502 100644 --- a/benchmark.js +++ b/benchmark.js @@ -660,7 +660,7 @@ function runScript(code) { var anchor = freeDefine ? define.amd : Benchmark, script = doc.createElement('script'), - sibling = doc.getElementsByTagName('script')[0] || + sibling = doc.getElementsByTagName('script')[0] || doc.body.children[doc.body.children.length - 1] || // Last Element Node in OR doc.body.appendChild(doc.createElement('script')), // Create element to insert next to parent = sibling.parentNode,