From ec16c0ed509dd4e274c37ef90a59d85c0d77dc1d Mon Sep 17 00:00:00 2001 From: yeikos Date: Sun, 28 Jul 2019 12:38:57 +0200 Subject: [PATCH 01/17] build: added typescript, webpack, chai and mocha --- package.json | 59 ++++++++++++++++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 22 deletions(-) diff --git a/package.json b/package.json index 8175b65..00441a2 100644 --- a/package.json +++ b/package.json @@ -1,24 +1,39 @@ { - "name": "merge", - "version": "1.2.1", - "author": "yeikos", - "description": "Merge multiple objects into one, optionally creating a new cloned object. Similar to the jQuery.extend but more flexible. Works in Node.js and the browser.", - "main": "merge.js", - "license": "MIT", - "homepage": "https://github.com/yeikos/js.merge", - "repository": { - "type": "git", - "url": "https://github.com/yeikos/js.merge.git" - }, - "keywords": [ - "merge", - "recursive", - "extend", - "clone", - "object", - "browser" - ], - "scripts": { - "test": "cd tests; node index.js" - } + "name": "merge", + "version": "1.2.1", + "author": "yeikos", + "description": "Merge multiple objects into one, optionally creating a new cloned object. Similar to the jQuery.extend but more flexible. Works in Node.js and the browser.", + "main": "merge.js", + "license": "MIT", + "homepage": "https://github.com/yeikos/js.merge", + "repository": { + "type": "git", + "url": "https://github.com/yeikos/js.merge.git" + }, + "keywords": [ + "merge", + "recursive", + "extend", + "clone", + "object", + "browser" + ], + "scripts": { + "build": "./node_modules/.bin/tsc -p tsconfig.json", + "build-watch": "./node_modules/.bin/tsc -p tsconfig.json -w", + "webpack": "./node_modules/.bin/webpack --config webpack.config.js", + "webpack-watch": "./node_modules/.bin/webpack --config webpack.config.js -w", + "dev": "./node_modules/.bin/concurrently --kill-others \"npm run build-watch\" \"npm run webpack-watch\"", + "test": "./node_modules/.bin/mocha lib/test/index.js" + }, + "devDependencies": { + "@types/chai": "4.1.7", + "@types/mocha": "5.2.7", + "chai": "4.2.0", + "concurrently": "4.1.1", + "mocha": "6.2.0", + "typescript": "3.5.3", + "webpack": "4.38.0", + "webpack-cli": "3.3.6" + } } \ No newline at end of file From f3e213319d70c39941b5983194cdfbc7d881b007 Mon Sep 17 00:00:00 2001 From: yeikos Date: Sun, 28 Jul 2019 16:35:25 +0200 Subject: [PATCH 02/17] refactor: from js to ts --- merge.js | 177 - merge.min.js | 3 - src/index.ts | 94 + test/index.ts | 224 + tests/index.html | 22 - tests/index.js | 8 - tests/qunit/node_modules/.bin/qunit | 15 - tests/qunit/node_modules/.bin/qunit.cmd | 5 - tests/qunit/node_modules/qunit/.gitmodules | 3 - tests/qunit/node_modules/qunit/.npmignore | 2 - tests/qunit/node_modules/qunit/Makefile | 4 - tests/qunit/node_modules/qunit/bin/cli.js | 116 - tests/qunit/node_modules/qunit/index.js | 1 - tests/qunit/node_modules/qunit/lib/child.js | 138 - .../qunit/node_modules/qunit/lib/coverage.js | 35 - tests/qunit/node_modules/qunit/lib/log.js | 197 - .../node_modules/qunit/lib/testrunner.js | 182 - .../qunit/node_modules/argsparser/.npmignore | 1 - .../qunit/node_modules/argsparser/Makefile | 4 - .../qunit/node_modules/argsparser/index.js | 1 - .../node_modules/argsparser/lib/argsparser.js | 41 - .../node_modules/argsparser/package.json | 35 - .../qunit/node_modules/argsparser/readme.md | 34 - .../node_modules/argsparser/test/test.js | 39 - .../qunit/node_modules/bunker/.npmignore | 1 - .../qunit/node_modules/bunker/.travis.yml | 4 - .../qunit/node_modules/bunker/README.markdown | 82 - .../qunit/node_modules/bunker/example/prof.js | 51 - .../qunit/node_modules/bunker/example/tiny.js | 18 - .../node_modules/bunker/example/top/run.js | 31 - .../node_modules/bunker/example/top/src.js | 18 - .../qunit/node_modules/bunker/index.js | 116 - .../bunker/node_modules/burrito/.npmignore | 1 - .../bunker/node_modules/burrito/.travis.yml | 4 - .../node_modules/burrito/README.markdown | 187 - .../node_modules/burrito/example/microwave.js | 8 - .../node_modules/burrito/example/web/bs.js | 4832 ----------------- .../burrito/example/web/index.html | 14 - .../node_modules/burrito/example/web/main.js | 17 - .../burrito/example/web/server.js | 12 - .../node_modules/burrito/example/wrap.js | 7 - .../bunker/node_modules/burrito/index.js | 208 - .../burrito/node_modules/.bin/uglifyjs | 15 - .../burrito/node_modules/.bin/uglifyjs.cmd | 5 - .../burrito/node_modules/traverse/.npmignore | 1 - .../burrito/node_modules/traverse/LICENSE | 24 - .../node_modules/traverse/README.markdown | 237 - .../node_modules/traverse/examples/json.js | 16 - .../node_modules/traverse/examples/leaves.js | 15 - .../traverse/examples/negative.js | 8 - .../node_modules/traverse/examples/scrub.js | 10 - .../traverse/examples/stringify.js | 38 - .../burrito/node_modules/traverse/index.js | 267 - .../burrito/node_modules/traverse/main.js | 10 - .../node_modules/traverse/package.json | 24 - .../node_modules/traverse/test/circular.js | 115 - .../node_modules/traverse/test/date.js | 35 - .../node_modules/traverse/test/equal.js | 220 - .../node_modules/traverse/test/instance.js | 17 - .../node_modules/traverse/test/interface.js | 42 - .../node_modules/traverse/test/json.js | 47 - .../node_modules/traverse/test/keys.js | 29 - .../node_modules/traverse/test/leaves.js | 21 - .../traverse/test/lib/deep_equal.js | 92 - .../node_modules/traverse/test/mutability.js | 252 - .../node_modules/traverse/test/negative.js | 20 - .../burrito/node_modules/traverse/test/obj.js | 15 - .../node_modules/traverse/test/siblings.js | 35 - .../node_modules/traverse/test/stop.js | 41 - .../node_modules/traverse/test/stringify.js | 36 - .../node_modules/traverse/test/subexpr.js | 34 - .../node_modules/traverse/test/super_deep.js | 55 - .../burrito/node_modules/uglify-js/.npmignore | 4 - .../node_modules/uglify-js/README.html | 1026 ---- .../burrito/node_modules/uglify-js/README.org | 571 -- .../node_modules/uglify-js/bin/uglifyjs | 317 -- .../node_modules/uglify-js/docstyle.css | 75 - .../node_modules/uglify-js/lib/object-ast.js | 75 - .../node_modules/uglify-js/lib/parse-js.js | 1339 ----- .../node_modules/uglify-js/lib/process.js | 2001 ------- .../uglify-js/lib/squeeze-more.js | 51 - .../node_modules/uglify-js/package.json | 22 - .../node_modules/uglify-js/package.json~ | 24 - .../node_modules/uglify-js/test/beautify.js | 28 - .../node_modules/uglify-js/test/testparser.js | 403 -- .../test/unit/compress/expected/array1.js | 1 - .../test/unit/compress/expected/array2.js | 1 - .../test/unit/compress/expected/array3.js | 1 - .../test/unit/compress/expected/array4.js | 1 - .../test/unit/compress/expected/assignment.js | 1 - .../unit/compress/expected/concatstring.js | 1 - .../test/unit/compress/expected/const.js | 1 - .../unit/compress/expected/empty-blocks.js | 1 - .../unit/compress/expected/forstatement.js | 1 - .../test/unit/compress/expected/if.js | 1 - .../test/unit/compress/expected/ifreturn.js | 1 - .../test/unit/compress/expected/ifreturn2.js | 1 - .../test/unit/compress/expected/issue10.js | 1 - .../test/unit/compress/expected/issue11.js | 1 - .../test/unit/compress/expected/issue13.js | 1 - .../test/unit/compress/expected/issue14.js | 1 - .../test/unit/compress/expected/issue16.js | 1 - .../test/unit/compress/expected/issue17.js | 1 - .../test/unit/compress/expected/issue20.js | 1 - .../test/unit/compress/expected/issue21.js | 1 - .../test/unit/compress/expected/issue25.js | 1 - .../test/unit/compress/expected/issue27.js | 1 - .../test/unit/compress/expected/issue28.js | 1 - .../test/unit/compress/expected/issue29.js | 1 - .../test/unit/compress/expected/issue30.js | 1 - .../test/unit/compress/expected/issue34.js | 1 - .../test/unit/compress/expected/issue4.js | 1 - .../test/unit/compress/expected/issue48.js | 1 - .../test/unit/compress/expected/issue50.js | 1 - .../test/unit/compress/expected/issue53.js | 1 - .../test/unit/compress/expected/issue54.1.js | 1 - .../test/unit/compress/expected/issue68.js | 1 - .../test/unit/compress/expected/issue69.js | 1 - .../test/unit/compress/expected/issue9.js | 1 - .../test/unit/compress/expected/mangle.js | 1 - .../unit/compress/expected/null_string.js | 1 - .../unit/compress/expected/strict-equals.js | 1 - .../test/unit/compress/expected/var.js | 1 - .../test/unit/compress/expected/whitespace.js | 1 - .../test/unit/compress/expected/with.js | 1 - .../test/unit/compress/test/array1.js | 3 - .../test/unit/compress/test/array2.js | 4 - .../test/unit/compress/test/array3.js | 4 - .../test/unit/compress/test/array4.js | 6 - .../test/unit/compress/test/assignment.js | 20 - .../test/unit/compress/test/concatstring.js | 3 - .../test/unit/compress/test/const.js | 5 - .../test/unit/compress/test/empty-blocks.js | 4 - .../test/unit/compress/test/forstatement.js | 10 - .../uglify-js/test/unit/compress/test/if.js | 6 - .../test/unit/compress/test/ifreturn.js | 9 - .../test/unit/compress/test/ifreturn2.js | 16 - .../test/unit/compress/test/issue10.js | 1 - .../test/unit/compress/test/issue11.js | 3 - .../test/unit/compress/test/issue13.js | 1 - .../test/unit/compress/test/issue14.js | 1 - .../test/unit/compress/test/issue16.js | 1 - .../test/unit/compress/test/issue17.js | 4 - .../test/unit/compress/test/issue20.js | 1 - .../test/unit/compress/test/issue21.js | 6 - .../test/unit/compress/test/issue25.js | 7 - .../test/unit/compress/test/issue27.js | 1 - .../test/unit/compress/test/issue28.js | 3 - .../test/unit/compress/test/issue29.js | 1 - .../test/unit/compress/test/issue30.js | 3 - .../test/unit/compress/test/issue34.js | 3 - .../test/unit/compress/test/issue4.js | 3 - .../test/unit/compress/test/issue48.js | 1 - .../test/unit/compress/test/issue50.js | 9 - .../test/unit/compress/test/issue53.js | 1 - .../test/unit/compress/test/issue54.1.js | 3 - .../test/unit/compress/test/issue68.js | 5 - .../test/unit/compress/test/issue69.js | 1 - .../test/unit/compress/test/issue9.js | 4 - .../test/unit/compress/test/mangle.js | 5 - .../test/unit/compress/test/null_string.js | 1 - .../test/unit/compress/test/strict-equals.js | 3 - .../uglify-js/test/unit/compress/test/var.js | 3 - .../test/unit/compress/test/whitespace.js | 21 - .../uglify-js/test/unit/compress/test/with.js | 2 - .../uglify-js/test/unit/scripts.js | 55 - .../node_modules/uglify-js/tmp/hoist.js | 33 - .../node_modules/uglify-js/tmp/instrument.js | 97 - .../node_modules/uglify-js/tmp/instrument2.js | 138 - .../node_modules/uglify-js/tmp/test.js | 30 - .../node_modules/uglify-js/uglify-js.js | 17 - .../bunker/node_modules/burrito/package.json | 47 - .../bunker/node_modules/burrito/test/ast.js | 31 - .../bunker/node_modules/burrito/test/err.js | 52 - .../bunker/node_modules/burrito/test/fail.js | 9 - .../node_modules/burrito/test/fail/src.js | 60 - .../bunker/node_modules/burrito/test/label.js | 92 - .../node_modules/burrito/test/microwave.js | 34 - .../node_modules/burrito/test/parent.js | 27 - .../bunker/node_modules/burrito/test/wrap.js | 159 - .../qunit/node_modules/bunker/package.json | 41 - .../qunit/node_modules/bunker/test/cover.js | 36 - .../qunit/node_modules/bunker/test/return.js | 29 - .../node_modules/bunker/test/src/cover.js | 6 - .../qunit/node_modules/cli-table/.npmignore | 1 - .../qunit/node_modules/cli-table/History.md | 5 - .../qunit/node_modules/cli-table/Makefile | 14 - .../qunit/node_modules/cli-table/README.md | 82 - .../node_modules/cli-table/examples/revs.js | 41 - .../node_modules/cli-table/examples/table.js | 40 - .../qunit/node_modules/cli-table/index.js | 2 - .../cli-table/lib/cli-table/index.js | 212 - .../cli-table/lib/cli-table/utils.js | 95 - .../node_modules/colors/MIT-LICENSE.txt | 20 - .../cli-table/node_modules/colors/ReadMe.md | 30 - .../cli-table/node_modules/colors/colors.js | 75 - .../cli-table/node_modules/colors/example.js | 6 - .../node_modules/colors/package.json | 20 - .../qunit/node_modules/cli-table/package.json | 25 - .../node_modules/cli-table/test/common.js | 6 - .../node_modules/cli-table/test/index.test.js | 52 - .../qunit/node_modules/tracejs/README.md | 102 - .../qunit/node_modules/tracejs/package.json | 28 - .../tracejs/test/fixture/example.js | 7 - .../qunit/node_modules/tracejs/test/test.js | 66 - .../qunit/node_modules/tracejs/trace.js | 234 - .../qunit/node_modules/underscore/.npmignore | 3 - .../qunit/node_modules/underscore/CNAME | 1 - .../qunit/node_modules/underscore/LICENSE | 22 - .../qunit/node_modules/underscore/README.md | 19 - .../qunit/node_modules/underscore/favicon.ico | Bin 1406 -> 0 bytes .../qunit/node_modules/underscore/index.html | 2109 ------- .../qunit/node_modules/underscore/index.js | 1 - .../node_modules/underscore/package.json | 26 - .../underscore/raw/underscore.psd | Bin 215540 -> 0 bytes .../node_modules/underscore/underscore-min.js | 32 - .../node_modules/underscore/underscore.js | 1059 ---- tests/qunit/node_modules/qunit/package.json | 62 - tests/qunit/node_modules/qunit/readme.md | 237 - .../node_modules/qunit/support/json/cycle.js | 162 - .../qunit/support/qunit/.npmignore | 7 - .../qunit/support/qunit/AUTHORS.txt | 55 - .../qunit/support/qunit/History.md | 448 -- .../qunit/support/qunit/README.md | 58 - .../support/qunit/addons/canvas/README.md | 16 - .../qunit/addons/canvas/canvas-test.js | 76 - .../support/qunit/addons/canvas/canvas.html | 15 - .../qunit/addons/canvas/qunit-canvas.js | 6 - .../qunit/addons/close-enough/README.md | 17 - .../addons/close-enough/close-enough-test.js | 35 - .../addons/close-enough/close-enough.html | 14 - .../addons/close-enough/qunit-close-enough.js | 32 - .../support/qunit/addons/composite/README.md | 12 - .../addons/composite/composite-demo-test.html | 26 - .../support/qunit/addons/composite/index.html | 33 - .../addons/composite/qunit-composite.css | 13 - .../qunit/addons/composite/qunit-composite.js | 102 - .../qunit/addons/junitlogger/index.html | 44 - .../qunit/addons/junitlogger/junitlogger.js | 268 - .../support/qunit/addons/phantomjs/README.md | 14 - .../support/qunit/addons/phantomjs/runner.js | 102 - .../qunit/support/qunit/addons/step/README.md | 18 - .../support/qunit/addons/step/qunit-step.js | 25 - .../support/qunit/addons/step/step-test.js | 13 - .../qunit/support/qunit/addons/step/step.html | 14 - .../support/qunit/addons/themes/README.md | 6 - .../support/qunit/addons/themes/gabe.css | 362 -- .../support/qunit/addons/themes/gabe.html | 14 - .../qunit/support/qunit/addons/themes/nv.css | 208 - .../qunit/support/qunit/addons/themes/nv.html | 14 - .../node_modules/qunit/support/qunit/grunt.js | 100 - .../qunit/support/qunit/package.json | 34 - .../qunit/support/qunit/qunit/qunit.css | 231 - .../qunit/support/qunit/qunit/qunit.js | 1934 ------- .../qunit/support/qunit/test/deepEqual.js | 1432 ----- .../qunit/support/qunit/test/headless.html | 24 - .../qunit/support/qunit/test/index.html | 16 - .../qunit/support/qunit/test/logs.html | 13 - .../qunit/support/qunit/test/logs.js | 180 - .../qunit/support/qunit/test/narwhal-test.js | 22 - .../qunit/support/qunit/test/node-test.js | 20 - .../qunit/support/qunit/test/swarminject.js | 9 - .../qunit/support/qunit/test/test.js | 593 -- .../qunit/test/fixtures/async-code.js | 1 - .../qunit/test/fixtures/async-test.js | 27 - .../qunit/test/fixtures/child-code-global.js | 3 - .../test/fixtures/child-code-namespace.js | 3 - .../qunit/test/fixtures/child-tests-global.js | 5 - .../test/fixtures/child-tests-namespace.js | 5 - .../qunit/test/fixtures/testrunner-code.js | 9 - .../qunit/test/fixtures/testrunner-tests.js | 29 - .../test/fixtures/uncaught-exception-code.js | 0 .../test/fixtures/uncaught-exception-test.js | 1 - .../node_modules/qunit/test/testrunner.js | 152 - tests/qunit/qunit.css | 244 - tests/qunit/qunit.js | 1977 ------- tests/tests.js | 234 - 277 files changed, 318 insertions(+), 29868 deletions(-) delete mode 100644 merge.js delete mode 100644 merge.min.js create mode 100644 src/index.ts create mode 100644 test/index.ts delete mode 100644 tests/index.html delete mode 100644 tests/index.js delete mode 100644 tests/qunit/node_modules/.bin/qunit delete mode 100644 tests/qunit/node_modules/.bin/qunit.cmd delete mode 100644 tests/qunit/node_modules/qunit/.gitmodules delete mode 100644 tests/qunit/node_modules/qunit/.npmignore delete mode 100644 tests/qunit/node_modules/qunit/Makefile delete mode 100644 tests/qunit/node_modules/qunit/bin/cli.js delete mode 100644 tests/qunit/node_modules/qunit/index.js delete mode 100644 tests/qunit/node_modules/qunit/lib/child.js delete mode 100644 tests/qunit/node_modules/qunit/lib/coverage.js delete mode 100644 tests/qunit/node_modules/qunit/lib/log.js delete mode 100644 tests/qunit/node_modules/qunit/lib/testrunner.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/argsparser/.npmignore delete mode 100644 tests/qunit/node_modules/qunit/node_modules/argsparser/Makefile delete mode 100644 tests/qunit/node_modules/qunit/node_modules/argsparser/index.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/argsparser/lib/argsparser.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/argsparser/package.json delete mode 100644 tests/qunit/node_modules/qunit/node_modules/argsparser/readme.md delete mode 100644 tests/qunit/node_modules/qunit/node_modules/argsparser/test/test.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/.npmignore delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/.travis.yml delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/README.markdown delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/example/prof.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/example/tiny.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/example/top/run.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/example/top/src.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/index.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/.npmignore delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/.travis.yml delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/README.markdown delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/example/microwave.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/example/web/bs.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/example/web/index.html delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/example/web/main.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/example/web/server.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/example/wrap.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/index.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/.bin/uglifyjs delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/.bin/uglifyjs.cmd delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/.npmignore delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/LICENSE delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/README.markdown delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/examples/json.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/examples/leaves.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/examples/negative.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/examples/scrub.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/examples/stringify.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/index.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/main.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/package.json delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/circular.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/date.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/equal.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/instance.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/interface.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/json.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/keys.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/leaves.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/lib/deep_equal.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/mutability.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/negative.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/obj.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/siblings.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/stop.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/stringify.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/subexpr.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/super_deep.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/.npmignore delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/README.html delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/README.org delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/bin/uglifyjs delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/docstyle.css delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/lib/object-ast.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/lib/parse-js.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/lib/process.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/lib/squeeze-more.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/package.json delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/package.json~ delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/beautify.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/testparser.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/array1.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/array2.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/array3.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/array4.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/assignment.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/concatstring.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/const.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/empty-blocks.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/forstatement.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/if.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/ifreturn.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/ifreturn2.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue10.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue11.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue13.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue14.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue16.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue17.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue20.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue21.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue25.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue27.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue28.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue29.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue30.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue34.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue4.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue48.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue50.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue53.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue54.1.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue68.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue69.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/issue9.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/mangle.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/null_string.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/strict-equals.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/var.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/whitespace.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/expected/with.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/array1.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/array2.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/array3.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/array4.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/assignment.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/concatstring.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/const.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/empty-blocks.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/forstatement.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/if.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/ifreturn.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/ifreturn2.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue10.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue11.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue13.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue14.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue16.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue17.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue20.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue21.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue25.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue27.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue28.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue29.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue30.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue34.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue4.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue48.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue50.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue53.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue54.1.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue68.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue69.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue9.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/mangle.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/null_string.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/strict-equals.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/var.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/whitespace.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/with.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/scripts.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/tmp/hoist.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/tmp/instrument.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/tmp/instrument2.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/tmp/test.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/uglify-js.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/package.json delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/test/ast.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/test/err.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/test/fail.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/test/fail/src.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/test/label.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/test/microwave.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/test/parent.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/test/wrap.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/package.json delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/test/cover.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/test/return.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/bunker/test/src/cover.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/cli-table/.npmignore delete mode 100644 tests/qunit/node_modules/qunit/node_modules/cli-table/History.md delete mode 100644 tests/qunit/node_modules/qunit/node_modules/cli-table/Makefile delete mode 100644 tests/qunit/node_modules/qunit/node_modules/cli-table/README.md delete mode 100644 tests/qunit/node_modules/qunit/node_modules/cli-table/examples/revs.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/cli-table/examples/table.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/cli-table/index.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/cli-table/lib/cli-table/index.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/cli-table/lib/cli-table/utils.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/cli-table/node_modules/colors/MIT-LICENSE.txt delete mode 100644 tests/qunit/node_modules/qunit/node_modules/cli-table/node_modules/colors/ReadMe.md delete mode 100644 tests/qunit/node_modules/qunit/node_modules/cli-table/node_modules/colors/colors.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/cli-table/node_modules/colors/example.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/cli-table/node_modules/colors/package.json delete mode 100644 tests/qunit/node_modules/qunit/node_modules/cli-table/package.json delete mode 100644 tests/qunit/node_modules/qunit/node_modules/cli-table/test/common.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/cli-table/test/index.test.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/tracejs/README.md delete mode 100644 tests/qunit/node_modules/qunit/node_modules/tracejs/package.json delete mode 100644 tests/qunit/node_modules/qunit/node_modules/tracejs/test/fixture/example.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/tracejs/test/test.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/tracejs/trace.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/underscore/.npmignore delete mode 100644 tests/qunit/node_modules/qunit/node_modules/underscore/CNAME delete mode 100644 tests/qunit/node_modules/qunit/node_modules/underscore/LICENSE delete mode 100644 tests/qunit/node_modules/qunit/node_modules/underscore/README.md delete mode 100644 tests/qunit/node_modules/qunit/node_modules/underscore/favicon.ico delete mode 100644 tests/qunit/node_modules/qunit/node_modules/underscore/index.html delete mode 100644 tests/qunit/node_modules/qunit/node_modules/underscore/index.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/underscore/package.json delete mode 100644 tests/qunit/node_modules/qunit/node_modules/underscore/raw/underscore.psd delete mode 100644 tests/qunit/node_modules/qunit/node_modules/underscore/underscore-min.js delete mode 100644 tests/qunit/node_modules/qunit/node_modules/underscore/underscore.js delete mode 100644 tests/qunit/node_modules/qunit/package.json delete mode 100644 tests/qunit/node_modules/qunit/readme.md delete mode 100644 tests/qunit/node_modules/qunit/support/json/cycle.js delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/.npmignore delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/AUTHORS.txt delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/History.md delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/README.md delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/addons/canvas/README.md delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/addons/canvas/canvas-test.js delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/addons/canvas/canvas.html delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/addons/canvas/qunit-canvas.js delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/addons/close-enough/README.md delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/addons/close-enough/close-enough-test.js delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/addons/close-enough/close-enough.html delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/addons/close-enough/qunit-close-enough.js delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/addons/composite/README.md delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/addons/composite/composite-demo-test.html delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/addons/composite/index.html delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/addons/composite/qunit-composite.css delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/addons/composite/qunit-composite.js delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/addons/junitlogger/index.html delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/addons/junitlogger/junitlogger.js delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/addons/phantomjs/README.md delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/addons/phantomjs/runner.js delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/addons/step/README.md delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/addons/step/qunit-step.js delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/addons/step/step-test.js delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/addons/step/step.html delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/addons/themes/README.md delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/addons/themes/gabe.css delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/addons/themes/gabe.html delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/addons/themes/nv.css delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/addons/themes/nv.html delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/grunt.js delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/package.json delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/qunit/qunit.css delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/qunit/qunit.js delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/test/deepEqual.js delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/test/headless.html delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/test/index.html delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/test/logs.html delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/test/logs.js delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/test/narwhal-test.js delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/test/node-test.js delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/test/swarminject.js delete mode 100644 tests/qunit/node_modules/qunit/support/qunit/test/test.js delete mode 100644 tests/qunit/node_modules/qunit/test/fixtures/async-code.js delete mode 100644 tests/qunit/node_modules/qunit/test/fixtures/async-test.js delete mode 100644 tests/qunit/node_modules/qunit/test/fixtures/child-code-global.js delete mode 100644 tests/qunit/node_modules/qunit/test/fixtures/child-code-namespace.js delete mode 100644 tests/qunit/node_modules/qunit/test/fixtures/child-tests-global.js delete mode 100644 tests/qunit/node_modules/qunit/test/fixtures/child-tests-namespace.js delete mode 100644 tests/qunit/node_modules/qunit/test/fixtures/testrunner-code.js delete mode 100644 tests/qunit/node_modules/qunit/test/fixtures/testrunner-tests.js delete mode 100644 tests/qunit/node_modules/qunit/test/fixtures/uncaught-exception-code.js delete mode 100644 tests/qunit/node_modules/qunit/test/fixtures/uncaught-exception-test.js delete mode 100644 tests/qunit/node_modules/qunit/test/testrunner.js delete mode 100644 tests/qunit/qunit.css delete mode 100644 tests/qunit/qunit.js delete mode 100644 tests/tests.js diff --git a/merge.js b/merge.js deleted file mode 100644 index 2aafcad..0000000 --- a/merge.js +++ /dev/null @@ -1,177 +0,0 @@ -/*! - * @name JavaScript/NodeJS Merge v1.2.1 - * @author yeikos - * @repository https://github.com/yeikos/js.merge - - * Copyright 2014 yeikos - MIT license - * https://raw.github.com/yeikos/js.merge/master/LICENSE - */ - -;(function(isNode) { - - /** - * Merge one or more objects - * @param bool? clone - * @param mixed,... arguments - * @return object - */ - - var Public = function(clone) { - - return merge(clone === true, false, arguments); - - }, publicName = 'merge'; - - /** - * Merge two or more objects recursively - * @param bool? clone - * @param mixed,... arguments - * @return object - */ - - Public.recursive = function(clone) { - - return merge(clone === true, true, arguments); - - }; - - /** - * Clone the input removing any reference - * @param mixed input - * @return mixed - */ - - Public.clone = function(input) { - - var output = input, - type = typeOf(input), - index, size; - - if (type === 'array') { - - output = []; - size = input.length; - - for (index=0;index(input: T): T { + + if (Array.isArray(input)) { + + const output = [] + + for (let index = 0; index < input.length; ++index) + output.push(clone(input[index])) + + return output as any + + } else if (isPlainObject(input)) { + + const output: any = {} + + for (let index in input) + output[index] = clone(input[index]) + + return output as any + + } else { + + return input + + } + +} + +export function isPlainObject(input: any): input is Object { + return input && typeof input === 'object' && !Array.isArray(input) +} + +function _recursiveMerge(base: any, extend: any) { + + if (!isPlainObject(base)) + return extend + + for (const key in extend) + base[key] = (isPlainObject(base[key]) && isPlainObject(extend[key])) ? + _recursiveMerge(base[key], extend[key]) : + extend[key] + + return base + +} + +function _merge(isClone: boolean, isRecursive: boolean, items: any[]) { + + let result + + if (isClone || !isPlainObject(result = items.shift())) + result = {} + + for (let index = 0; index < items.length; ++index) { + + const item = items[index] + + if (!isPlainObject(item)) + continue + + for (const key in item) { + if (key === '__proto__') continue + const value = isClone ? clone(item[key]) : item[key] + result[key] = isRecursive ? _recursiveMerge(result[key], value) : value + } + + } + + return result + +} diff --git a/test/index.ts b/test/index.ts new file mode 100644 index 0000000..f898192 --- /dev/null +++ b/test/index.ts @@ -0,0 +1,224 @@ +import { assert } from 'chai'; +import merge from '../src/index'; + +describe('merge', function () { + + it('basic', () => { + + assert.deepEqual( + merge({ a: 1 }, { b: 2 }), + { a: 1, b: 2 } + ) + + assert.deepEqual( + merge({ a: 1 }, { b: { c: { d: 2 } } }), + { a: 1, b: { c: { d: 2 } } } + ) + + }) + + it('clone', () => { + + let input = { + a: 1, + b: { + c: { + d: 2, + e: ['x', 'y', { z: { w: ['k'] } }] + } + }, + f: null, + g: undefined, + h: true + } + + let original = { + a: 1, + b: { + c: { + d: 2, + e: ['x', 'y', { z: { w: ['k'] } }] + } + }, + f: null, + g: undefined, + h: true + } + + let output = merge(true, input); + + input.b.c.d++; + (input.b.c.e[2] as any).z.w = null; + (input as any).h = null; + + assert.deepEqual(original, output); + + input = original; + + output = merge(true, input, { a: 2 }); + + assert.deepEqual(output.a, 2); + assert.deepEqual(input.a, 1); + + }) + + it('invalid input', () => { + + assert.deepEqual( + merge(), {} + ) + + assert.deepEqual( + merge(undefined), {} + ) + + assert.deepEqual( + merge([]), {} + ) + + assert.deepEqual( + merge(true), {} + ) + + assert.deepEqual( + merge(null, true, [0, 1, 2], 3, { a: 1 }, function () { }, undefined, { b: 2 }), + { a: 1, b: 2 } + ) + + }) + + it('prototype pollution attack', () => { + + assert.deepEqual( + merge({}, JSON.parse('{"__proto__": {"a": true}}')), + {} + ) + + }) + +}) + +describe('merge.clone', function () { + + it('object', () => { + + const object1 = { a: 1, b: { c: 2 } } + const object2 = merge.clone(object1) + + assert.deepEqual(object1, object2) + assert.deepEqual(object1 === object2, false) + assert.deepEqual(object1.b === object2.b, false) + + }) + + it('array', () => { + + const object1 = [{ a: 1, b: { c: 2 } }] + const object2 = merge.clone(object1) + + assert.deepEqual(object1, object2) + assert.deepEqual(object1 === object2, false) + assert.deepEqual(object1[0] === object2[0], false) + assert.deepEqual(object1[0].b === object2[0].b, false) + + }) + + it('invalid input', () => { + + assert.deepEqual(merge.clone(null), null) + assert.deepEqual(merge.clone(undefined), undefined) + assert.deepEqual(merge.clone(1), 1) + assert.deepEqual(merge.clone('str'), 'str') + + }) + +}) + +describe('merge.recursive', function () { + + it('basic', () => { + + assert.deepEqual( + merge.recursive({ a: { b: 1 } }, { a: { c: 1 } }), + { a: { b: 1, c: 1 } } + ) + + assert.deepEqual( + merge.recursive({ a: { b: 1, c: 1 } }, { a: { b: 2 } }), + { a: { b: 2, c: 1 } } + ) + + assert.deepEqual( + merge.recursive({ a: { b: [1, 2, 3], c: 1 } }, { a: { b: ['a'] } }), + { a: { b: ['a'], c: 1 } } + ) + + assert.deepEqual( + merge.recursive({ a: { b: { b: 2 }, c: 1 } }, { a: { b: 2 } }), + { a: { b: 2, c: 1 } } + ) + + }) + + it('clone', function () { + + const test1 = { a: { b: 1 } } + + assert.deepEqual( + merge.recursive(true, test1, { a: { c: 1 } }), + { a: { b: 1, c: 1 } } + ); + + assert.deepEqual( + { a: { b: 1 } }, + test1 + ); + + const test2 = { a: { b: 1, c: 1 } }; + + assert.deepEqual( + merge.recursive(true, test2, { a: { b: 2 } }), + { a: { b: 2, c: 1 } } + ); + + assert.deepEqual( + { a: { b: 1, c: 1 } }, + test2 + ) + + const test3 = { a: { b: [1, 2, 3], c: 1 } }; + + assert.deepEqual( + merge.recursive(true, test3, { a: { b: ['a'] } }), + { a: { b: ['a'], c: 1 } } + ) + + assert.deepEqual( + { a: { b: [1, 2, 3], c: 1 } }, + test3 + ) + + const test4 = { a: { b: { b: 2 }, c: 1 } }; + + assert.deepEqual( + merge.recursive(true, test4, { a: { b: 2 } }), + { a: { b: 2, c: 1 } } + ) + + assert.deepEqual( + { a: { b: { b: 2 }, c: 1 } }, + test4 + ) + + }) + + it('prototype pollution attack', function () { + + assert.deepEqual( + merge.recursive({}, JSON.parse('{"__proto__": {"a": true}}')), + {} + ) + + }) + +}) \ No newline at end of file diff --git a/tests/index.html b/tests/index.html deleted file mode 100644 index 939cc80..0000000 --- a/tests/index.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - JavaScript/NodeJS Merge v1.2.0 - - - - - - - - - - - -
- - - - \ No newline at end of file diff --git a/tests/index.js b/tests/index.js deleted file mode 100644 index d004cfb..0000000 --- a/tests/index.js +++ /dev/null @@ -1,8 +0,0 @@ -var qunit = require('./qunit/node_modules/qunit/index.js'); - -qunit.run({ - - code: { path: '../merge.js', namespace: 'merge' }, - tests: 'tests.js' - -}); \ No newline at end of file diff --git a/tests/qunit/node_modules/.bin/qunit b/tests/qunit/node_modules/.bin/qunit deleted file mode 100644 index 3b19a04..0000000 --- a/tests/qunit/node_modules/.bin/qunit +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -basedir=`dirname "$0"` - -case `uname` in - *CYGWIN*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - "$basedir/node" "$basedir/../qunit/bin/cli.js" "$@" - ret=$? -else - node "$basedir/../qunit/bin/cli.js" "$@" - ret=$? -fi -exit $ret diff --git a/tests/qunit/node_modules/.bin/qunit.cmd b/tests/qunit/node_modules/.bin/qunit.cmd deleted file mode 100644 index 67bb8d8..0000000 --- a/tests/qunit/node_modules/.bin/qunit.cmd +++ /dev/null @@ -1,5 +0,0 @@ -@IF EXIST "%~dp0\node.exe" ( - "%~dp0\node.exe" "%~dp0\..\qunit\bin\cli.js" %* -) ELSE ( - node "%~dp0\..\qunit\bin\cli.js" %* -) \ No newline at end of file diff --git a/tests/qunit/node_modules/qunit/.gitmodules b/tests/qunit/node_modules/qunit/.gitmodules deleted file mode 100644 index ad9208d..0000000 --- a/tests/qunit/node_modules/qunit/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "support/qunit"] - path = support/qunit - url = https://github.com/jquery/qunit.git diff --git a/tests/qunit/node_modules/qunit/.npmignore b/tests/qunit/node_modules/qunit/.npmignore deleted file mode 100644 index 9daa824..0000000 --- a/tests/qunit/node_modules/qunit/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -.DS_Store -node_modules diff --git a/tests/qunit/node_modules/qunit/Makefile b/tests/qunit/node_modules/qunit/Makefile deleted file mode 100644 index c6c2b10..0000000 --- a/tests/qunit/node_modules/qunit/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -test: - node ./test/testrunner.js - -.PHONY: install test \ No newline at end of file diff --git a/tests/qunit/node_modules/qunit/bin/cli.js b/tests/qunit/node_modules/qunit/bin/cli.js deleted file mode 100644 index 85dd51e..0000000 --- a/tests/qunit/node_modules/qunit/bin/cli.js +++ /dev/null @@ -1,116 +0,0 @@ -#!/usr/bin/env node - -var util = require('util'), - argsparser = require('argsparser'), - fs = require('fs'); - -var root = __dirname + '/..', - args = argsparser.parse(), - testrunner = require(root), - o = testrunner.options, - code, tests, - help; - -help = '' - + '\nUsage: cli [options] value (boolean value can be used)' - + '\n' - + '\nOptions:' - + '\n -c, --code path to code you want to test' - + '\n -t, --tests path to tests (space separated)' - + '\n -d, --deps dependency paths - files required before code (space separated)' - + '\n -l, --log logging options, json have to be used' - + '\n --cov create tests coverage report' - + '\n -h, --help show this help' - + '\n -v, --version show module version' - + '\n'; - -/** - * Parses a code or dependency argument, returning an object defining the - * specified file path or/and module name. - * The exports of the module will be exposed globally by default. To expose - * exports as a named variable, prefix the resource with the desired variable - * name followed by a colon. - * This allows you to more accurately recreate browser usage of QUnit, for - * tests which are portable between browser runtime environmemts and Node.js. - * @param {string} path to file or module name to require. - * @return {Object} resource - */ -function parsePath(path) { - var parts = path.split(':'), - resource = { - path: path - }; - - if (parts.length === 2) { - resource.namespace = parts[0]; - resource.path = parts[1]; - } - - return resource; -} - -for (var key in args) { - switch(key) { - case 'node': - // Skip the 'node' argument - break; - case '-c': - case '--code': - code = parsePath(args[key]); - break; - case '-t': - case '--tests': - // it's assumed that tests arguments will be file paths whose - // contents are to be made global. This is consistent with use - // of QUnit in browsers. - tests = args[key]; - break; - case '-d': - case '--deps': - o.deps = args[key]; - if (!Array.isArray(o.deps)) { - o.deps = [o.deps]; - } - o.deps = o.deps.map(parsePath); - break; - case '-l': - case '--log': - eval('o.log = ' + args[key]); - break; - case '--cov': - o.coverage = args[key]; - break; - case '-p': - case '--paths': - o.paths = args[key]; - break; - case '-v': - case '--version': - util.print( - JSON.parse( - fs.readFileSync(__dirname + '/../package.json') - ).version + '\n' - ); - return; - case '-h': - case '-?': - case '--help': - util.print(help); - return; - } -} -if(!code || !tests) { - util.print(help); - util.print('\nBoth --code and --tests arguments are required\n'); - return; -} - -testrunner.run({ code: code, tests: tests }, function(err, stats) { - if (err) { - console.error(err); - process.exit(1); - return; - } - - process.exit(stats.failed > 0 ? 1 : 0); -}); diff --git a/tests/qunit/node_modules/qunit/index.js b/tests/qunit/node_modules/qunit/index.js deleted file mode 100644 index 99d9364..0000000 --- a/tests/qunit/node_modules/qunit/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/testrunner"); diff --git a/tests/qunit/node_modules/qunit/lib/child.js b/tests/qunit/node_modules/qunit/lib/child.js deleted file mode 100644 index 5e5d970..0000000 --- a/tests/qunit/node_modules/qunit/lib/child.js +++ /dev/null @@ -1,138 +0,0 @@ -var QUnit = require('../support/qunit/qunit/qunit.js'), - path = require('path'), - _ = require('underscore'), - trace = require('tracejs').trace; - -// cycle.js: This file contains two functions, JSON.decycle and JSON.retrocycle, -// which make it possible to encode cyclical structures and dags in JSON, and to -// then recover them. JSONPath is used to represent the links. -// http://GOESSNER.net/articles/JsonPath/ -require('../support/json/cycle'); - -var options = JSON.parse(process.argv[2]), - currentModule = path.basename(options.code.path, '.js'), - currentTest; - -process.on('uncaughtException', function(err) { - process.send({event: 'uncaughtException'}); - if (QUnit.config.current) { - QUnit.ok(false, 'Test threw unexpected exception: ' + err); - QUnit.start(); - } else { - throw err; - } -}); - -QUnit.config.autorun = false; -QUnit.config.autostart = false; - -// make qunit api global, like it is in the browser -_.extend(global, QUnit); - -// as well as the QUnit variable itself -global.QUnit = QUnit; - -/** - * Require a resource. - * @param {Object} res - */ -function _require(res, addToGlobal) { - var exports = require(res.path.replace(/\.js$/, '')); - - if (addToGlobal) { - // resource can define 'namespace' to expose its exports as a named object - if (res.namespace) { - global[res.namespace] = exports; - } else { - _.extend(global, exports); - } - } - - QUnit.start(); -} - -/** - * Calculate coverage stats using bunker - */ -function calcCoverage() { - -} - -/** - * Callback for each started test. - * @param {Object} test - */ -QUnit.testStart(function(test) { - // currentTest is undefined while first test is not done yet - currentTest = test.name; - - // use last module name if no module name defined - currentModule = test.module || currentModule; -}); - -/** - * Callback for each assertion. - * @param {Object} data - */ -QUnit.log(function(data) { - data.test = this.config.current.testName; - data.module = currentModule; - process.send({ - event: 'assertionDone', - data: JSON.decycle(data) - }); -}); - -/** - * Callback for one done test. - * @param {Object} test - */ -QUnit.testDone(function(data) { - // use last module name if no module name defined - data.module = data.module || currentModule; - process.send({ - event: 'testDone', - data: data - }); -}); - -/** - * Callback for all done tests in the file. - * @param {Object} res - */ -QUnit.done(_.debounce(function(data) { - if (options.coverage) { - data.coverage = calcCoverage(); - } - - process.send({ - event: 'done', - data: data - }); -}, 1000)); - -/** - * Provide better stack traces - */ -var error = console.error; -console.error = function(obj) { - // log full stacktrace - if (obj && obj.stack) { - obj = trace(obj); - } - - return error.apply(this, arguments); -}; - -// require deps -options.deps.forEach(function(dep) { - _require(dep, true); -}); - -// require code -_require(options.code, true); - -// require tests -options.tests.forEach(function(res) { - _require(res, false); -}); diff --git a/tests/qunit/node_modules/qunit/lib/coverage.js b/tests/qunit/node_modules/qunit/lib/coverage.js deleted file mode 100644 index 0c1365b..0000000 --- a/tests/qunit/node_modules/qunit/lib/coverage.js +++ /dev/null @@ -1,35 +0,0 @@ -var fs = require('fs'), - util = require('util'), - _ = require('underscore'), - bunker; - -try { - bunker = require('bunker'); -} catch (err) {} - -exports.instrument = function(path) { - var src = fs.readFileSync(path, 'utf-8'), - newSrc = bunker(src).compile(); - - fs.renameSync(src, '__' + src); - fs.writeFileSync(path, newSrc, 'utf-8'); -}; - - -exports.restore = function(path) { - // do it only if the original file exist - if (fs.statSync('__' + path).isFile()) { - fs.unlinkSync(path); - fs.renameSync('__' + path, path); - } - -}; - -if (!bunker) { - _.each(exports, function(fn, name) { - exports[name] = function() { - util.error('Module "bunker" is not installed.'.red); - process.exit(1); - }; - }); -} diff --git a/tests/qunit/node_modules/qunit/lib/log.js b/tests/qunit/node_modules/qunit/lib/log.js deleted file mode 100644 index 80aac10..0000000 --- a/tests/qunit/node_modules/qunit/lib/log.js +++ /dev/null @@ -1,197 +0,0 @@ -var Table = require('cli-table'); - -var data, - log = console.log; - -data = { - assertions: [], - tests: [], - summaries: [] -}; - -exports.assertion = function(d) { - if (d) { - data.assertions.push(d); - } - - return data.assertions; -}; - -exports.test = function(d) { - if (d) { - data.tests.push(d); - } - - return data.tests; -}; - -exports.summary = function(d) { - if (d) { - data.summaries.push(d); - } - - return data.summaries; -}; - -/** - * Get global tests stats in unified format - */ -exports.stats = function() { - var stats = { - files: 0, - assertions: 0, - failed: 0, - passed: 0, - runtime: 0 - }; - - data.summaries.forEach(function(file) { - stats.files++; - stats.assertions += file.total; - stats.failed += file.failed; - stats.passed += file.passed; - stats.runtime += file.runtime; - }); - - stats.tests = data.tests.length; - - return stats; -}; - -/** - * Reset global stats data - */ -exports.reset = function() { - data = { - assertions: [], - tests: [], - summaries: [] - }; -}; - -var print = exports.print = {}; - -print.assertions = function() { - var table, - currentModule, module, - currentTest, test; - - table = new Table({ - head: ['Module', 'Test', 'Assertion', 'Result'], - colWidths: [40, 40, 40, 8] - }); - - data.assertions.forEach(function(data) { - // just easier to read the table - if (data.module === currentModule) { - module = ''; - } else { - module = currentModule = data.module; - } - - // just easier to read the table - if (data.test === currentTest) { - test = ''; - } else { - test = currentTest = data.test; - } - - table.push([module, test, data.message, data.result ? 'ok' : 'fail']); - }); - - log('\nAssertions:\n' + table.toString()); -}; - -print.errors = function() { - var errors = []; - - data.assertions.forEach(function(data) { - if (!data.result) { - errors.push(data); - } - }); - - if (errors.length) { - log('\n\nErrors:'); - errors.forEach(function(data) { - log('\nModule: ' + data.module + ' Test: ' + data.test); - if (data.message) { - log(data.message); - } - - if (data.source) { - log(data.source); - } - - if (data.expected != null || data.actual != null) { - //it will be an error if data.expected !== data.actual, but if they're - //both undefined, it means that they were just not filled out because - //no assertions were hit (likely due to code error that would have been logged as source or message). - log('Actual value:'); - log(data.actual); - log('Expected value:'); - log(data.expected); - } - }); - } -}; - -print.tests = function() { - var table, - currentModule, module; - - table = new Table({ - head: ['Module', 'Test', 'Failed', 'Passed', 'Total'], - colWidths: [40, 40, 8, 8, 8] - }); - - data.tests.forEach(function(data) { - // just easier to read the table - if (data.module === currentModule) { - module = ''; - } else { - module = currentModule = data.module; - } - - table.push([module, data.name, data.failed, data.passed, data.total]); - }); - - log('\nTests:\n' + table.toString()); -}; - -print.summary = function() { - var table, fileColWidth = 50; - - table = new Table({ - head: ['File', 'Failed', 'Passed', 'Total', 'Runtime'], - colWidths: [fileColWidth + 2, 10, 10, 10, 10] - }); - - data.summaries.forEach(function(data) { - var code = data.code; - - // truncate file name - if (code.length > fileColWidth) { - code = '...' + code.slice(code.length - fileColWidth + 3); - } - - table.push([code, data.failed, data.passed, data.total, data.runtime]); - }); - - log('\nSummary:\n' + table.toString()); -}; - -print.globalSummary = function() { - var table, - data = exports.stats(); - - table = new Table({ - head: ['Files', 'Tests', 'Assertions', 'Failed', 'Passed', 'Runtime'], - colWidths: [12, 12, 12, 12, 12, 12] - }); - - table.push([data.files, data.tests, data.assertions, data.failed, - data.passed, data.runtime]); - - log('\nGlobal summary:\n' + table.toString()); -}; diff --git a/tests/qunit/node_modules/qunit/lib/testrunner.js b/tests/qunit/node_modules/qunit/lib/testrunner.js deleted file mode 100644 index 97f716d..0000000 --- a/tests/qunit/node_modules/qunit/lib/testrunner.js +++ /dev/null @@ -1,182 +0,0 @@ -var fs = require('fs'), - path = require('path'), - coverage = require('./coverage'), - cp = require('child_process'), - _ = require('underscore'), - log = exports.log = require('./log'), - util = require('util'); - -var options, - noop = function() {}; - -options = exports.options = { - - // logging options - log: { - - // log assertions overview - assertions: true, - - // log expected and actual values for failed tests - errors: true, - - // log tests overview - tests: true, - - // log summary - summary: true, - - // log global summary (all files) - globalSummary: true, - - // log currently testing code file - testing: true - }, - - // run test coverage tool - coverage: false, - - // define dependencies, which are required then before code - deps: null, - - // define namespace your code will be attached to on global['your namespace'] - namespace: null -}; - -/** - * Run one spawned instance with tests - * @param {Object} opts - * @param {Function} callback - */ -function runOne(opts, callback) { - var child; - - child = cp.fork( - __dirname + '/child.js', - [JSON.stringify(opts)], - {env: process.env} - ); - - function kill() { - process.removeListener('exit', kill); - child.kill(); - } - - child.on('message', function(msg) { - if (msg.event === 'assertionDone') { - log.assertion(msg.data); - } else if (msg.event === 'testDone') { - log.test(msg.data); - } else if (msg.event === 'done') { - msg.data.code = opts.code.path; - log.summary(msg.data); - if (opts.log.testing) { - util.print('done'); - } - callback(null, msg.data); - kill(); - } else if (msg.event === 'uncaughtException') { - callback(new Error('Uncaught exception in child process.')); - kill(); - } - }); - - process.on('exit', kill); - - if (opts.log.testing) { - util.print('\nTesting ', opts.code.path + ' ... '); - } -} - -/** - * Make an absolute path from relative - * @param {string|Object} file - * @return {Object} - */ -function absPath(file) { - if (typeof file === 'string') { - file = {path: file}; - } - - if (file.path.charAt(0) != '/') { - file.path = path.resolve(process.cwd(), file.path); - } - - return file; -} - -/** - * Convert path or array of paths to array of abs paths - * @param {Array|string} files - * @return {Array} - */ -function absPaths(files) { - var ret = []; - - if (Array.isArray(files)) { - files.forEach(function(file) { - ret.push(absPath(file)); - }); - } else if (files) { - ret.push(absPath(files)); - } - - return ret; -} - -/** - * Run tests in spawned node instance async for every test. - * @param {Object|Array} files - * @param {Function} callback optional - */ -exports.run = function(files, callback) { - var filesCount = 0; - - callback || (callback = noop); - - if (!Array.isArray(files)) { - files = [files]; - } - - files.forEach(function(file) { - var opts = _.extend({}, options, file); - - !opts.log && (opts.log = {}); - opts.deps = absPaths(opts.deps); - opts.code = absPath(opts.code); - opts.tests = absPaths(opts.tests); - - function done(err, stat) { - if (err) { - return callback(err); - } - - filesCount++; - - if (filesCount >= files.length) { - _.each(opts.log, function(val, name) { - if (val && log.print[name]) { - log.print[name](); - } - }) - - callback(null, log.stats()); - } - } - - if (opts.coverage) { - coverage.instrument(opts.code); - } else { - runOne(opts, done); - } - }); -}; - - -/** - * Set options - * @param {Object} - */ -exports.setup = function(opts) { - _.extend(options, opts); -}; diff --git a/tests/qunit/node_modules/qunit/node_modules/argsparser/.npmignore b/tests/qunit/node_modules/qunit/node_modules/argsparser/.npmignore deleted file mode 100644 index 496ee2c..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/argsparser/.npmignore +++ /dev/null @@ -1 +0,0 @@ -.DS_Store \ No newline at end of file diff --git a/tests/qunit/node_modules/qunit/node_modules/argsparser/Makefile b/tests/qunit/node_modules/qunit/node_modules/argsparser/Makefile deleted file mode 100644 index 5e9c4b0..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/argsparser/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -test: - node test/test.js - -.PHONY: test \ No newline at end of file diff --git a/tests/qunit/node_modules/qunit/node_modules/argsparser/index.js b/tests/qunit/node_modules/qunit/node_modules/argsparser/index.js deleted file mode 100644 index dd1cb00..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/argsparser/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./lib/argsparser'); diff --git a/tests/qunit/node_modules/qunit/node_modules/argsparser/lib/argsparser.js b/tests/qunit/node_modules/qunit/node_modules/argsparser/lib/argsparser.js deleted file mode 100644 index d3a8092..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/argsparser/lib/argsparser.js +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Parser arguments array - * @param {Array} args optional arguments arrray. - * @return {Object} opts key value hash. - * @export - */ -exports.parse = function(args) { - // args is optional, default is process.argv - args = args || process.argv; - - var opts = {}, curSwitch; - - args.forEach(function(arg) { - // its a switch - if (/^(-|--)/.test(arg) || !curSwitch) { - opts[arg] = true; - curSwitch = arg; - // this arg is a data - } else { - if (arg === 'false') { - arg = false; - } else if (arg === 'true') { - arg = true; - } else if (!isNaN(arg)) { - arg = Number(arg); - } - - // it was a boolean switch per default, - // now it has got a val - if (typeof opts[curSwitch] === 'boolean') { - opts[curSwitch] = arg; - } else if (Array.isArray(opts[curSwitch])) { - opts[curSwitch].push(arg); - } else { - opts[curSwitch] = [opts[curSwitch], arg]; - } - } - }); - - return opts; -}; diff --git a/tests/qunit/node_modules/qunit/node_modules/argsparser/package.json b/tests/qunit/node_modules/qunit/node_modules/argsparser/package.json deleted file mode 100644 index 1261a37..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/argsparser/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "argsparser", - "description": "A tiny command line arguments parser", - "version": "0.0.6", - "author": { - "name": "Oleg Slobodskoi", - "email": "oleg008@gmail.com" - }, - "repository": { - "type": "git", - "url": "http://github.com/kof/node-argsparser.git" - }, - "keywords": [ - "arguments", - "options", - "command line", - "parser" - ], - "engines": { - "node": ">= 0.2.0" - }, - "scripts": { - "test": "node ./test/test.js" - }, - "licenses": [ - { - "type": "MIT", - "url": "http://www.opensource.org/licenses/mit-license.php" - } - ], - "readme": "## Yet another tiny arguments parser for node\n\n## Features\n * extremely tiny\n * instead to parse all possible spellings, it uses just some simple rules\n\n## How this parser works\nThe target is to get a key-value object from an array. A key can be the first element or element prefixed by \"-\" and \"--\" (switch). \nSo the parser loops through the array and looks for keys. After he could detect an a key all next elements will be added as a value of this key until he find another key.\nIf there is no value, then the key is true (boolean). If there are a lot of values, then the key is an array.\n\n## Examples\n\nnode script.js -> {\"node\": \"script.js\"}\n\nnode script.js -o -> {\"node\": \"script.js\", \"-o\": true}\n\nnode script.js -o test -> {\"node\": \"script.js\", \"-o\": \"test\"}\n\nnode script.js -a testa --b testb -> {node: \"script.js\", \"-a\": \"testa\", \"--b\": \"testb\"}\n \nnode script.js -paths /test.js /test1.js -> {node: \"script.js\", \"-paths\": [\"/test.js\", \"/test1.js\"]}\n\n## Usage\n\n // per default it parses process.argv\n var args = require( \"argsparser\" ).parse(); // {\"node\": \"/path/to/your/script.js\"}\n \n // optional you can pass your own arguments array\n var args = require( \"argsparser\" ).parse([\"-a\", \"test\"]); // {\"-a\": \"test\"}\n\n \n## Installation\n npm install argsparser ", - "readmeFilename": "readme.md", - "_id": "argsparser@0.0.6", - "_from": "argsparser@0.0.6" -} diff --git a/tests/qunit/node_modules/qunit/node_modules/argsparser/readme.md b/tests/qunit/node_modules/qunit/node_modules/argsparser/readme.md deleted file mode 100644 index 9cde9ae..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/argsparser/readme.md +++ /dev/null @@ -1,34 +0,0 @@ -## Yet another tiny arguments parser for node - -## Features - * extremely tiny - * instead to parse all possible spellings, it uses just some simple rules - -## How this parser works -The target is to get a key-value object from an array. A key can be the first element or element prefixed by "-" and "--" (switch). -So the parser loops through the array and looks for keys. After he could detect an a key all next elements will be added as a value of this key until he find another key. -If there is no value, then the key is true (boolean). If there are a lot of values, then the key is an array. - -## Examples - -node script.js -> {"node": "script.js"} - -node script.js -o -> {"node": "script.js", "-o": true} - -node script.js -o test -> {"node": "script.js", "-o": "test"} - -node script.js -a testa --b testb -> {node: "script.js", "-a": "testa", "--b": "testb"} - -node script.js -paths /test.js /test1.js -> {node: "script.js", "-paths": ["/test.js", "/test1.js"]} - -## Usage - - // per default it parses process.argv - var args = require( "argsparser" ).parse(); // {"node": "/path/to/your/script.js"} - - // optional you can pass your own arguments array - var args = require( "argsparser" ).parse(["-a", "test"]); // {"-a": "test"} - - -## Installation - npm install argsparser \ No newline at end of file diff --git a/tests/qunit/node_modules/qunit/node_modules/argsparser/test/test.js b/tests/qunit/node_modules/qunit/node_modules/argsparser/test/test.js deleted file mode 100644 index 811de42..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/argsparser/test/test.js +++ /dev/null @@ -1,39 +0,0 @@ -var a = require('assert'), - util = require('util'), - parse = require('../lib/argsparser').parse; - -util.print('Run tests...\n'); - -a.deepEqual(parse(), {node: __filename}, 'node script.js'); - -a.deepEqual(parse(['-o']), {'-o': true}, 'node script.js -o'); - -a.deepEqual(parse(['-o', 'true']), {'-o': true}, 'node script.js -o true'); - -a.deepEqual(parse(['-o', 'false']), {'-o': false}, 'node script.js -o false'); - -a.deepEqual(parse(['-o', '123']), {'-o': 123}, 'node script.js -o 123'); - -a.deepEqual(parse(['--token', 'bla--bla']), {'--token': 'bla--bla'}, 'node script.js --token bla--bla'); - -a.deepEqual(parse(['-o', '123.456']), {'-o': 123.456}, 'node script.js -o 123.456'); - -a.deepEqual(parse(['-o', 'test']), {'-o': 'test'}, 'node script.js -o test'); - -a.deepEqual(parse(['-a', 'testa', '-b', 'testb']), {'-a': 'testa', '-b': 'testb'}, 'node script.js -a testa -b testb'); - -a.deepEqual(parse(['--a', 'testa', '--b', 'testb']), {'--a': 'testa', '--b': 'testb'}, 'node script.js --a testa --b testb '); - -a.deepEqual(parse(['-a', 'testa', '--b', 'testb']), {'-a': 'testa', '--b': 'testb'}, 'node script.js -a testa --b testb'); - -a.deepEqual(parse(['--a', 'testa', '-b', 'testb']), {'--a': 'testa', '-b': 'testb'}, 'node script.js --a testa -b testb'); - -a.deepEqual(parse(['-paths', '/test.js', '/test1.js']), {'-paths': ['/test.js', '/test1.js']}, 'node script.js -paths /test.js /test1.js'); - -a.deepEqual(parse(['--paths', '/test.js', '/test1.js']), {'--paths': ['/test.js', '/test1.js']}, 'node script.js --paths /test.js /test1.js'); - -a.deepEqual(parse(['--paths', '/test.js', '/test1.js', '-a', 'testa']), {'--paths': ['/test.js', '/test1.js'], '-a': 'testa'}, 'node script.js --paths /test.js /test1.js -a testa'); - -a.deepEqual(parse(['--port', '80', '8080']), {'--port': [80, 8080]}, 'node server.js --port 80 8080'); - -util.print('All tests ok\n'); diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/.npmignore b/tests/qunit/node_modules/qunit/node_modules/bunker/.npmignore deleted file mode 100644 index 3c3629e..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/.travis.yml b/tests/qunit/node_modules/qunit/node_modules/bunker/.travis.yml deleted file mode 100644 index f1d0f13..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.4 - - 0.6 diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/README.markdown b/tests/qunit/node_modules/qunit/node_modules/bunker/README.markdown deleted file mode 100644 index 0d0c387..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/README.markdown +++ /dev/null @@ -1,82 +0,0 @@ -bunker -====== - -Bunker is a module to calculate code coverage using native javascript -[burrito](https://github.com/substack/node-burrito) AST trickery. - -[![build status](https://secure.travis-ci.org/substack/node-bunker.png)](http://travis-ci.org/substack/node-bunker) - -![code coverage](http://substack.net/images/code_coverage.png) - -examples -======== - -tiny ----- - -````javascript -var bunker = require('bunker'); -var b = bunker('var x = 0; for (var i = 0; i < 30; i++) { x++ }'); - -var counts = {}; - -b.on('node', function (node) { - if (!counts[node.id]) { - counts[node.id] = { times : 0, node : node }; - } - counts[node.id].times ++; -}); - -b.run(); - -Object.keys(counts).forEach(function (key) { - var count = counts[key]; - console.log(count.times + ' : ' + count.node.source()); -}); -```` - -output: - - $ node example/tiny.js - 1 : var x=0; - 31 : i<30 - 30 : i++ - 30 : x++; - 30 : x++ - -methods -======= - -var bunker = require('bunker'); - -var b = bunker(src) -------------------- - -Create a new bunker code coverageifier with some source `src`. - -The bunker object `b` is an `EventEmitter` that emits `'node'` events with two -parameters: - -* `node` - the [burrito](https://github.com/substack/node-burrito) node object -* `stack` - the stack, [stackedy](https://github.com/substack/node-stackedy) style - -b.include(src) --------------- - -Include some source into the bunker. - -b.compile() ------------ - -Return the source wrapped with burrito. - -b.assign(context={}) --------------------- - -Assign the statement-tracking functions into `context`. - -b.run(context={}) ------------------ - -Run the source using `vm.runInNewContext()` with some `context`. -The statement-tracking functions will be added to `context` by `assign()`. diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/example/prof.js b/tests/qunit/node_modules/qunit/node_modules/bunker/example/prof.js deleted file mode 100644 index 5cac4cc..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/example/prof.js +++ /dev/null @@ -1,51 +0,0 @@ -var bunker = require('bunker'); -var b = bunker('(' + function () { - function beep () { - var x = 0; - for (var i = 0; i < 1000; i++) { - for (var j = 0; j < 100; j++) { - x += j; - } - } - return x; - } - - beep(); - -} + ')()'); - -var counts = {}; - -b.on('node', function (node) { - if (!counts[node.id]) { - counts[node.id] = { times : 0, node : node, elapsed : 0 }; - } - counts[node.id].times ++; - - var now = Date.now(); - - if (last.id !== undefined) { - counts[last.id].elapsed += last. - } - - if (node.name === 'call') { - var start = now; - - last.id = node.id; - counts[node.id].elapsed += Date.now() - start; - } - else { - counts[node.id].elapsed += now - last; - last = now; - } -}); - -b.run(); - -Object.keys(counts).forEach(function (key) { - var count = counts[key]; - console.log( - [ count.times, count.node.source(), count.elapsed ] - .join(' : ') - ); -}); diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/example/tiny.js b/tests/qunit/node_modules/qunit/node_modules/bunker/example/tiny.js deleted file mode 100644 index aa5b034..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/example/tiny.js +++ /dev/null @@ -1,18 +0,0 @@ -var bunker = require('bunker'); -var b = bunker('var x = 0; for (var i = 0; i < 30; i++) { x++ }'); - -var counts = {}; - -b.on('node', function (node) { - if (!counts[node.id]) { - counts[node.id] = { times : 0, node : node }; - } - counts[node.id].times ++; -}); - -b.run(); - -Object.keys(counts).forEach(function (key) { - var count = counts[key]; - console.log(count.times + ' : ' + count.node.source()); -}); diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/example/top/run.js b/tests/qunit/node_modules/qunit/node_modules/bunker/example/top/run.js deleted file mode 100644 index d9eaa10..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/example/top/run.js +++ /dev/null @@ -1,31 +0,0 @@ -var bunker = require('bunker'); -var fs = require('fs'); -var src = fs.readFileSync(__dirname + '/src.js', 'utf8'); - -var counts = {}; - -var b = bunker(src); -b.on('node', function (node) { - if (!counts[node.id]) { - counts[node.id] = { times : 0, node : node }; - } - counts[node.id].times ++; -}); - -b.run({ - setInterval : setInterval, - clearInterval : clearInterval, - end : function () { - Object.keys(counts) - .sort(function (a, b) { - return counts[b].times - counts[a].times - }) - .forEach(function (key) { - var count = counts[key]; - console.log( - count.times + ' : ' + count.node.source() - ); - }) - ; - } -}); diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/example/top/src.js b/tests/qunit/node_modules/qunit/node_modules/bunker/example/top/src.js deleted file mode 100644 index 0c92e48..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/example/top/src.js +++ /dev/null @@ -1,18 +0,0 @@ -function boop () { - for (var i = 0; i < 30; i++) { - nop(); - } -} - -function nop () { - return undefined; -} - -var times = 0; -var iv = setInterval(function () { - if (++times === 10) { - clearInterval(iv); - end(); - } - else boop() -}, 100); diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/index.js b/tests/qunit/node_modules/qunit/node_modules/bunker/index.js deleted file mode 100644 index ed5d437..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/index.js +++ /dev/null @@ -1,116 +0,0 @@ -var burrito = require('burrito'); -var vm = require('vm'); -var EventEmitter = require('events').EventEmitter; - -module.exports = function (src) { - var b = new Bunker(); - if (src) b.include(src); - return b; -}; - -function Bunker () { - this.sources = []; - this.nodes = []; - - this.names = { - call : burrito.generateName(6), - expr : burrito.generateName(6), - stat : burrito.generateName(6), - return : burrito.generateName(6) - }; -} - -Bunker.prototype = new EventEmitter; - -Bunker.prototype.include = function (src) { - this.sources.push(src); - this.source = null; - return this; -}; - -Bunker.prototype.compile = function () { - var src = this.sources.join('\n'); - var nodes = this.nodes; - var names = this.names; - - return burrito(src, function (node) { - var i = nodes.length; - - if (node.name === 'call') { - nodes.push(node); - node.wrap(names.call + '(' + i + ')(%s)'); - } - else if (node.name === 'stat' || node.name === 'throw' - || node.name === 'var') { - nodes.push(node); - node.wrap('{' + names.stat + '(' + i + ');%s}'); - } - else if (node.name === 'return') { - nodes.push(node); - // We need to wrap the new source in a function definition - // so that UglifyJS will allow the presence of return - var stat = names.stat + '(' + i + ');'; - var wrapped = 'function ' + names.return + '() {' - + stat + node.source() - +'}' - ; - var parsed = burrito.parse(wrapped); - // Remove the function definition from the AST - parsed[1] = parsed[1][0][3]; - node.state.update(parsed, true); - } - else if (node.name === 'binary') { - nodes.push(node); - node.wrap(names.expr + '(' + i + ')(%s)'); - } - else if (node.name === 'unary-postfix' || node.name === 'unary-prefix') { - nodes.push(node); - node.wrap(names.expr + '(' + i + ')(%s)'); - } - - if (i !== nodes.length) { - node.id = i; - } - }); -}; - -Bunker.prototype.assign = function (context) { - if (!context) context = {}; - - var self = this; - var stack = []; - - context[self.names.call] = function (i) { - var node = self.nodes[i]; - stack.unshift(node); - self.emit('node', node, stack); - - return function (expr) { - stack.shift(); - return expr; - }; - }; - - context[self.names.expr] = function (i) { - var node = self.nodes[i]; - self.emit('node', node, stack); - - return function (expr) { - return expr; - }; - }; - - context[self.names.stat] = function (i) { - var node = self.nodes[i]; - self.emit('node', node, stack); - }; - - return context; -}; - -Bunker.prototype.run = function (context) { - var src = this.compile(); - vm.runInNewContext(src, this.assign(context)); - - return this; -}; diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/.npmignore b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/.npmignore deleted file mode 100644 index 3c3629e..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/.travis.yml b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/.travis.yml deleted file mode 100644 index f1d0f13..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.4 - - 0.6 diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/README.markdown b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/README.markdown deleted file mode 100644 index 7c9097c..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/README.markdown +++ /dev/null @@ -1,187 +0,0 @@ -burrito -======= - -Burrito makes it easy to do crazy stuff with the javascript AST. - -This is super useful if you want to roll your own stack traces or build a code -coverage tool. - -[![build status](https://secure.travis-ci.org/substack/node-burrito.png)](http://travis-ci.org/substack/node-burrito) - -![node.wrap("burrito")](http://substack.net/images/burrito.png) - -examples -======== - -microwave ---------- - -examples/microwave.js - -````javascript -var burrito = require('burrito'); - -var res = burrito.microwave('Math.sin(2)', function (node) { - if (node.name === 'num') node.wrap('Math.PI / %s'); -}); - -console.log(res); // sin(pi / 2) == 1 -```` - -output: - - 1 - -wrap ----- - -examples/wrap.js - -````javascript -var burrito = require('burrito'); - -var src = burrito('f() && g(h())\nfoo()', function (node) { - if (node.name === 'call') node.wrap('qqq(%s)'); -}); - -console.log(src); -```` - -output: - - qqq(f()) && qqq(g(qqq(h()))); - - qqq(foo()); - -methods -======= - - var burrito = require('burrito'); - -burrito(code, cb) ------------------ - -Given some source `code` and a function `trace`, walk the ast by expression. - -The `cb` gets called with a node object described below. - -If `code` is an Array then it is assumbed to be an AST which you can generate -yourself with `burrito.parse()`. The AST must be annotated, so make sure to -`burrito.parse(src, false, true)`. - -burrito.microwave(code, context={}, cb) ---------------------------------------- - -Like `burrito()` except the result is run using -`vm.runInNewContext(res, context)`. - -node object -=========== - -node.name ---------- - -Name is a string that contains the type of the expression as named by uglify. - -node.wrap(s) ------------- - -Wrap the current expression in `s`. - -If `s` is a string, `"%s"` will be replaced with the stringified current -expression. - -If `s` is a function, it is called with the stringified current expression and -should return a new stringified expression. - -If the `node.name === "binary"`, you get the subterms "%a" and "%b" to play with -too. These subterms are applied if `s` is a function too: `s(expr, a, b)`. - -Protip: to insert multiple statements you can use javascript's lesser-known block -syntax that it gets from C: - -````javascript -if (node.name === 'stat') node.wrap('{ foo(); %s }') -```` - -node.node ---------- - -raw ast data generated by uglify - -node.value ----------- - -`node.node.slice(1)` to skip the annotations - -node.start ----------- - -The start location of the expression, like this: - -````javascript -{ type: 'name', - value: 'b', - line: 0, - col: 3, - pos: 3, - nlb: false, - comments_before: [] } -```` - -node.end --------- - -The end location of the expression, formatted the same as `node.start`. - -node.state ----------- - -The state of the traversal using traverse. - -node.source() -------------- - -Returns a stringified version of the expression. - -node.parent() -------------- - -Returns the parent `node` or `null` if the node is the root element. - -node.label() ------------- - -Return the label of the present node or `null` if there is no label. - -Labels are returned for "call", "var", "defun", and "function" nodes. - -Returns an array for "var" nodes since `var` statements can -contain multiple labels in assignment. - -install -======= - -With [npm](http://npmjs.org) you can just: - - npm install burrito - -in the browser -============== - -Burrito works in browser with -[browserify](https://github.com/substack/node-browserify). - -It has been tested against: - -* Internet Explorer 5.5, 6.0, 7.0, 8.0, 9.0 -* Firefox 3.5 -* Chrome 6.0 -* Opera 10.6 -* Safari 5.0 - -kudos -===== - -Heavily inspired by (and previously mostly lifted outright from) isaacs's nifty -tmp/instrument.js thingy from uglify-js. diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/example/microwave.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/example/microwave.js deleted file mode 100644 index c6fcf45..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/example/microwave.js +++ /dev/null @@ -1,8 +0,0 @@ -var burrito = require('burrito'); - -var res = burrito.microwave('Math.sin(2)', function (node) { - console.dir(node); - if (node.name === 'num') node.wrap('Math.PI / %s'); -}); - -console.log(res); // sin(pi / 2) == 1 diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/example/web/bs.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/example/web/bs.js deleted file mode 100644 index 3583c7f..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/example/web/bs.js +++ /dev/null @@ -1,4832 +0,0 @@ -var require = function (file, cwd) { - var resolved = require.resolve(file, cwd || '/'); - var mod = require.modules[resolved]; - if (!mod) throw new Error( - 'Failed to resolve module ' + file + ', tried ' + resolved - ); - var res = mod._cached ? mod._cached : mod(); - return res; -} -var __require = require; - -require.paths = []; -require.modules = {}; -require.extensions = [".js",".coffee"]; - -require.resolve = (function () { - var core = { - 'assert': true, - 'events': true, - 'fs': true, - 'path': true, - 'vm': true - }; - - return function (x, cwd) { - if (!cwd) cwd = '/'; - - if (core[x]) return x; - var path = require.modules.path(); - var y = cwd || '.'; - - if (x.match(/^(?:\.\.?\/|\/)/)) { - var m = loadAsFileSync(path.resolve(y, x)) - || loadAsDirectorySync(path.resolve(y, x)); - if (m) return m; - } - - var n = loadNodeModulesSync(x, y); - if (n) return n; - - throw new Error("Cannot find module '" + x + "'"); - - function loadAsFileSync (x) { - if (require.modules[x]) { - return x; - } - - for (var i = 0; i < require.extensions.length; i++) { - var ext = require.extensions[i]; - if (require.modules[x + ext]) return x + ext; - } - } - - function loadAsDirectorySync (x) { - x = x.replace(/\/+$/, ''); - var pkgfile = x + '/package.json'; - if (require.modules[pkgfile]) { - var pkg = require.modules[pkgfile](); - var b = pkg.browserify; - if (typeof b === 'object' && b.main) { - var m = loadAsFileSync(path.resolve(x, b.main)); - if (m) return m; - } - else if (typeof b === 'string') { - var m = loadAsFileSync(path.resolve(x, b)); - if (m) return m; - } - else if (pkg.main) { - var m = loadAsFileSync(path.resolve(x, pkg.main)); - if (m) return m; - } - } - - return loadAsFileSync(x + '/index'); - } - - function loadNodeModulesSync (x, start) { - var dirs = nodeModulesPathsSync(start); - for (var i = 0; i < dirs.length; i++) { - var dir = dirs[i]; - var m = loadAsFileSync(dir + '/' + x); - if (m) return m; - var n = loadAsDirectorySync(dir + '/' + x); - if (n) return n; - } - - var m = loadAsFileSync(x); - if (m) return m; - } - - function nodeModulesPathsSync (start) { - var parts; - if (start === '/') parts = [ '' ]; - else parts = path.normalize(start).split('/'); - - var dirs = []; - for (var i = parts.length - 1; i >= 0; i--) { - if (parts[i] === 'node_modules') continue; - var dir = parts.slice(0, i + 1).join('/') + '/node_modules'; - dirs.push(dir); - } - - return dirs; - } - }; -})(); - -require.alias = function (from, to) { - var path = require.modules.path(); - var res = null; - try { - res = require.resolve(from + '/package.json', '/'); - } - catch (err) { - res = require.resolve(from, '/'); - } - var basedir = path.dirname(res); - - var keys = Object_keys(require.modules); - - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - if (key.slice(0, basedir.length + 1) === basedir + '/') { - var f = key.slice(basedir.length); - require.modules[to + f] = require.modules[basedir + f]; - } - else if (key === basedir) { - require.modules[to] = require.modules[basedir]; - } - } -}; - -var Object_keys = Object.keys || function (obj) { - var res = []; - for (var key in obj) res.push(key) - return res; -}; - -if (typeof process === 'undefined') process = {}; - -if (!process.nextTick) process.nextTick = function (fn) { - setTimeout(fn, 0); -}; - -if (!process.title) process.title = 'browser'; - -if (!process.binding) process.binding = function (name) { - if (name === 'evals') return require('vm') - else throw new Error('No such module') -}; - -if (!process.cwd) process.cwd = function () { return '.' }; - -require.modules["path"] = function () { - var module = { exports : {} }; - var exports = module.exports; - var __dirname = "."; - var __filename = "path"; - - var require = function (file) { - return __require(file, "."); - }; - - require.resolve = function (file) { - return __require.resolve(name, "."); - }; - - require.modules = __require.modules; - __require.modules["path"]._cached = module.exports; - - (function () { - function filter (xs, fn) { - var res = []; - for (var i = 0; i < xs.length; i++) { - if (fn(xs[i], i, xs)) res.push(xs[i]); - } - return res; -} - -// resolves . and .. elements in a path array with directory names there -// must be no slashes, empty elements, or device names (c:\) in the array -// (so also no leading and trailing slashes - it does not distinguish -// relative and absolute paths) -function normalizeArray(parts, allowAboveRoot) { - // if the path tries to go above the root, `up` ends up > 0 - var up = 0; - for (var i = parts.length; i >= 0; i--) { - var last = parts[i]; - if (last == '.') { - parts.splice(i, 1); - } else if (last === '..') { - parts.splice(i, 1); - up++; - } else if (up) { - parts.splice(i, 1); - up--; - } - } - - // if the path is allowed to go above the root, restore leading ..s - if (allowAboveRoot) { - for (; up--; up) { - parts.unshift('..'); - } - } - - return parts; -} - -// Regex to split a filename into [*, dir, basename, ext] -// posix version -var splitPathRe = /^(.+\/(?!$)|\/)?((?:.+?)?(\.[^.]*)?)$/; - -// path.resolve([from ...], to) -// posix version -exports.resolve = function() { -var resolvedPath = '', - resolvedAbsolute = false; - -for (var i = arguments.length; i >= -1 && !resolvedAbsolute; i--) { - var path = (i >= 0) - ? arguments[i] - : process.cwd(); - - // Skip empty and invalid entries - if (typeof path !== 'string' || !path) { - continue; - } - - resolvedPath = path + '/' + resolvedPath; - resolvedAbsolute = path.charAt(0) === '/'; -} - -// At this point the path should be resolved to a full absolute path, but -// handle relative paths to be safe (might happen when process.cwd() fails) - -// Normalize the path -resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) { - return !!p; - }), !resolvedAbsolute).join('/'); - - return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.'; -}; - -// path.normalize(path) -// posix version -exports.normalize = function(path) { -var isAbsolute = path.charAt(0) === '/', - trailingSlash = path.slice(-1) === '/'; - -// Normalize the path -path = normalizeArray(filter(path.split('/'), function(p) { - return !!p; - }), !isAbsolute).join('/'); - - if (!path && !isAbsolute) { - path = '.'; - } - if (path && trailingSlash) { - path += '/'; - } - - return (isAbsolute ? '/' : '') + path; -}; - - -// posix version -exports.join = function() { - var paths = Array.prototype.slice.call(arguments, 0); - return exports.normalize(filter(paths, function(p, index) { - return p && typeof p === 'string'; - }).join('/')); -}; - - -exports.dirname = function(path) { - var dir = splitPathRe.exec(path)[1] || ''; - var isWindows = false; - if (!dir) { - // No dirname - return '.'; - } else if (dir.length === 1 || - (isWindows && dir.length <= 3 && dir.charAt(1) === ':')) { - // It is just a slash or a drive letter with a slash - return dir; - } else { - // It is a full dirname, strip trailing slash - return dir.substring(0, dir.length - 1); - } -}; - - -exports.basename = function(path, ext) { - var f = splitPathRe.exec(path)[2] || ''; - // TODO: make this comparison case-insensitive on windows? - if (ext && f.substr(-1 * ext.length) === ext) { - f = f.substr(0, f.length - ext.length); - } - return f; -}; - - -exports.extname = function(path) { - return splitPathRe.exec(path)[3] || ''; -}; -; - }).call(module.exports); - - __require.modules["path"]._cached = module.exports; - return module.exports; -}; - -require.modules["/node_modules/burrito/package.json"] = function () { - var module = { exports : {} }; - var exports = module.exports; - var __dirname = "/node_modules/burrito"; - var __filename = "/node_modules/burrito/package.json"; - - var require = function (file) { - return __require(file, "/node_modules/burrito"); - }; - - require.resolve = function (file) { - return __require.resolve(name, "/node_modules/burrito"); - }; - - require.modules = __require.modules; - __require.modules["/node_modules/burrito/package.json"]._cached = module.exports; - - (function () { - module.exports = {"name":"burrito","description":"Wrap up expressions with a trace function while walking the AST with rice and beans on the side","version":"0.2.8","repository":{"type":"git","url":"git://github.com/substack/node-burrito.git"},"main":"./index.js","keywords":["trace","ast","walk","syntax","source","tree","uglify"],"directories":{"lib":".","example":"example","test":"test"},"scripts":{"test":"expresso"},"dependencies":{"traverse":">=0.5.1 <0.6","uglify-js":"1.0.4"},"devDependencies":{"expresso":"=0.7.x"},"engines":{"node":">=0.4.0"},"license":"BSD","author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"}}; - }).call(module.exports); - - __require.modules["/node_modules/burrito/package.json"]._cached = module.exports; - return module.exports; -}; - -require.modules["/node_modules/burrito/node_modules/uglify-js/package.json"] = function () { - var module = { exports : {} }; - var exports = module.exports; - var __dirname = "/node_modules/burrito/node_modules/uglify-js"; - var __filename = "/node_modules/burrito/node_modules/uglify-js/package.json"; - - var require = function (file) { - return __require(file, "/node_modules/burrito/node_modules/uglify-js"); - }; - - require.resolve = function (file) { - return __require.resolve(name, "/node_modules/burrito/node_modules/uglify-js"); - }; - - require.modules = __require.modules; - __require.modules["/node_modules/burrito/node_modules/uglify-js/package.json"]._cached = module.exports; - - (function () { - module.exports = {"name":"uglify-js","author":{"name":"Mihai Bazon","email":"mihai.bazon@gmail.com","url":"http://mihai.bazon.net/blog"},"version":"1.0.4","main":"./uglify-js.js","bin":{"uglifyjs":"./bin/uglifyjs"},"repository":{"type":"git","url":"git@github.com:mishoo/UglifyJS.git"}}; - }).call(module.exports); - - __require.modules["/node_modules/burrito/node_modules/uglify-js/package.json"]._cached = module.exports; - return module.exports; -}; - -require.modules["/node_modules/burrito/node_modules/uglify-js/uglify-js.js"] = function () { - var module = { exports : {} }; - var exports = module.exports; - var __dirname = "/node_modules/burrito/node_modules/uglify-js"; - var __filename = "/node_modules/burrito/node_modules/uglify-js/uglify-js.js"; - - var require = function (file) { - return __require(file, "/node_modules/burrito/node_modules/uglify-js"); - }; - - require.resolve = function (file) { - return __require.resolve(name, "/node_modules/burrito/node_modules/uglify-js"); - }; - - require.modules = __require.modules; - __require.modules["/node_modules/burrito/node_modules/uglify-js/uglify-js.js"]._cached = module.exports; - - (function () { - //convienence function(src, [options]); -function uglify(orig_code, options){ - options || (options = {}); - var jsp = uglify.parser; - var pro = uglify.uglify; - - var ast = jsp.parse(orig_code, options.strict_semicolons); // parse code and get the initial AST - ast = pro.ast_mangle(ast, options.mangle_options); // get a new AST with mangled names - ast = pro.ast_squeeze(ast, options.squeeze_options); // get an AST with compression optimizations - var final_code = pro.gen_code(ast, options.gen_options); // compressed code here - return final_code; -}; - -uglify.parser = require("./lib/parse-js"); -uglify.uglify = require("./lib/process"); - -module.exports = uglify; - }).call(module.exports); - - __require.modules["/node_modules/burrito/node_modules/uglify-js/uglify-js.js"]._cached = module.exports; - return module.exports; -}; - -require.modules["/node_modules/burrito/node_modules/uglify-js/lib/parse-js.js"] = function () { - var module = { exports : {} }; - var exports = module.exports; - var __dirname = "/node_modules/burrito/node_modules/uglify-js/lib"; - var __filename = "/node_modules/burrito/node_modules/uglify-js/lib/parse-js.js"; - - var require = function (file) { - return __require(file, "/node_modules/burrito/node_modules/uglify-js/lib"); - }; - - require.resolve = function (file) { - return __require.resolve(name, "/node_modules/burrito/node_modules/uglify-js/lib"); - }; - - require.modules = __require.modules; - __require.modules["/node_modules/burrito/node_modules/uglify-js/lib/parse-js.js"]._cached = module.exports; - - (function () { - /*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - - This version is suitable for Node.js. With minimal changes (the - exports stuff) it should work on any JS platform. - - This file contains the tokenizer/parser. It is a port to JavaScript - of parse-js [1], a JavaScript parser library written in Common Lisp - by Marijn Haverbeke. Thank you Marijn! - - [1] http://marijn.haverbeke.nl/parse-js/ - - Exported functions: - - - tokenizer(code) -- returns a function. Call the returned - function to fetch the next token. - - - parse(code) -- returns an AST of the given JavaScript code. - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2010 (c) Mihai Bazon - Based on parse-js (http://marijn.haverbeke.nl/parse-js/). - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -/* -----[ Tokenizer (constants) ]----- */ - -var KEYWORDS = array_to_hash([ - "break", - "case", - "catch", - "const", - "continue", - "default", - "delete", - "do", - "else", - "finally", - "for", - "function", - "if", - "in", - "instanceof", - "new", - "return", - "switch", - "throw", - "try", - "typeof", - "var", - "void", - "while", - "with" -]); - -var RESERVED_WORDS = array_to_hash([ - "abstract", - "boolean", - "byte", - "char", - "class", - "debugger", - "double", - "enum", - "export", - "extends", - "final", - "float", - "goto", - "implements", - "import", - "int", - "interface", - "long", - "native", - "package", - "private", - "protected", - "public", - "short", - "static", - "super", - "synchronized", - "throws", - "transient", - "volatile" -]); - -var KEYWORDS_BEFORE_EXPRESSION = array_to_hash([ - "return", - "new", - "delete", - "throw", - "else", - "case" -]); - -var KEYWORDS_ATOM = array_to_hash([ - "false", - "null", - "true", - "undefined" -]); - -var OPERATOR_CHARS = array_to_hash(characters("+-*&%=<>!?|~^")); - -var RE_HEX_NUMBER = /^0x[0-9a-f]+$/i; -var RE_OCT_NUMBER = /^0[0-7]+$/; -var RE_DEC_NUMBER = /^\d*\.?\d*(?:e[+-]?\d*(?:\d\.?|\.?\d)\d*)?$/i; - -var OPERATORS = array_to_hash([ - "in", - "instanceof", - "typeof", - "new", - "void", - "delete", - "++", - "--", - "+", - "-", - "!", - "~", - "&", - "|", - "^", - "*", - "/", - "%", - ">>", - "<<", - ">>>", - "<", - ">", - "<=", - ">=", - "==", - "===", - "!=", - "!==", - "?", - "=", - "+=", - "-=", - "/=", - "*=", - "%=", - ">>=", - "<<=", - ">>>=", - "|=", - "^=", - "&=", - "&&", - "||" -]); - -var WHITESPACE_CHARS = array_to_hash(characters(" \u00a0\n\r\t\f\v\u200b")); - -var PUNC_BEFORE_EXPRESSION = array_to_hash(characters("[{}(,.;:")); - -var PUNC_CHARS = array_to_hash(characters("[]{}(),;:")); - -var REGEXP_MODIFIERS = array_to_hash(characters("gmsiy")); - -/* -----[ Tokenizer ]----- */ - -// regexps adapted from http://xregexp.com/plugins/#unicode -var UNICODE = { - letter: new RegExp("[\\u0041-\\u005A\\u0061-\\u007A\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0523\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0621-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971\\u0972\\u097B-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D28\\u0D2A-\\u0D39\\u0D3D\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC\\u0EDD\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8B\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10D0-\\u10FA\\u10FC\\u1100-\\u1159\\u115F-\\u11A2\\u11A8-\\u11F9\\u1200-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u1676\\u1681-\\u169A\\u16A0-\\u16EA\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u1900-\\u191C\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19A9\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u2094\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2C6F\\u2C71-\\u2C7D\\u2C80-\\u2CE4\\u2D00-\\u2D25\\u2D30-\\u2D65\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31B7\\u31F0-\\u31FF\\u3400\\u4DB5\\u4E00\\u9FC3\\uA000-\\uA48C\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA65F\\uA662-\\uA66E\\uA67F-\\uA697\\uA717-\\uA71F\\uA722-\\uA788\\uA78B\\uA78C\\uA7FB-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA90A-\\uA925\\uA930-\\uA946\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAC00\\uD7A3\\uF900-\\uFA2D\\uFA30-\\uFA6A\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"), - non_spacing_mark: new RegExp("[\\u0300-\\u036F\\u0483-\\u0487\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065E\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0900-\\u0902\\u093C\\u0941-\\u0948\\u094D\\u0951-\\u0955\\u0962\\u0963\\u0981\\u09BC\\u09C1-\\u09C4\\u09CD\\u09E2\\u09E3\\u0A01\\u0A02\\u0A3C\\u0A41\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81\\u0A82\\u0ABC\\u0AC1-\\u0AC5\\u0AC7\\u0AC8\\u0ACD\\u0AE2\\u0AE3\\u0B01\\u0B3C\\u0B3F\\u0B41-\\u0B44\\u0B4D\\u0B56\\u0B62\\u0B63\\u0B82\\u0BC0\\u0BCD\\u0C3E-\\u0C40\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0CBC\\u0CBF\\u0CC6\\u0CCC\\u0CCD\\u0CE2\\u0CE3\\u0D41-\\u0D44\\u0D4D\\u0D62\\u0D63\\u0DCA\\u0DD2-\\u0DD4\\u0DD6\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F71-\\u0F7E\\u0F80-\\u0F84\\u0F86\\u0F87\\u0F90-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102D-\\u1030\\u1032-\\u1037\\u1039\\u103A\\u103D\\u103E\\u1058\\u1059\\u105E-\\u1060\\u1071-\\u1074\\u1082\\u1085\\u1086\\u108D\\u109D\\u135F\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B7-\\u17BD\\u17C6\\u17C9-\\u17D3\\u17DD\\u180B-\\u180D\\u18A9\\u1920-\\u1922\\u1927\\u1928\\u1932\\u1939-\\u193B\\u1A17\\u1A18\\u1A56\\u1A58-\\u1A5E\\u1A60\\u1A62\\u1A65-\\u1A6C\\u1A73-\\u1A7C\\u1A7F\\u1B00-\\u1B03\\u1B34\\u1B36-\\u1B3A\\u1B3C\\u1B42\\u1B6B-\\u1B73\\u1B80\\u1B81\\u1BA2-\\u1BA5\\u1BA8\\u1BA9\\u1C2C-\\u1C33\\u1C36\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE0\\u1CE2-\\u1CE8\\u1CED\\u1DC0-\\u1DE6\\u1DFD-\\u1DFF\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2CEF-\\u2CF1\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F\\uA67C\\uA67D\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA825\\uA826\\uA8C4\\uA8E0-\\uA8F1\\uA926-\\uA92D\\uA947-\\uA951\\uA980-\\uA982\\uA9B3\\uA9B6-\\uA9B9\\uA9BC\\uAA29-\\uAA2E\\uAA31\\uAA32\\uAA35\\uAA36\\uAA43\\uAA4C\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uABE5\\uABE8\\uABED\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE26]"), - space_combining_mark: new RegExp("[\\u0903\\u093E-\\u0940\\u0949-\\u094C\\u094E\\u0982\\u0983\\u09BE-\\u09C0\\u09C7\\u09C8\\u09CB\\u09CC\\u09D7\\u0A03\\u0A3E-\\u0A40\\u0A83\\u0ABE-\\u0AC0\\u0AC9\\u0ACB\\u0ACC\\u0B02\\u0B03\\u0B3E\\u0B40\\u0B47\\u0B48\\u0B4B\\u0B4C\\u0B57\\u0BBE\\u0BBF\\u0BC1\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCC\\u0BD7\\u0C01-\\u0C03\\u0C41-\\u0C44\\u0C82\\u0C83\\u0CBE\\u0CC0-\\u0CC4\\u0CC7\\u0CC8\\u0CCA\\u0CCB\\u0CD5\\u0CD6\\u0D02\\u0D03\\u0D3E-\\u0D40\\u0D46-\\u0D48\\u0D4A-\\u0D4C\\u0D57\\u0D82\\u0D83\\u0DCF-\\u0DD1\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0F3E\\u0F3F\\u0F7F\\u102B\\u102C\\u1031\\u1038\\u103B\\u103C\\u1056\\u1057\\u1062-\\u1064\\u1067-\\u106D\\u1083\\u1084\\u1087-\\u108C\\u108F\\u109A-\\u109C\\u17B6\\u17BE-\\u17C5\\u17C7\\u17C8\\u1923-\\u1926\\u1929-\\u192B\\u1930\\u1931\\u1933-\\u1938\\u19B0-\\u19C0\\u19C8\\u19C9\\u1A19-\\u1A1B\\u1A55\\u1A57\\u1A61\\u1A63\\u1A64\\u1A6D-\\u1A72\\u1B04\\u1B35\\u1B3B\\u1B3D-\\u1B41\\u1B43\\u1B44\\u1B82\\u1BA1\\u1BA6\\u1BA7\\u1BAA\\u1C24-\\u1C2B\\u1C34\\u1C35\\u1CE1\\u1CF2\\uA823\\uA824\\uA827\\uA880\\uA881\\uA8B4-\\uA8C3\\uA952\\uA953\\uA983\\uA9B4\\uA9B5\\uA9BA\\uA9BB\\uA9BD-\\uA9C0\\uAA2F\\uAA30\\uAA33\\uAA34\\uAA4D\\uAA7B\\uABE3\\uABE4\\uABE6\\uABE7\\uABE9\\uABEA\\uABEC]"), - connector_punctuation: new RegExp("[\\u005F\\u203F\\u2040\\u2054\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF3F]") -}; - -function is_letter(ch) { - return UNICODE.letter.test(ch); -}; - -function is_digit(ch) { - ch = ch.charCodeAt(0); - return ch >= 48 && ch <= 57; //XXX: find out if "UnicodeDigit" means something else than 0..9 -}; - -function is_alphanumeric_char(ch) { - return is_digit(ch) || is_letter(ch); -}; - -function is_unicode_combining_mark(ch) { - return UNICODE.non_spacing_mark.test(ch) || UNICODE.space_combining_mark.test(ch); -}; - -function is_unicode_connector_punctuation(ch) { - return UNICODE.connector_punctuation.test(ch); -}; - -function is_identifier_start(ch) { - return ch == "$" || ch == "_" || is_letter(ch); -}; - -function is_identifier_char(ch) { - return is_identifier_start(ch) - || is_unicode_combining_mark(ch) - || is_digit(ch) - || is_unicode_connector_punctuation(ch) - || ch == "\u200c" // zero-width non-joiner - || ch == "\u200d" // zero-width joiner (in my ECMA-262 PDF, this is also 200c) - ; -}; - -function parse_js_number(num) { - if (RE_HEX_NUMBER.test(num)) { - return parseInt(num.substr(2), 16); - } else if (RE_OCT_NUMBER.test(num)) { - return parseInt(num.substr(1), 8); - } else if (RE_DEC_NUMBER.test(num)) { - return parseFloat(num); - } -}; - -function JS_Parse_Error(message, line, col, pos) { - this.message = message; - this.line = line; - this.col = col; - this.pos = pos; - try { - ({})(); - } catch(ex) { - this.stack = ex.stack; - }; -}; - -JS_Parse_Error.prototype.toString = function() { - return this.message + " (line: " + this.line + ", col: " + this.col + ", pos: " + this.pos + ")" + "\n\n" + this.stack; -}; - -function js_error(message, line, col, pos) { - throw new JS_Parse_Error(message, line, col, pos); -}; - -function is_token(token, type, val) { - return token.type == type && (val == null || token.value == val); -}; - -var EX_EOF = {}; - -function tokenizer($TEXT) { - - var S = { - text : $TEXT.replace(/\r\n?|[\n\u2028\u2029]/g, "\n").replace(/^\uFEFF/, ''), - pos : 0, - tokpos : 0, - line : 0, - tokline : 0, - col : 0, - tokcol : 0, - newline_before : false, - regex_allowed : false, - comments_before : [] - }; - - function peek() { return S.text.charAt(S.pos); }; - - function next(signal_eof) { - var ch = S.text.charAt(S.pos++); - if (signal_eof && !ch) - throw EX_EOF; - if (ch == "\n") { - S.newline_before = true; - ++S.line; - S.col = 0; - } else { - ++S.col; - } - return ch; - }; - - function eof() { - return !S.peek(); - }; - - function find(what, signal_eof) { - var pos = S.text.indexOf(what, S.pos); - if (signal_eof && pos == -1) throw EX_EOF; - return pos; - }; - - function start_token() { - S.tokline = S.line; - S.tokcol = S.col; - S.tokpos = S.pos; - }; - - function token(type, value, is_comment) { - S.regex_allowed = ((type == "operator" && !HOP(UNARY_POSTFIX, value)) || - (type == "keyword" && HOP(KEYWORDS_BEFORE_EXPRESSION, value)) || - (type == "punc" && HOP(PUNC_BEFORE_EXPRESSION, value))); - var ret = { - type : type, - value : value, - line : S.tokline, - col : S.tokcol, - pos : S.tokpos, - nlb : S.newline_before - }; - if (!is_comment) { - ret.comments_before = S.comments_before; - S.comments_before = []; - } - S.newline_before = false; - return ret; - }; - - function skip_whitespace() { - while (HOP(WHITESPACE_CHARS, peek())) - next(); - }; - - function read_while(pred) { - var ret = "", ch = peek(), i = 0; - while (ch && pred(ch, i++)) { - ret += next(); - ch = peek(); - } - return ret; - }; - - function parse_error(err) { - js_error(err, S.tokline, S.tokcol, S.tokpos); - }; - - function read_num(prefix) { - var has_e = false, after_e = false, has_x = false, has_dot = prefix == "."; - var num = read_while(function(ch, i){ - if (ch == "x" || ch == "X") { - if (has_x) return false; - return has_x = true; - } - if (!has_x && (ch == "E" || ch == "e")) { - if (has_e) return false; - return has_e = after_e = true; - } - if (ch == "-") { - if (after_e || (i == 0 && !prefix)) return true; - return false; - } - if (ch == "+") return after_e; - after_e = false; - if (ch == ".") { - if (!has_dot && !has_x) - return has_dot = true; - return false; - } - return is_alphanumeric_char(ch); - }); - if (prefix) - num = prefix + num; - var valid = parse_js_number(num); - if (!isNaN(valid)) { - return token("num", valid); - } else { - parse_error("Invalid syntax: " + num); - } - }; - - function read_escaped_char() { - var ch = next(true); - switch (ch) { - case "n" : return "\n"; - case "r" : return "\r"; - case "t" : return "\t"; - case "b" : return "\b"; - case "v" : return "\v"; - case "f" : return "\f"; - case "0" : return "\0"; - case "x" : return String.fromCharCode(hex_bytes(2)); - case "u" : return String.fromCharCode(hex_bytes(4)); - default : return ch; - } - }; - - function hex_bytes(n) { - var num = 0; - for (; n > 0; --n) { - var digit = parseInt(next(true), 16); - if (isNaN(digit)) - parse_error("Invalid hex-character pattern in string"); - num = (num << 4) | digit; - } - return num; - }; - - function read_string() { - return with_eof_error("Unterminated string constant", function(){ - var quote = next(), ret = ""; - for (;;) { - var ch = next(true); - if (ch == "\\") ch = read_escaped_char(); - else if (ch == quote) break; - ret += ch; - } - return token("string", ret); - }); - }; - - function read_line_comment() { - next(); - var i = find("\n"), ret; - if (i == -1) { - ret = S.text.substr(S.pos); - S.pos = S.text.length; - } else { - ret = S.text.substring(S.pos, i); - S.pos = i; - } - return token("comment1", ret, true); - }; - - function read_multiline_comment() { - next(); - return with_eof_error("Unterminated multiline comment", function(){ - var i = find("*/", true), - text = S.text.substring(S.pos, i), - tok = token("comment2", text, true); - S.pos = i + 2; - S.line += text.split("\n").length - 1; - S.newline_before = text.indexOf("\n") >= 0; - - // https://github.com/mishoo/UglifyJS/issues/#issue/100 - if (/^@cc_on/i.test(text)) { - warn("WARNING: at line " + S.line); - warn("*** Found \"conditional comment\": " + text); - warn("*** UglifyJS DISCARDS ALL COMMENTS. This means your code might no longer work properly in Internet Explorer."); - } - - return tok; - }); - }; - - function read_name() { - var backslash = false, name = "", ch; - while ((ch = peek()) != null) { - if (!backslash) { - if (ch == "\\") backslash = true, next(); - else if (is_identifier_char(ch)) name += next(); - else break; - } - else { - if (ch != "u") parse_error("Expecting UnicodeEscapeSequence -- uXXXX"); - ch = read_escaped_char(); - if (!is_identifier_char(ch)) parse_error("Unicode char: " + ch.charCodeAt(0) + " is not valid in identifier"); - name += ch; - backslash = false; - } - } - return name; - }; - - function read_regexp() { - return with_eof_error("Unterminated regular expression", function(){ - var prev_backslash = false, regexp = "", ch, in_class = false; - while ((ch = next(true))) if (prev_backslash) { - regexp += "\\" + ch; - prev_backslash = false; - } else if (ch == "[") { - in_class = true; - regexp += ch; - } else if (ch == "]" && in_class) { - in_class = false; - regexp += ch; - } else if (ch == "/" && !in_class) { - break; - } else if (ch == "\\") { - prev_backslash = true; - } else { - regexp += ch; - } - var mods = read_name(); - return token("regexp", [ regexp, mods ]); - }); - }; - - function read_operator(prefix) { - function grow(op) { - if (!peek()) return op; - var bigger = op + peek(); - if (HOP(OPERATORS, bigger)) { - next(); - return grow(bigger); - } else { - return op; - } - }; - return token("operator", grow(prefix || next())); - }; - - function handle_slash() { - next(); - var regex_allowed = S.regex_allowed; - switch (peek()) { - case "/": - S.comments_before.push(read_line_comment()); - S.regex_allowed = regex_allowed; - return next_token(); - case "*": - S.comments_before.push(read_multiline_comment()); - S.regex_allowed = regex_allowed; - return next_token(); - } - return S.regex_allowed ? read_regexp() : read_operator("/"); - }; - - function handle_dot() { - next(); - return is_digit(peek()) - ? read_num(".") - : token("punc", "."); - }; - - function read_word() { - var word = read_name(); - return !HOP(KEYWORDS, word) - ? token("name", word) - : HOP(OPERATORS, word) - ? token("operator", word) - : HOP(KEYWORDS_ATOM, word) - ? token("atom", word) - : token("keyword", word); - }; - - function with_eof_error(eof_error, cont) { - try { - return cont(); - } catch(ex) { - if (ex === EX_EOF) parse_error(eof_error); - else throw ex; - } - }; - - function next_token(force_regexp) { - if (force_regexp) - return read_regexp(); - skip_whitespace(); - start_token(); - var ch = peek(); - if (!ch) return token("eof"); - if (is_digit(ch)) return read_num(); - if (ch == '"' || ch == "'") return read_string(); - if (HOP(PUNC_CHARS, ch)) return token("punc", next()); - if (ch == ".") return handle_dot(); - if (ch == "/") return handle_slash(); - if (HOP(OPERATOR_CHARS, ch)) return read_operator(); - if (ch == "\\" || is_identifier_start(ch)) return read_word(); - parse_error("Unexpected character '" + ch + "'"); - }; - - next_token.context = function(nc) { - if (nc) S = nc; - return S; - }; - - return next_token; - -}; - -/* -----[ Parser (constants) ]----- */ - -var UNARY_PREFIX = array_to_hash([ - "typeof", - "void", - "delete", - "--", - "++", - "!", - "~", - "-", - "+" -]); - -var UNARY_POSTFIX = array_to_hash([ "--", "++" ]); - -var ASSIGNMENT = (function(a, ret, i){ - while (i < a.length) { - ret[a[i]] = a[i].substr(0, a[i].length - 1); - i++; - } - return ret; -})( - ["+=", "-=", "/=", "*=", "%=", ">>=", "<<=", ">>>=", "|=", "^=", "&="], - { "=": true }, - 0 -); - -var PRECEDENCE = (function(a, ret){ - for (var i = 0, n = 1; i < a.length; ++i, ++n) { - var b = a[i]; - for (var j = 0; j < b.length; ++j) { - ret[b[j]] = n; - } - } - return ret; -})( - [ - ["||"], - ["&&"], - ["|"], - ["^"], - ["&"], - ["==", "===", "!=", "!=="], - ["<", ">", "<=", ">=", "in", "instanceof"], - [">>", "<<", ">>>"], - ["+", "-"], - ["*", "/", "%"] - ], - {} -); - -var STATEMENTS_WITH_LABELS = array_to_hash([ "for", "do", "while", "switch" ]); - -var ATOMIC_START_TOKEN = array_to_hash([ "atom", "num", "string", "regexp", "name" ]); - -/* -----[ Parser ]----- */ - -function NodeWithToken(str, start, end) { - this.name = str; - this.start = start; - this.end = end; -}; - -NodeWithToken.prototype.toString = function() { return this.name; }; - -function parse($TEXT, exigent_mode, embed_tokens) { - - var S = { - input : typeof $TEXT == "string" ? tokenizer($TEXT, true) : $TEXT, - token : null, - prev : null, - peeked : null, - in_function : 0, - in_loop : 0, - labels : [] - }; - - S.token = next(); - - function is(type, value) { - return is_token(S.token, type, value); - }; - - function peek() { return S.peeked || (S.peeked = S.input()); }; - - function next() { - S.prev = S.token; - if (S.peeked) { - S.token = S.peeked; - S.peeked = null; - } else { - S.token = S.input(); - } - return S.token; - }; - - function prev() { - return S.prev; - }; - - function croak(msg, line, col, pos) { - var ctx = S.input.context(); - js_error(msg, - line != null ? line : ctx.tokline, - col != null ? col : ctx.tokcol, - pos != null ? pos : ctx.tokpos); - }; - - function token_error(token, msg) { - croak(msg, token.line, token.col); - }; - - function unexpected(token) { - if (token == null) - token = S.token; - token_error(token, "Unexpected token: " + token.type + " (" + token.value + ")"); - }; - - function expect_token(type, val) { - if (is(type, val)) { - return next(); - } - token_error(S.token, "Unexpected token " + S.token.type + ", expected " + type); - }; - - function expect(punc) { return expect_token("punc", punc); }; - - function can_insert_semicolon() { - return !exigent_mode && ( - S.token.nlb || is("eof") || is("punc", "}") - ); - }; - - function semicolon() { - if (is("punc", ";")) next(); - else if (!can_insert_semicolon()) unexpected(); - }; - - function as() { - return slice(arguments); - }; - - function parenthesised() { - expect("("); - var ex = expression(); - expect(")"); - return ex; - }; - - function add_tokens(str, start, end) { - return str instanceof NodeWithToken ? str : new NodeWithToken(str, start, end); - }; - - function maybe_embed_tokens(parser) { - if (embed_tokens) return function() { - var start = S.token; - var ast = parser.apply(this, arguments); - ast[0] = add_tokens(ast[0], start, prev()); - return ast; - }; - else return parser; - }; - - var statement = maybe_embed_tokens(function() { - if (is("operator", "/")) { - S.peeked = null; - S.token = S.input(true); // force regexp - } - switch (S.token.type) { - case "num": - case "string": - case "regexp": - case "operator": - case "atom": - return simple_statement(); - - case "name": - return is_token(peek(), "punc", ":") - ? labeled_statement(prog1(S.token.value, next, next)) - : simple_statement(); - - case "punc": - switch (S.token.value) { - case "{": - return as("block", block_()); - case "[": - case "(": - return simple_statement(); - case ";": - next(); - return as("block"); - default: - unexpected(); - } - - case "keyword": - switch (prog1(S.token.value, next)) { - case "break": - return break_cont("break"); - - case "continue": - return break_cont("continue"); - - case "debugger": - semicolon(); - return as("debugger"); - - case "do": - return (function(body){ - expect_token("keyword", "while"); - return as("do", prog1(parenthesised, semicolon), body); - })(in_loop(statement)); - - case "for": - return for_(); - - case "function": - return function_(true); - - case "if": - return if_(); - - case "return": - if (S.in_function == 0) - croak("'return' outside of function"); - return as("return", - is("punc", ";") - ? (next(), null) - : can_insert_semicolon() - ? null - : prog1(expression, semicolon)); - - case "switch": - return as("switch", parenthesised(), switch_block_()); - - case "throw": - return as("throw", prog1(expression, semicolon)); - - case "try": - return try_(); - - case "var": - return prog1(var_, semicolon); - - case "const": - return prog1(const_, semicolon); - - case "while": - return as("while", parenthesised(), in_loop(statement)); - - case "with": - return as("with", parenthesised(), statement()); - - default: - unexpected(); - } - } - }); - - function labeled_statement(label) { - S.labels.push(label); - var start = S.token, stat = statement(); - if (exigent_mode && !HOP(STATEMENTS_WITH_LABELS, stat[0])) - unexpected(start); - S.labels.pop(); - return as("label", label, stat); - }; - - function simple_statement() { - return as("stat", prog1(expression, semicolon)); - }; - - function break_cont(type) { - var name; - if (!can_insert_semicolon()) { - name = is("name") ? S.token.value : null; - } - if (name != null) { - next(); - if (!member(name, S.labels)) - croak("Label " + name + " without matching loop or statement"); - } - else if (S.in_loop == 0) - croak(type + " not inside a loop or switch"); - semicolon(); - return as(type, name); - }; - - function for_() { - expect("("); - var init = null; - if (!is("punc", ";")) { - init = is("keyword", "var") - ? (next(), var_(true)) - : expression(true, true); - if (is("operator", "in")) - return for_in(init); - } - return regular_for(init); - }; - - function regular_for(init) { - expect(";"); - var test = is("punc", ";") ? null : expression(); - expect(";"); - var step = is("punc", ")") ? null : expression(); - expect(")"); - return as("for", init, test, step, in_loop(statement)); - }; - - function for_in(init) { - var lhs = init[0] == "var" ? as("name", init[1][0]) : init; - next(); - var obj = expression(); - expect(")"); - return as("for-in", init, lhs, obj, in_loop(statement)); - }; - - var function_ = maybe_embed_tokens(function(in_statement) { - var name = is("name") ? prog1(S.token.value, next) : null; - if (in_statement && !name) - unexpected(); - expect("("); - return as(in_statement ? "defun" : "function", - name, - // arguments - (function(first, a){ - while (!is("punc", ")")) { - if (first) first = false; else expect(","); - if (!is("name")) unexpected(); - a.push(S.token.value); - next(); - } - next(); - return a; - })(true, []), - // body - (function(){ - ++S.in_function; - var loop = S.in_loop; - S.in_loop = 0; - var a = block_(); - --S.in_function; - S.in_loop = loop; - return a; - })()); - }); - - function if_() { - var cond = parenthesised(), body = statement(), belse; - if (is("keyword", "else")) { - next(); - belse = statement(); - } - return as("if", cond, body, belse); - }; - - function block_() { - expect("{"); - var a = []; - while (!is("punc", "}")) { - if (is("eof")) unexpected(); - a.push(statement()); - } - next(); - return a; - }; - - var switch_block_ = curry(in_loop, function(){ - expect("{"); - var a = [], cur = null; - while (!is("punc", "}")) { - if (is("eof")) unexpected(); - if (is("keyword", "case")) { - next(); - cur = []; - a.push([ expression(), cur ]); - expect(":"); - } - else if (is("keyword", "default")) { - next(); - expect(":"); - cur = []; - a.push([ null, cur ]); - } - else { - if (!cur) unexpected(); - cur.push(statement()); - } - } - next(); - return a; - }); - - function try_() { - var body = block_(), bcatch, bfinally; - if (is("keyword", "catch")) { - next(); - expect("("); - if (!is("name")) - croak("Name expected"); - var name = S.token.value; - next(); - expect(")"); - bcatch = [ name, block_() ]; - } - if (is("keyword", "finally")) { - next(); - bfinally = block_(); - } - if (!bcatch && !bfinally) - croak("Missing catch/finally blocks"); - return as("try", body, bcatch, bfinally); - }; - - function vardefs(no_in) { - var a = []; - for (;;) { - if (!is("name")) - unexpected(); - var name = S.token.value; - next(); - if (is("operator", "=")) { - next(); - a.push([ name, expression(false, no_in) ]); - } else { - a.push([ name ]); - } - if (!is("punc", ",")) - break; - next(); - } - return a; - }; - - function var_(no_in) { - return as("var", vardefs(no_in)); - }; - - function const_() { - return as("const", vardefs()); - }; - - function new_() { - var newexp = expr_atom(false), args; - if (is("punc", "(")) { - next(); - args = expr_list(")"); - } else { - args = []; - } - return subscripts(as("new", newexp, args), true); - }; - - var expr_atom = maybe_embed_tokens(function(allow_calls) { - if (is("operator", "new")) { - next(); - return new_(); - } - if (is("operator") && HOP(UNARY_PREFIX, S.token.value)) { - return make_unary("unary-prefix", - prog1(S.token.value, next), - expr_atom(allow_calls)); - } - if (is("punc")) { - switch (S.token.value) { - case "(": - next(); - return subscripts(prog1(expression, curry(expect, ")")), allow_calls); - case "[": - next(); - return subscripts(array_(), allow_calls); - case "{": - next(); - return subscripts(object_(), allow_calls); - } - unexpected(); - } - if (is("keyword", "function")) { - next(); - return subscripts(function_(false), allow_calls); - } - if (HOP(ATOMIC_START_TOKEN, S.token.type)) { - var atom = S.token.type == "regexp" - ? as("regexp", S.token.value[0], S.token.value[1]) - : as(S.token.type, S.token.value); - return subscripts(prog1(atom, next), allow_calls); - } - unexpected(); - }); - - function expr_list(closing, allow_trailing_comma, allow_empty) { - var first = true, a = []; - while (!is("punc", closing)) { - if (first) first = false; else expect(","); - if (allow_trailing_comma && is("punc", closing)) break; - if (is("punc", ",") && allow_empty) { - a.push([ "atom", "undefined" ]); - } else { - a.push(expression(false)); - } - } - next(); - return a; - }; - - function array_() { - return as("array", expr_list("]", !exigent_mode, true)); - }; - - function object_() { - var first = true, a = []; - while (!is("punc", "}")) { - if (first) first = false; else expect(","); - if (!exigent_mode && is("punc", "}")) - // allow trailing comma - break; - var type = S.token.type; - var name = as_property_name(); - if (type == "name" && (name == "get" || name == "set") && !is("punc", ":")) { - a.push([ as_name(), function_(false), name ]); - } else { - expect(":"); - a.push([ name, expression(false) ]); - } - } - next(); - return as("object", a); - }; - - function as_property_name() { - switch (S.token.type) { - case "num": - case "string": - return prog1(S.token.value, next); - } - return as_name(); - }; - - function as_name() { - switch (S.token.type) { - case "name": - case "operator": - case "keyword": - case "atom": - return prog1(S.token.value, next); - default: - unexpected(); - } - }; - - function subscripts(expr, allow_calls) { - if (is("punc", ".")) { - next(); - return subscripts(as("dot", expr, as_name()), allow_calls); - } - if (is("punc", "[")) { - next(); - return subscripts(as("sub", expr, prog1(expression, curry(expect, "]"))), allow_calls); - } - if (allow_calls && is("punc", "(")) { - next(); - return subscripts(as("call", expr, expr_list(")")), true); - } - if (allow_calls && is("operator") && HOP(UNARY_POSTFIX, S.token.value)) { - return prog1(curry(make_unary, "unary-postfix", S.token.value, expr), - next); - } - return expr; - }; - - function make_unary(tag, op, expr) { - if ((op == "++" || op == "--") && !is_assignable(expr)) - croak("Invalid use of " + op + " operator"); - return as(tag, op, expr); - }; - - function expr_op(left, min_prec, no_in) { - var op = is("operator") ? S.token.value : null; - if (op && op == "in" && no_in) op = null; - var prec = op != null ? PRECEDENCE[op] : null; - if (prec != null && prec > min_prec) { - next(); - var right = expr_op(expr_atom(true), prec, no_in); - return expr_op(as("binary", op, left, right), min_prec, no_in); - } - return left; - }; - - function expr_ops(no_in) { - return expr_op(expr_atom(true), 0, no_in); - }; - - function maybe_conditional(no_in) { - var expr = expr_ops(no_in); - if (is("operator", "?")) { - next(); - var yes = expression(false); - expect(":"); - return as("conditional", expr, yes, expression(false, no_in)); - } - return expr; - }; - - function is_assignable(expr) { - if (!exigent_mode) return true; - switch (expr[0]) { - case "dot": - case "sub": - case "new": - case "call": - return true; - case "name": - return expr[1] != "this"; - } - }; - - function maybe_assign(no_in) { - var left = maybe_conditional(no_in), val = S.token.value; - if (is("operator") && HOP(ASSIGNMENT, val)) { - if (is_assignable(left)) { - next(); - return as("assign", ASSIGNMENT[val], left, maybe_assign(no_in)); - } - croak("Invalid assignment"); - } - return left; - }; - - var expression = maybe_embed_tokens(function(commas, no_in) { - if (arguments.length == 0) - commas = true; - var expr = maybe_assign(no_in); - if (commas && is("punc", ",")) { - next(); - return as("seq", expr, expression(true, no_in)); - } - return expr; - }); - - function in_loop(cont) { - try { - ++S.in_loop; - return cont(); - } finally { - --S.in_loop; - } - }; - - return as("toplevel", (function(a){ - while (!is("eof")) - a.push(statement()); - return a; - })([])); - -}; - -/* -----[ Utilities ]----- */ - -function curry(f) { - var args = slice(arguments, 1); - return function() { return f.apply(this, args.concat(slice(arguments))); }; -}; - -function prog1(ret) { - if (ret instanceof Function) - ret = ret(); - for (var i = 1, n = arguments.length; --n > 0; ++i) - arguments[i](); - return ret; -}; - -function array_to_hash(a) { - var ret = {}; - for (var i = 0; i < a.length; ++i) - ret[a[i]] = true; - return ret; -}; - -function slice(a, start) { - return Array.prototype.slice.call(a, start == null ? 0 : start); -}; - -function characters(str) { - return str.split(""); -}; - -function member(name, array) { - for (var i = array.length; --i >= 0;) - if (array[i] === name) - return true; - return false; -}; - -function HOP(obj, prop) { - return Object.prototype.hasOwnProperty.call(obj, prop); -}; - -var warn = function() {}; - -/* -----[ Exports ]----- */ - -exports.tokenizer = tokenizer; -exports.parse = parse; -exports.slice = slice; -exports.curry = curry; -exports.member = member; -exports.array_to_hash = array_to_hash; -exports.PRECEDENCE = PRECEDENCE; -exports.KEYWORDS_ATOM = KEYWORDS_ATOM; -exports.RESERVED_WORDS = RESERVED_WORDS; -exports.KEYWORDS = KEYWORDS; -exports.ATOMIC_START_TOKEN = ATOMIC_START_TOKEN; -exports.OPERATORS = OPERATORS; -exports.is_alphanumeric_char = is_alphanumeric_char; -exports.set_logger = function(logger) { - warn = logger; -}; -; - }).call(module.exports); - - __require.modules["/node_modules/burrito/node_modules/uglify-js/lib/parse-js.js"]._cached = module.exports; - return module.exports; -}; - -require.modules["/node_modules/burrito/node_modules/uglify-js/lib/process.js"] = function () { - var module = { exports : {} }; - var exports = module.exports; - var __dirname = "/node_modules/burrito/node_modules/uglify-js/lib"; - var __filename = "/node_modules/burrito/node_modules/uglify-js/lib/process.js"; - - var require = function (file) { - return __require(file, "/node_modules/burrito/node_modules/uglify-js/lib"); - }; - - require.resolve = function (file) { - return __require.resolve(name, "/node_modules/burrito/node_modules/uglify-js/lib"); - }; - - require.modules = __require.modules; - __require.modules["/node_modules/burrito/node_modules/uglify-js/lib/process.js"]._cached = module.exports; - - (function () { - /*********************************************************************** - - A JavaScript tokenizer / parser / beautifier / compressor. - - This version is suitable for Node.js. With minimal changes (the - exports stuff) it should work on any JS platform. - - This file implements some AST processors. They work on data built - by parse-js. - - Exported functions: - - - ast_mangle(ast, options) -- mangles the variable/function names - in the AST. Returns an AST. - - - ast_squeeze(ast) -- employs various optimizations to make the - final generated code even smaller. Returns an AST. - - - gen_code(ast, options) -- generates JS code from the AST. Pass - true (or an object, see the code for some options) as second - argument to get "pretty" (indented) code. - - -------------------------------- (C) --------------------------------- - - Author: Mihai Bazon - - http://mihai.bazon.net/blog - - Distributed under the BSD license: - - Copyright 2010 (c) Mihai Bazon - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - * Redistributions of source code must retain the above - copyright notice, this list of conditions and the following - disclaimer. - - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials - provided with the distribution. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE - LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF - THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - - ***********************************************************************/ - -var jsp = require("./parse-js"), - slice = jsp.slice, - member = jsp.member, - PRECEDENCE = jsp.PRECEDENCE, - OPERATORS = jsp.OPERATORS; - -/* -----[ helper for AST traversal ]----- */ - -function ast_walker(ast) { - function _vardefs(defs) { - return [ this[0], MAP(defs, function(def){ - var a = [ def[0] ]; - if (def.length > 1) - a[1] = walk(def[1]); - return a; - }) ]; - }; - function _block(statements) { - var out = [ this[0] ]; - if (statements != null) - out.push(MAP(statements, walk)); - return out; - }; - var walkers = { - "string": function(str) { - return [ this[0], str ]; - }, - "num": function(num) { - return [ this[0], num ]; - }, - "name": function(name) { - return [ this[0], name ]; - }, - "toplevel": function(statements) { - return [ this[0], MAP(statements, walk) ]; - }, - "block": _block, - "splice": _block, - "var": _vardefs, - "const": _vardefs, - "try": function(t, c, f) { - return [ - this[0], - MAP(t, walk), - c != null ? [ c[0], MAP(c[1], walk) ] : null, - f != null ? MAP(f, walk) : null - ]; - }, - "throw": function(expr) { - return [ this[0], walk(expr) ]; - }, - "new": function(ctor, args) { - return [ this[0], walk(ctor), MAP(args, walk) ]; - }, - "switch": function(expr, body) { - return [ this[0], walk(expr), MAP(body, function(branch){ - return [ branch[0] ? walk(branch[0]) : null, - MAP(branch[1], walk) ]; - }) ]; - }, - "break": function(label) { - return [ this[0], label ]; - }, - "continue": function(label) { - return [ this[0], label ]; - }, - "conditional": function(cond, t, e) { - return [ this[0], walk(cond), walk(t), walk(e) ]; - }, - "assign": function(op, lvalue, rvalue) { - return [ this[0], op, walk(lvalue), walk(rvalue) ]; - }, - "dot": function(expr) { - return [ this[0], walk(expr) ].concat(slice(arguments, 1)); - }, - "call": function(expr, args) { - return [ this[0], walk(expr), MAP(args, walk) ]; - }, - "function": function(name, args, body) { - return [ this[0], name, args.slice(), MAP(body, walk) ]; - }, - "defun": function(name, args, body) { - return [ this[0], name, args.slice(), MAP(body, walk) ]; - }, - "if": function(conditional, t, e) { - return [ this[0], walk(conditional), walk(t), walk(e) ]; - }, - "for": function(init, cond, step, block) { - return [ this[0], walk(init), walk(cond), walk(step), walk(block) ]; - }, - "for-in": function(vvar, key, hash, block) { - return [ this[0], walk(vvar), walk(key), walk(hash), walk(block) ]; - }, - "while": function(cond, block) { - return [ this[0], walk(cond), walk(block) ]; - }, - "do": function(cond, block) { - return [ this[0], walk(cond), walk(block) ]; - }, - "return": function(expr) { - return [ this[0], walk(expr) ]; - }, - "binary": function(op, left, right) { - return [ this[0], op, walk(left), walk(right) ]; - }, - "unary-prefix": function(op, expr) { - return [ this[0], op, walk(expr) ]; - }, - "unary-postfix": function(op, expr) { - return [ this[0], op, walk(expr) ]; - }, - "sub": function(expr, subscript) { - return [ this[0], walk(expr), walk(subscript) ]; - }, - "object": function(props) { - return [ this[0], MAP(props, function(p){ - return p.length == 2 - ? [ p[0], walk(p[1]) ] - : [ p[0], walk(p[1]), p[2] ]; // get/set-ter - }) ]; - }, - "regexp": function(rx, mods) { - return [ this[0], rx, mods ]; - }, - "array": function(elements) { - return [ this[0], MAP(elements, walk) ]; - }, - "stat": function(stat) { - return [ this[0], walk(stat) ]; - }, - "seq": function() { - return [ this[0] ].concat(MAP(slice(arguments), walk)); - }, - "label": function(name, block) { - return [ this[0], name, walk(block) ]; - }, - "with": function(expr, block) { - return [ this[0], walk(expr), walk(block) ]; - }, - "atom": function(name) { - return [ this[0], name ]; - } - }; - - var user = {}; - var stack = []; - function walk(ast) { - if (ast == null) - return null; - try { - stack.push(ast); - var type = ast[0]; - var gen = user[type]; - if (gen) { - var ret = gen.apply(ast, ast.slice(1)); - if (ret != null) - return ret; - } - gen = walkers[type]; - return gen.apply(ast, ast.slice(1)); - } finally { - stack.pop(); - } - }; - - function with_walkers(walkers, cont){ - var save = {}, i; - for (i in walkers) if (HOP(walkers, i)) { - save[i] = user[i]; - user[i] = walkers[i]; - } - var ret = cont(); - for (i in save) if (HOP(save, i)) { - if (!save[i]) delete user[i]; - else user[i] = save[i]; - } - return ret; - }; - - return { - walk: walk, - with_walkers: with_walkers, - parent: function() { - return stack[stack.length - 2]; // last one is current node - }, - stack: function() { - return stack; - } - }; -}; - -/* -----[ Scope and mangling ]----- */ - -function Scope(parent) { - this.names = {}; // names defined in this scope - this.mangled = {}; // mangled names (orig.name => mangled) - this.rev_mangled = {}; // reverse lookup (mangled => orig.name) - this.cname = -1; // current mangled name - this.refs = {}; // names referenced from this scope - this.uses_with = false; // will become TRUE if with() is detected in this or any subscopes - this.uses_eval = false; // will become TRUE if eval() is detected in this or any subscopes - this.parent = parent; // parent scope - this.children = []; // sub-scopes - if (parent) { - this.level = parent.level + 1; - parent.children.push(this); - } else { - this.level = 0; - } -}; - -var base54 = (function(){ - var DIGITS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_"; - return function(num) { - var ret = ""; - do { - ret = DIGITS.charAt(num % 54) + ret; - num = Math.floor(num / 54); - } while (num > 0); - return ret; - }; -})(); - -Scope.prototype = { - has: function(name) { - for (var s = this; s; s = s.parent) - if (HOP(s.names, name)) - return s; - }, - has_mangled: function(mname) { - for (var s = this; s; s = s.parent) - if (HOP(s.rev_mangled, mname)) - return s; - }, - toJSON: function() { - return { - names: this.names, - uses_eval: this.uses_eval, - uses_with: this.uses_with - }; - }, - - next_mangled: function() { - // we must be careful that the new mangled name: - // - // 1. doesn't shadow a mangled name from a parent - // scope, unless we don't reference the original - // name from this scope OR from any sub-scopes! - // This will get slow. - // - // 2. doesn't shadow an original name from a parent - // scope, in the event that the name is not mangled - // in the parent scope and we reference that name - // here OR IN ANY SUBSCOPES! - // - // 3. doesn't shadow a name that is referenced but not - // defined (possibly global defined elsewhere). - for (;;) { - var m = base54(++this.cname), prior; - - // case 1. - prior = this.has_mangled(m); - if (prior && this.refs[prior.rev_mangled[m]] === prior) - continue; - - // case 2. - prior = this.has(m); - if (prior && prior !== this && this.refs[m] === prior && !prior.has_mangled(m)) - continue; - - // case 3. - if (HOP(this.refs, m) && this.refs[m] == null) - continue; - - // I got "do" once. :-/ - if (!is_identifier(m)) - continue; - - return m; - } - }, - set_mangle: function(name, m) { - this.rev_mangled[m] = name; - return this.mangled[name] = m; - }, - get_mangled: function(name, newMangle) { - if (this.uses_eval || this.uses_with) return name; // no mangle if eval or with is in use - var s = this.has(name); - if (!s) return name; // not in visible scope, no mangle - if (HOP(s.mangled, name)) return s.mangled[name]; // already mangled in this scope - if (!newMangle) return name; // not found and no mangling requested - return s.set_mangle(name, s.next_mangled()); - }, - define: function(name) { - if (name != null) - return this.names[name] = name; - } -}; - -function ast_add_scope(ast) { - - var current_scope = null; - var w = ast_walker(), walk = w.walk; - var having_eval = []; - - function with_new_scope(cont) { - current_scope = new Scope(current_scope); - var ret = current_scope.body = cont(); - ret.scope = current_scope; - current_scope = current_scope.parent; - return ret; - }; - - function define(name) { - return current_scope.define(name); - }; - - function reference(name) { - current_scope.refs[name] = true; - }; - - function _lambda(name, args, body) { - var is_defun = this[0] == "defun"; - return [ this[0], is_defun ? define(name) : name, args, with_new_scope(function(){ - if (!is_defun) define(name); - MAP(args, define); - return MAP(body, walk); - })]; - }; - - return with_new_scope(function(){ - // process AST - var ret = w.with_walkers({ - "function": _lambda, - "defun": _lambda, - "with": function(expr, block) { - for (var s = current_scope; s; s = s.parent) - s.uses_with = true; - }, - "var": function(defs) { - MAP(defs, function(d){ define(d[0]) }); - }, - "const": function(defs) { - MAP(defs, function(d){ define(d[0]) }); - }, - "try": function(t, c, f) { - if (c != null) return [ - this[0], - MAP(t, walk), - [ define(c[0]), MAP(c[1], walk) ], - f != null ? MAP(f, walk) : null - ]; - }, - "name": function(name) { - if (name == "eval") - having_eval.push(current_scope); - reference(name); - } - }, function(){ - return walk(ast); - }); - - // the reason why we need an additional pass here is - // that names can be used prior to their definition. - - // scopes where eval was detected and their parents - // are marked with uses_eval, unless they define the - // "eval" name. - MAP(having_eval, function(scope){ - if (!scope.has("eval")) while (scope) { - scope.uses_eval = true; - scope = scope.parent; - } - }); - - // for referenced names it might be useful to know - // their origin scope. current_scope here is the - // toplevel one. - function fixrefs(scope, i) { - // do children first; order shouldn't matter - for (i = scope.children.length; --i >= 0;) - fixrefs(scope.children[i]); - for (i in scope.refs) if (HOP(scope.refs, i)) { - // find origin scope and propagate the reference to origin - for (var origin = scope.has(i), s = scope; s; s = s.parent) { - s.refs[i] = origin; - if (s === origin) break; - } - } - }; - fixrefs(current_scope); - - return ret; - }); - -}; - -/* -----[ mangle names ]----- */ - -function ast_mangle(ast, options) { - var w = ast_walker(), walk = w.walk, scope; - options = options || {}; - - function get_mangled(name, newMangle) { - if (!options.toplevel && !scope.parent) return name; // don't mangle toplevel - if (options.except && member(name, options.except)) - return name; - return scope.get_mangled(name, newMangle); - }; - - function get_define(name) { - if (options.defines) { - // we always lookup a defined symbol for the current scope FIRST, so declared - // vars trump a DEFINE symbol, but if no such var is found, then match a DEFINE value - if (!scope.has(name)) { - if (HOP(options.defines, name)) { - return options.defines[name]; - } - } - return null; - } - }; - - function _lambda(name, args, body) { - var is_defun = this[0] == "defun", extra; - if (name) { - if (is_defun) name = get_mangled(name); - else { - extra = {}; - name = extra[name] = scope.next_mangled(); - } - } - body = with_scope(body.scope, function(){ - args = MAP(args, function(name){ return get_mangled(name) }); - return MAP(body, walk); - }, extra); - return [ this[0], name, args, body ]; - }; - - function with_scope(s, cont, extra) { - var _scope = scope; - scope = s; - if (extra) for (var i in extra) if (HOP(extra, i)) { - s.set_mangle(i, extra[i]); - } - for (var i in s.names) if (HOP(s.names, i)) { - get_mangled(i, true); - } - var ret = cont(); - ret.scope = s; - scope = _scope; - return ret; - }; - - function _vardefs(defs) { - return [ this[0], MAP(defs, function(d){ - return [ get_mangled(d[0]), walk(d[1]) ]; - }) ]; - }; - - return w.with_walkers({ - "function": _lambda, - "defun": function() { - // move function declarations to the top when - // they are not in some block. - var ast = _lambda.apply(this, arguments); - switch (w.parent()[0]) { - case "toplevel": - case "function": - case "defun": - return MAP.at_top(ast); - } - return ast; - }, - "var": _vardefs, - "const": _vardefs, - "name": function(name) { - return get_define(name) || [ this[0], get_mangled(name) ]; - }, - "try": function(t, c, f) { - return [ this[0], - MAP(t, walk), - c != null ? [ get_mangled(c[0]), MAP(c[1], walk) ] : null, - f != null ? MAP(f, walk) : null ]; - }, - "toplevel": function(body) { - var self = this; - return with_scope(self.scope, function(){ - return [ self[0], MAP(body, walk) ]; - }); - } - }, function() { - return walk(ast_add_scope(ast)); - }); -}; - -/* -----[ - - compress foo["bar"] into foo.bar, - - remove block brackets {} where possible - - join consecutive var declarations - - various optimizations for IFs: - - if (cond) foo(); else bar(); ==> cond?foo():bar(); - - if (cond) foo(); ==> cond&&foo(); - - if (foo) return bar(); else return baz(); ==> return foo?bar():baz(); // also for throw - - if (foo) return bar(); else something(); ==> {if(foo)return bar();something()} - ]----- */ - -var warn = function(){}; - -function best_of(ast1, ast2) { - return gen_code(ast1).length > gen_code(ast2[0] == "stat" ? ast2[1] : ast2).length ? ast2 : ast1; -}; - -function last_stat(b) { - if (b[0] == "block" && b[1] && b[1].length > 0) - return b[1][b[1].length - 1]; - return b; -} - -function aborts(t) { - if (t) { - t = last_stat(t); - if (t[0] == "return" || t[0] == "break" || t[0] == "continue" || t[0] == "throw") - return true; - } -}; - -function boolean_expr(expr) { - return ( (expr[0] == "unary-prefix" - && member(expr[1], [ "!", "delete" ])) || - - (expr[0] == "binary" - && member(expr[1], [ "in", "instanceof", "==", "!=", "===", "!==", "<", "<=", ">=", ">" ])) || - - (expr[0] == "binary" - && member(expr[1], [ "&&", "||" ]) - && boolean_expr(expr[2]) - && boolean_expr(expr[3])) || - - (expr[0] == "conditional" - && boolean_expr(expr[2]) - && boolean_expr(expr[3])) || - - (expr[0] == "assign" - && expr[1] === true - && boolean_expr(expr[3])) || - - (expr[0] == "seq" - && boolean_expr(expr[expr.length - 1])) - ); -}; - -function make_conditional(c, t, e) { - var make_real_conditional = function() { - if (c[0] == "unary-prefix" && c[1] == "!") { - return e ? [ "conditional", c[2], e, t ] : [ "binary", "||", c[2], t ]; - } else { - return e ? [ "conditional", c, t, e ] : [ "binary", "&&", c, t ]; - } - }; - // shortcut the conditional if the expression has a constant value - return when_constant(c, function(ast, val){ - warn_unreachable(val ? e : t); - return (val ? t : e); - }, make_real_conditional); -}; - -function empty(b) { - return !b || (b[0] == "block" && (!b[1] || b[1].length == 0)); -}; - -function is_string(node) { - return (node[0] == "string" || - node[0] == "unary-prefix" && node[1] == "typeof" || - node[0] == "binary" && node[1] == "+" && - (is_string(node[2]) || is_string(node[3]))); -}; - -var when_constant = (function(){ - - var $NOT_CONSTANT = {}; - - // this can only evaluate constant expressions. If it finds anything - // not constant, it throws $NOT_CONSTANT. - function evaluate(expr) { - switch (expr[0]) { - case "string": - case "num": - return expr[1]; - case "name": - case "atom": - switch (expr[1]) { - case "true": return true; - case "false": return false; - } - break; - case "unary-prefix": - switch (expr[1]) { - case "!": return !evaluate(expr[2]); - case "typeof": return typeof evaluate(expr[2]); - case "~": return ~evaluate(expr[2]); - case "-": return -evaluate(expr[2]); - case "+": return +evaluate(expr[2]); - } - break; - case "binary": - var left = expr[2], right = expr[3]; - switch (expr[1]) { - case "&&" : return evaluate(left) && evaluate(right); - case "||" : return evaluate(left) || evaluate(right); - case "|" : return evaluate(left) | evaluate(right); - case "&" : return evaluate(left) & evaluate(right); - case "^" : return evaluate(left) ^ evaluate(right); - case "+" : return evaluate(left) + evaluate(right); - case "*" : return evaluate(left) * evaluate(right); - case "/" : return evaluate(left) / evaluate(right); - case "-" : return evaluate(left) - evaluate(right); - case "<<" : return evaluate(left) << evaluate(right); - case ">>" : return evaluate(left) >> evaluate(right); - case ">>>" : return evaluate(left) >>> evaluate(right); - case "==" : return evaluate(left) == evaluate(right); - case "===" : return evaluate(left) === evaluate(right); - case "!=" : return evaluate(left) != evaluate(right); - case "!==" : return evaluate(left) !== evaluate(right); - case "<" : return evaluate(left) < evaluate(right); - case "<=" : return evaluate(left) <= evaluate(right); - case ">" : return evaluate(left) > evaluate(right); - case ">=" : return evaluate(left) >= evaluate(right); - case "in" : return evaluate(left) in evaluate(right); - case "instanceof" : return evaluate(left) instanceof evaluate(right); - } - } - throw $NOT_CONSTANT; - }; - - return function(expr, yes, no) { - try { - var val = evaluate(expr), ast; - switch (typeof val) { - case "string": ast = [ "string", val ]; break; - case "number": ast = [ "num", val ]; break; - case "boolean": ast = [ "name", String(val) ]; break; - default: throw new Error("Can't handle constant of type: " + (typeof val)); - } - return yes.call(expr, ast, val); - } catch(ex) { - if (ex === $NOT_CONSTANT) { - if (expr[0] == "binary" - && (expr[1] == "===" || expr[1] == "!==") - && ((is_string(expr[2]) && is_string(expr[3])) - || (boolean_expr(expr[2]) && boolean_expr(expr[3])))) { - expr[1] = expr[1].substr(0, 2); - } - else if (no && expr[0] == "binary" - && (expr[1] == "||" || expr[1] == "&&")) { - // the whole expression is not constant but the lval may be... - try { - var lval = evaluate(expr[2]); - expr = ((expr[1] == "&&" && (lval ? expr[3] : lval)) || - (expr[1] == "||" && (lval ? lval : expr[3])) || - expr); - } catch(ex2) { - // IGNORE... lval is not constant - } - } - return no ? no.call(expr, expr) : null; - } - else throw ex; - } - }; - -})(); - -function warn_unreachable(ast) { - if (!empty(ast)) - warn("Dropping unreachable code: " + gen_code(ast, true)); -}; - -function prepare_ifs(ast) { - var w = ast_walker(), walk = w.walk; - // In this first pass, we rewrite ifs which abort with no else with an - // if-else. For example: - // - // if (x) { - // blah(); - // return y; - // } - // foobar(); - // - // is rewritten into: - // - // if (x) { - // blah(); - // return y; - // } else { - // foobar(); - // } - function redo_if(statements) { - statements = MAP(statements, walk); - - for (var i = 0; i < statements.length; ++i) { - var fi = statements[i]; - if (fi[0] != "if") continue; - - if (fi[3] && walk(fi[3])) continue; - - var t = walk(fi[2]); - if (!aborts(t)) continue; - - var conditional = walk(fi[1]); - - var e_body = statements.slice(i + 1); - var e; - if (e_body.length == 1) e = e_body[0]; - else e = [ "block", e_body ]; - - var ret = statements.slice(0, i).concat([ [ - fi[0], // "if" - conditional, // conditional - t, // then - e // else - ] ]); - - return redo_if(ret); - } - - return statements; - }; - - function redo_if_lambda(name, args, body) { - body = redo_if(body); - return [ this[0], name, args.slice(), body ]; - }; - - function redo_if_block(statements) { - var out = [ this[0] ]; - if (statements != null) - out.push(redo_if(statements)); - return out; - }; - - return w.with_walkers({ - "defun": redo_if_lambda, - "function": redo_if_lambda, - "block": redo_if_block, - "splice": redo_if_block, - "toplevel": function(statements) { - return [ this[0], redo_if(statements) ]; - }, - "try": function(t, c, f) { - return [ - this[0], - redo_if(t), - c != null ? [ c[0], redo_if(c[1]) ] : null, - f != null ? redo_if(f) : null - ]; - }, - "with": function(expr, block) { - return [ this[0], walk(expr), redo_if(block) ]; - } - }, function() { - return walk(ast); - }); -}; - -function ast_squeeze(ast, options) { - options = defaults(options, { - make_seqs : true, - dead_code : true, - keep_comps : true, - no_warnings : false - }); - - var w = ast_walker(), walk = w.walk, scope; - - function negate(c) { - var not_c = [ "unary-prefix", "!", c ]; - switch (c[0]) { - case "unary-prefix": - return c[1] == "!" && boolean_expr(c[2]) ? c[2] : not_c; - case "seq": - c = slice(c); - c[c.length - 1] = negate(c[c.length - 1]); - return c; - case "conditional": - return best_of(not_c, [ "conditional", c[1], negate(c[2]), negate(c[3]) ]); - case "binary": - var op = c[1], left = c[2], right = c[3]; - if (!options.keep_comps) switch (op) { - case "<=" : return [ "binary", ">", left, right ]; - case "<" : return [ "binary", ">=", left, right ]; - case ">=" : return [ "binary", "<", left, right ]; - case ">" : return [ "binary", "<=", left, right ]; - } - switch (op) { - case "==" : return [ "binary", "!=", left, right ]; - case "!=" : return [ "binary", "==", left, right ]; - case "===" : return [ "binary", "!==", left, right ]; - case "!==" : return [ "binary", "===", left, right ]; - case "&&" : return best_of(not_c, [ "binary", "||", negate(left), negate(right) ]); - case "||" : return best_of(not_c, [ "binary", "&&", negate(left), negate(right) ]); - } - break; - } - return not_c; - }; - - function with_scope(s, cont) { - var _scope = scope; - scope = s; - var ret = cont(); - ret.scope = s; - scope = _scope; - return ret; - }; - - function rmblock(block) { - if (block != null && block[0] == "block" && block[1]) { - if (block[1].length == 1) - block = block[1][0]; - else if (block[1].length == 0) - block = [ "block" ]; - } - return block; - }; - - function _lambda(name, args, body) { - var is_defun = this[0] == "defun"; - body = with_scope(body.scope, function(){ - var ret = tighten(MAP(body, walk), "lambda"); - if (!is_defun && name && !HOP(scope.refs, name)) - name = null; - return ret; - }); - return [ this[0], name, args, body ]; - }; - - // we get here for blocks that have been already transformed. - // this function does a few things: - // 1. discard useless blocks - // 2. join consecutive var declarations - // 3. remove obviously dead code - // 4. transform consecutive statements using the comma operator - // 5. if block_type == "lambda" and it detects constructs like if(foo) return ... - rewrite like if (!foo) { ... } - function tighten(statements, block_type) { - statements = statements.reduce(function(a, stat){ - if (stat[0] == "block") { - if (stat[1]) { - a.push.apply(a, stat[1]); - } - } else { - a.push(stat); - } - return a; - }, []); - - statements = (function(a, prev){ - statements.forEach(function(cur){ - if (prev && ((cur[0] == "var" && prev[0] == "var") || - (cur[0] == "const" && prev[0] == "const"))) { - prev[1] = prev[1].concat(cur[1]); - } else { - a.push(cur); - prev = cur; - } - }); - return a; - })([]); - - if (options.dead_code) statements = (function(a, has_quit){ - statements.forEach(function(st){ - if (has_quit) { - if (member(st[0], [ "function", "defun" , "var", "const" ])) { - a.push(st); - } - else if (!options.no_warnings) - warn_unreachable(st); - } - else { - a.push(st); - if (member(st[0], [ "return", "throw", "break", "continue" ])) - has_quit = true; - } - }); - return a; - })([]); - - if (options.make_seqs) statements = (function(a, prev) { - statements.forEach(function(cur){ - if (prev && prev[0] == "stat" && cur[0] == "stat") { - prev[1] = [ "seq", prev[1], cur[1] ]; - } else { - a.push(cur); - prev = cur; - } - }); - return a; - })([]); - - if (block_type == "lambda") statements = (function(i, a, stat){ - while (i < statements.length) { - stat = statements[i++]; - if (stat[0] == "if" && !stat[3]) { - if (stat[2][0] == "return" && stat[2][1] == null) { - a.push(make_if(negate(stat[1]), [ "block", statements.slice(i) ])); - break; - } - var last = last_stat(stat[2]); - if (last[0] == "return" && last[1] == null) { - a.push(make_if(stat[1], [ "block", stat[2][1].slice(0, -1) ], [ "block", statements.slice(i) ])); - break; - } - } - a.push(stat); - } - return a; - })(0, []); - - return statements; - }; - - function make_if(c, t, e) { - return when_constant(c, function(ast, val){ - if (val) { - warn_unreachable(e); - return t; - } else { - warn_unreachable(t); - return e; - } - }, function() { - return make_real_if(c, t, e); - }); - }; - - function make_real_if(c, t, e) { - c = walk(c); - t = walk(t); - e = walk(e); - - if (empty(t)) { - c = negate(c); - t = e; - e = null; - } else if (empty(e)) { - e = null; - } else { - // if we have both else and then, maybe it makes sense to switch them? - (function(){ - var a = gen_code(c); - var n = negate(c); - var b = gen_code(n); - if (b.length < a.length) { - var tmp = t; - t = e; - e = tmp; - c = n; - } - })(); - } - if (empty(e) && empty(t)) - return [ "stat", c ]; - var ret = [ "if", c, t, e ]; - if (t[0] == "if" && empty(t[3]) && empty(e)) { - ret = best_of(ret, walk([ "if", [ "binary", "&&", c, t[1] ], t[2] ])); - } - else if (t[0] == "stat") { - if (e) { - if (e[0] == "stat") { - ret = best_of(ret, [ "stat", make_conditional(c, t[1], e[1]) ]); - } - } - else { - ret = best_of(ret, [ "stat", make_conditional(c, t[1]) ]); - } - } - else if (e && t[0] == e[0] && (t[0] == "return" || t[0] == "throw") && t[1] && e[1]) { - ret = best_of(ret, [ t[0], make_conditional(c, t[1], e[1] ) ]); - } - else if (e && aborts(t)) { - ret = [ [ "if", c, t ] ]; - if (e[0] == "block") { - if (e[1]) ret = ret.concat(e[1]); - } - else { - ret.push(e); - } - ret = walk([ "block", ret ]); - } - else if (t && aborts(e)) { - ret = [ [ "if", negate(c), e ] ]; - if (t[0] == "block") { - if (t[1]) ret = ret.concat(t[1]); - } else { - ret.push(t); - } - ret = walk([ "block", ret ]); - } - return ret; - }; - - function _do_while(cond, body) { - return when_constant(cond, function(cond, val){ - if (!val) { - warn_unreachable(body); - return [ "block" ]; - } else { - return [ "for", null, null, null, walk(body) ]; - } - }); - }; - - ast = prepare_ifs(ast); - ast = ast_add_scope(ast); - - return w.with_walkers({ - "sub": function(expr, subscript) { - if (subscript[0] == "string") { - var name = subscript[1]; - if (is_identifier(name)) - return [ "dot", walk(expr), name ]; - else if (/^[1-9][0-9]*$/.test(name) || name === "0") - return [ "sub", walk(expr), [ "num", parseInt(name, 10) ] ]; - } - }, - "if": make_if, - "toplevel": function(body) { - return [ "toplevel", with_scope(this.scope, function(){ - return tighten(MAP(body, walk)); - }) ]; - }, - "switch": function(expr, body) { - var last = body.length - 1; - return [ "switch", walk(expr), MAP(body, function(branch, i){ - var block = tighten(MAP(branch[1], walk)); - if (i == last && block.length > 0) { - var node = block[block.length - 1]; - if (node[0] == "break" && !node[1]) - block.pop(); - } - return [ branch[0] ? walk(branch[0]) : null, block ]; - }) ]; - }, - "function": _lambda, - "defun": _lambda, - "block": function(body) { - if (body) return rmblock([ "block", tighten(MAP(body, walk)) ]); - }, - "binary": function(op, left, right) { - return when_constant([ "binary", op, walk(left), walk(right) ], function yes(c){ - return best_of(walk(c), this); - }, function no() { - return this; - }); - }, - "conditional": function(c, t, e) { - return make_conditional(walk(c), walk(t), walk(e)); - }, - "try": function(t, c, f) { - return [ - "try", - tighten(MAP(t, walk)), - c != null ? [ c[0], tighten(MAP(c[1], walk)) ] : null, - f != null ? tighten(MAP(f, walk)) : null - ]; - }, - "unary-prefix": function(op, expr) { - expr = walk(expr); - var ret = [ "unary-prefix", op, expr ]; - if (op == "!") - ret = best_of(ret, negate(expr)); - return when_constant(ret, function(ast, val){ - return walk(ast); // it's either true or false, so minifies to !0 or !1 - }, function() { return ret }); - }, - "name": function(name) { - switch (name) { - case "true": return [ "unary-prefix", "!", [ "num", 0 ]]; - case "false": return [ "unary-prefix", "!", [ "num", 1 ]]; - } - }, - "new": function(ctor, args) { - if (ctor[0] == "name" && ctor[1] == "Array" && !scope.has("Array")) { - if (args.length != 1) { - return [ "array", args ]; - } else { - return [ "call", [ "name", "Array" ], args ]; - } - } - }, - "call": function(expr, args) { - if (expr[0] == "name" && expr[1] == "Array" && args.length != 1 && !scope.has("Array")) { - return [ "array", args ]; - } - }, - "while": _do_while - }, function() { - return walk(ast); - }); -}; - -/* -----[ re-generate code from the AST ]----- */ - -var DOT_CALL_NO_PARENS = jsp.array_to_hash([ - "name", - "array", - "object", - "string", - "dot", - "sub", - "call", - "regexp" -]); - -function make_string(str, ascii_only) { - var dq = 0, sq = 0; - str = str.replace(/[\\\b\f\n\r\t\x22\x27\u2028\u2029]/g, function(s){ - switch (s) { - case "\\": return "\\\\"; - case "\b": return "\\b"; - case "\f": return "\\f"; - case "\n": return "\\n"; - case "\r": return "\\r"; - case "\t": return "\\t"; - case "\u2028": return "\\u2028"; - case "\u2029": return "\\u2029"; - case '"': ++dq; return '"'; - case "'": ++sq; return "'"; - } - return s; - }); - if (ascii_only) str = to_ascii(str); - if (dq > sq) return "'" + str.replace(/\x27/g, "\\'") + "'"; - else return '"' + str.replace(/\x22/g, '\\"') + '"'; -}; - -function to_ascii(str) { - return str.replace(/[\u0080-\uffff]/g, function(ch) { - var code = ch.charCodeAt(0).toString(16); - while (code.length < 4) code = "0" + code; - return "\\u" + code; - }); -}; - -var SPLICE_NEEDS_BRACKETS = jsp.array_to_hash([ "if", "while", "do", "for", "for-in", "with" ]); - -function gen_code(ast, options) { - options = defaults(options, { - indent_start : 0, - indent_level : 4, - quote_keys : false, - space_colon : false, - beautify : false, - ascii_only : false - }); - var beautify = !!options.beautify; - var indentation = 0, - newline = beautify ? "\n" : "", - space = beautify ? " " : ""; - - function encode_string(str) { - return make_string(str, options.ascii_only); - }; - - function make_name(name) { - name = name.toString(); - if (options.ascii_only) - name = to_ascii(name); - return name; - }; - - function indent(line) { - if (line == null) - line = ""; - if (beautify) - line = repeat_string(" ", options.indent_start + indentation * options.indent_level) + line; - return line; - }; - - function with_indent(cont, incr) { - if (incr == null) incr = 1; - indentation += incr; - try { return cont.apply(null, slice(arguments, 1)); } - finally { indentation -= incr; } - }; - - function add_spaces(a) { - if (beautify) - return a.join(" "); - var b = []; - for (var i = 0; i < a.length; ++i) { - var next = a[i + 1]; - b.push(a[i]); - if (next && - ((/[a-z0-9_\x24]$/i.test(a[i].toString()) && /^[a-z0-9_\x24]/i.test(next.toString())) || - (/[\+\-]$/.test(a[i].toString()) && /^[\+\-]/.test(next.toString())))) { - b.push(" "); - } - } - return b.join(""); - }; - - function add_commas(a) { - return a.join("," + space); - }; - - function parenthesize(expr) { - var gen = make(expr); - for (var i = 1; i < arguments.length; ++i) { - var el = arguments[i]; - if ((el instanceof Function && el(expr)) || expr[0] == el) - return "(" + gen + ")"; - } - return gen; - }; - - function best_of(a) { - if (a.length == 1) { - return a[0]; - } - if (a.length == 2) { - var b = a[1]; - a = a[0]; - return a.length <= b.length ? a : b; - } - return best_of([ a[0], best_of(a.slice(1)) ]); - }; - - function needs_parens(expr) { - if (expr[0] == "function" || expr[0] == "object") { - // dot/call on a literal function requires the - // function literal itself to be parenthesized - // only if it's the first "thing" in a - // statement. This means that the parent is - // "stat", but it could also be a "seq" and - // we're the first in this "seq" and the - // parent is "stat", and so on. Messy stuff, - // but it worths the trouble. - var a = slice($stack), self = a.pop(), p = a.pop(); - while (p) { - if (p[0] == "stat") return true; - if (((p[0] == "seq" || p[0] == "call" || p[0] == "dot" || p[0] == "sub" || p[0] == "conditional") && p[1] === self) || - ((p[0] == "binary" || p[0] == "assign" || p[0] == "unary-postfix") && p[2] === self)) { - self = p; - p = a.pop(); - } else { - return false; - } - } - } - return !HOP(DOT_CALL_NO_PARENS, expr[0]); - }; - - function make_num(num) { - var str = num.toString(10), a = [ str.replace(/^0\./, ".") ], m; - if (Math.floor(num) === num) { - a.push("0x" + num.toString(16).toLowerCase(), // probably pointless - "0" + num.toString(8)); // same. - if ((m = /^(.*?)(0+)$/.exec(num))) { - a.push(m[1] + "e" + m[2].length); - } - } else if ((m = /^0?\.(0+)(.*)$/.exec(num))) { - a.push(m[2] + "e-" + (m[1].length + m[2].length), - str.substr(str.indexOf("."))); - } - return best_of(a); - }; - - var generators = { - "string": encode_string, - "num": make_num, - "name": make_name, - "toplevel": function(statements) { - return make_block_statements(statements) - .join(newline + newline); - }, - "splice": function(statements) { - var parent = $stack[$stack.length - 2][0]; - if (HOP(SPLICE_NEEDS_BRACKETS, parent)) { - // we need block brackets in this case - return make_block.apply(this, arguments); - } else { - return MAP(make_block_statements(statements, true), - function(line, i) { - // the first line is already indented - return i > 0 ? indent(line) : line; - }).join(newline); - } - }, - "block": make_block, - "var": function(defs) { - return "var " + add_commas(MAP(defs, make_1vardef)) + ";"; - }, - "const": function(defs) { - return "const " + add_commas(MAP(defs, make_1vardef)) + ";"; - }, - "try": function(tr, ca, fi) { - var out = [ "try", make_block(tr) ]; - if (ca) out.push("catch", "(" + ca[0] + ")", make_block(ca[1])); - if (fi) out.push("finally", make_block(fi)); - return add_spaces(out); - }, - "throw": function(expr) { - return add_spaces([ "throw", make(expr) ]) + ";"; - }, - "new": function(ctor, args) { - args = args.length > 0 ? "(" + add_commas(MAP(args, make)) + ")" : ""; - return add_spaces([ "new", parenthesize(ctor, "seq", "binary", "conditional", "assign", function(expr){ - var w = ast_walker(), has_call = {}; - try { - w.with_walkers({ - "call": function() { throw has_call }, - "function": function() { return this } - }, function(){ - w.walk(expr); - }); - } catch(ex) { - if (ex === has_call) - return true; - throw ex; - } - }) + args ]); - }, - "switch": function(expr, body) { - return add_spaces([ "switch", "(" + make(expr) + ")", make_switch_block(body) ]); - }, - "break": function(label) { - var out = "break"; - if (label != null) - out += " " + make_name(label); - return out + ";"; - }, - "continue": function(label) { - var out = "continue"; - if (label != null) - out += " " + make_name(label); - return out + ";"; - }, - "conditional": function(co, th, el) { - return add_spaces([ parenthesize(co, "assign", "seq", "conditional"), "?", - parenthesize(th, "seq"), ":", - parenthesize(el, "seq") ]); - }, - "assign": function(op, lvalue, rvalue) { - if (op && op !== true) op += "="; - else op = "="; - return add_spaces([ make(lvalue), op, parenthesize(rvalue, "seq") ]); - }, - "dot": function(expr) { - var out = make(expr), i = 1; - if (expr[0] == "num") { - if (!/\./.test(expr[1])) - out += "."; - } else if (needs_parens(expr)) - out = "(" + out + ")"; - while (i < arguments.length) - out += "." + make_name(arguments[i++]); - return out; - }, - "call": function(func, args) { - var f = make(func); - if (needs_parens(func)) - f = "(" + f + ")"; - return f + "(" + add_commas(MAP(args, function(expr){ - return parenthesize(expr, "seq"); - })) + ")"; - }, - "function": make_function, - "defun": make_function, - "if": function(co, th, el) { - var out = [ "if", "(" + make(co) + ")", el ? make_then(th) : make(th) ]; - if (el) { - out.push("else", make(el)); - } - return add_spaces(out); - }, - "for": function(init, cond, step, block) { - var out = [ "for" ]; - init = (init != null ? make(init) : "").replace(/;*\s*$/, ";" + space); - cond = (cond != null ? make(cond) : "").replace(/;*\s*$/, ";" + space); - step = (step != null ? make(step) : "").replace(/;*\s*$/, ""); - var args = init + cond + step; - if (args == "; ; ") args = ";;"; - out.push("(" + args + ")", make(block)); - return add_spaces(out); - }, - "for-in": function(vvar, key, hash, block) { - return add_spaces([ "for", "(" + - (vvar ? make(vvar).replace(/;+$/, "") : make(key)), - "in", - make(hash) + ")", make(block) ]); - }, - "while": function(condition, block) { - return add_spaces([ "while", "(" + make(condition) + ")", make(block) ]); - }, - "do": function(condition, block) { - return add_spaces([ "do", make(block), "while", "(" + make(condition) + ")" ]) + ";"; - }, - "return": function(expr) { - var out = [ "return" ]; - if (expr != null) out.push(make(expr)); - return add_spaces(out) + ";"; - }, - "binary": function(operator, lvalue, rvalue) { - var left = make(lvalue), right = make(rvalue); - // XXX: I'm pretty sure other cases will bite here. - // we need to be smarter. - // adding parens all the time is the safest bet. - if (member(lvalue[0], [ "assign", "conditional", "seq" ]) || - lvalue[0] == "binary" && PRECEDENCE[operator] > PRECEDENCE[lvalue[1]]) { - left = "(" + left + ")"; - } - if (member(rvalue[0], [ "assign", "conditional", "seq" ]) || - rvalue[0] == "binary" && PRECEDENCE[operator] >= PRECEDENCE[rvalue[1]] && - !(rvalue[1] == operator && member(operator, [ "&&", "||", "*" ]))) { - right = "(" + right + ")"; - } - return add_spaces([ left, operator, right ]); - }, - "unary-prefix": function(operator, expr) { - var val = make(expr); - if (!(expr[0] == "num" || (expr[0] == "unary-prefix" && !HOP(OPERATORS, operator + expr[1])) || !needs_parens(expr))) - val = "(" + val + ")"; - return operator + (jsp.is_alphanumeric_char(operator.charAt(0)) ? " " : "") + val; - }, - "unary-postfix": function(operator, expr) { - var val = make(expr); - if (!(expr[0] == "num" || (expr[0] == "unary-postfix" && !HOP(OPERATORS, operator + expr[1])) || !needs_parens(expr))) - val = "(" + val + ")"; - return val + operator; - }, - "sub": function(expr, subscript) { - var hash = make(expr); - if (needs_parens(expr)) - hash = "(" + hash + ")"; - return hash + "[" + make(subscript) + "]"; - }, - "object": function(props) { - if (props.length == 0) - return "{}"; - return "{" + newline + with_indent(function(){ - return MAP(props, function(p){ - if (p.length == 3) { - // getter/setter. The name is in p[0], the arg.list in p[1][2], the - // body in p[1][3] and type ("get" / "set") in p[2]. - return indent(make_function(p[0], p[1][2], p[1][3], p[2])); - } - var key = p[0], val = make(p[1]); - if (options.quote_keys) { - key = encode_string(key); - } else if ((typeof key == "number" || !beautify && +key + "" == key) - && parseFloat(key) >= 0) { - key = make_num(+key); - } else if (!is_identifier(key)) { - key = encode_string(key); - } - return indent(add_spaces(beautify && options.space_colon - ? [ key, ":", val ] - : [ key + ":", val ])); - }).join("," + newline); - }) + newline + indent("}"); - }, - "regexp": function(rx, mods) { - return "/" + rx + "/" + mods; - }, - "array": function(elements) { - if (elements.length == 0) return "[]"; - return add_spaces([ "[", add_commas(MAP(elements, function(el){ - if (!beautify && el[0] == "atom" && el[1] == "undefined") return ""; - return parenthesize(el, "seq"); - })), "]" ]); - }, - "stat": function(stmt) { - return make(stmt).replace(/;*\s*$/, ";"); - }, - "seq": function() { - return add_commas(MAP(slice(arguments), make)); - }, - "label": function(name, block) { - return add_spaces([ make_name(name), ":", make(block) ]); - }, - "with": function(expr, block) { - return add_spaces([ "with", "(" + make(expr) + ")", make(block) ]); - }, - "atom": function(name) { - return make_name(name); - } - }; - - // The squeezer replaces "block"-s that contain only a single - // statement with the statement itself; technically, the AST - // is correct, but this can create problems when we output an - // IF having an ELSE clause where the THEN clause ends in an - // IF *without* an ELSE block (then the outer ELSE would refer - // to the inner IF). This function checks for this case and - // adds the block brackets if needed. - function make_then(th) { - if (th[0] == "do") { - // https://github.com/mishoo/UglifyJS/issues/#issue/57 - // IE croaks with "syntax error" on code like this: - // if (foo) do ... while(cond); else ... - // we need block brackets around do/while - return make([ "block", [ th ]]); - } - var b = th; - while (true) { - var type = b[0]; - if (type == "if") { - if (!b[3]) - // no else, we must add the block - return make([ "block", [ th ]]); - b = b[3]; - } - else if (type == "while" || type == "do") b = b[2]; - else if (type == "for" || type == "for-in") b = b[4]; - else break; - } - return make(th); - }; - - function make_function(name, args, body, keyword) { - var out = keyword || "function"; - if (name) { - out += " " + make_name(name); - } - out += "(" + add_commas(MAP(args, make_name)) + ")"; - return add_spaces([ out, make_block(body) ]); - }; - - function make_block_statements(statements, noindent) { - for (var a = [], last = statements.length - 1, i = 0; i <= last; ++i) { - var stat = statements[i]; - var code = make(stat); - if (code != ";") { - if (!beautify && i == last) { - if ((stat[0] == "while" && empty(stat[2])) || - (member(stat[0], [ "for", "for-in"] ) && empty(stat[4])) || - (stat[0] == "if" && empty(stat[2]) && !stat[3]) || - (stat[0] == "if" && stat[3] && empty(stat[3]))) { - code = code.replace(/;*\s*$/, ";"); - } else { - code = code.replace(/;+\s*$/, ""); - } - } - a.push(code); - } - } - return noindent ? a : MAP(a, indent); - }; - - function make_switch_block(body) { - var n = body.length; - if (n == 0) return "{}"; - return "{" + newline + MAP(body, function(branch, i){ - var has_body = branch[1].length > 0, code = with_indent(function(){ - return indent(branch[0] - ? add_spaces([ "case", make(branch[0]) + ":" ]) - : "default:"); - }, 0.5) + (has_body ? newline + with_indent(function(){ - return make_block_statements(branch[1]).join(newline); - }) : ""); - if (!beautify && has_body && i < n - 1) - code += ";"; - return code; - }).join(newline) + newline + indent("}"); - }; - - function make_block(statements) { - if (!statements) return ";"; - if (statements.length == 0) return "{}"; - return "{" + newline + with_indent(function(){ - return make_block_statements(statements).join(newline); - }) + newline + indent("}"); - }; - - function make_1vardef(def) { - var name = def[0], val = def[1]; - if (val != null) - name = add_spaces([ make_name(name), "=", parenthesize(val, "seq") ]); - return name; - }; - - var $stack = []; - - function make(node) { - var type = node[0]; - var gen = generators[type]; - if (!gen) - throw new Error("Can't find generator for \"" + type + "\""); - $stack.push(node); - var ret = gen.apply(type, node.slice(1)); - $stack.pop(); - return ret; - }; - - return make(ast); -}; - -function split_lines(code, max_line_length) { - var splits = [ 0 ]; - jsp.parse(function(){ - var next_token = jsp.tokenizer(code); - var last_split = 0; - var prev_token; - function current_length(tok) { - return tok.pos - last_split; - }; - function split_here(tok) { - last_split = tok.pos; - splits.push(last_split); - }; - function custom(){ - var tok = next_token.apply(this, arguments); - out: { - if (prev_token) { - if (prev_token.type == "keyword") break out; - } - if (current_length(tok) > max_line_length) { - switch (tok.type) { - case "keyword": - case "atom": - case "name": - case "punc": - split_here(tok); - break out; - } - } - } - prev_token = tok; - return tok; - }; - custom.context = function() { - return next_token.context.apply(this, arguments); - }; - return custom; - }()); - return splits.map(function(pos, i){ - return code.substring(pos, splits[i + 1] || code.length); - }).join("\n"); -}; - -/* -----[ Utilities ]----- */ - -function repeat_string(str, i) { - if (i <= 0) return ""; - if (i == 1) return str; - var d = repeat_string(str, i >> 1); - d += d; - if (i & 1) d += str; - return d; -}; - -function defaults(args, defs) { - var ret = {}; - if (args === true) - args = {}; - for (var i in defs) if (HOP(defs, i)) { - ret[i] = (args && HOP(args, i)) ? args[i] : defs[i]; - } - return ret; -}; - -function is_identifier(name) { - return /^[a-z_$][a-z0-9_$]*$/i.test(name) - && name != "this" - && !HOP(jsp.KEYWORDS_ATOM, name) - && !HOP(jsp.RESERVED_WORDS, name) - && !HOP(jsp.KEYWORDS, name); -}; - -function HOP(obj, prop) { - return Object.prototype.hasOwnProperty.call(obj, prop); -}; - -// some utilities - -var MAP; - -(function(){ - MAP = function(a, f, o) { - var ret = []; - for (var i = 0; i < a.length; ++i) { - var val = f.call(o, a[i], i); - if (val instanceof AtTop) ret.unshift(val.v); - else ret.push(val); - } - return ret; - }; - MAP.at_top = function(val) { return new AtTop(val) }; - function AtTop(val) { this.v = val }; -})(); - -/* -----[ Exports ]----- */ - -exports.ast_walker = ast_walker; -exports.ast_mangle = ast_mangle; -exports.ast_squeeze = ast_squeeze; -exports.gen_code = gen_code; -exports.ast_add_scope = ast_add_scope; -exports.set_logger = function(logger) { warn = logger }; -exports.make_string = make_string; -exports.split_lines = split_lines; -exports.MAP = MAP; - -// keep this last! -exports.ast_squeeze_more = require("./squeeze-more").ast_squeeze_more; -; - }).call(module.exports); - - __require.modules["/node_modules/burrito/node_modules/uglify-js/lib/process.js"]._cached = module.exports; - return module.exports; -}; - -require.modules["/node_modules/burrito/node_modules/uglify-js/lib/squeeze-more.js"] = function () { - var module = { exports : {} }; - var exports = module.exports; - var __dirname = "/node_modules/burrito/node_modules/uglify-js/lib"; - var __filename = "/node_modules/burrito/node_modules/uglify-js/lib/squeeze-more.js"; - - var require = function (file) { - return __require(file, "/node_modules/burrito/node_modules/uglify-js/lib"); - }; - - require.resolve = function (file) { - return __require.resolve(name, "/node_modules/burrito/node_modules/uglify-js/lib"); - }; - - require.modules = __require.modules; - __require.modules["/node_modules/burrito/node_modules/uglify-js/lib/squeeze-more.js"]._cached = module.exports; - - (function () { - var jsp = require("./parse-js"), - pro = require("./process"), - slice = jsp.slice, - member = jsp.member, - PRECEDENCE = jsp.PRECEDENCE, - OPERATORS = jsp.OPERATORS; - -function ast_squeeze_more(ast) { - var w = pro.ast_walker(), walk = w.walk; - return w.with_walkers({ - "call": function(expr, args) { - if (expr[0] == "dot" && expr[2] == "toString" && args.length == 0) { - // foo.toString() ==> foo+"" - return [ "binary", "+", expr[1], [ "string", "" ]]; - } - } - }, function() { - return walk(ast); - }); -}; - -exports.ast_squeeze_more = ast_squeeze_more; -; - }).call(module.exports); - - __require.modules["/node_modules/burrito/node_modules/uglify-js/lib/squeeze-more.js"]._cached = module.exports; - return module.exports; -}; - -require.modules["/node_modules/burrito/node_modules/traverse/package.json"] = function () { - var module = { exports : {} }; - var exports = module.exports; - var __dirname = "/node_modules/burrito/node_modules/traverse"; - var __filename = "/node_modules/burrito/node_modules/traverse/package.json"; - - var require = function (file) { - return __require(file, "/node_modules/burrito/node_modules/traverse"); - }; - - require.resolve = function (file) { - return __require.resolve(name, "/node_modules/burrito/node_modules/traverse"); - }; - - require.modules = __require.modules; - __require.modules["/node_modules/burrito/node_modules/traverse/package.json"]._cached = module.exports; - - (function () { - module.exports = {"name":"traverse","version":"0.5.0","description":"Traverse and transform objects by visiting every node on a recursive walk","author":"James Halliday","license":"MIT/X11","main":"./index","repository":{"type":"git","url":"http://github.com/substack/js-traverse.git"},"devDependencies":{"expresso":"0.7.x"},"scripts":{"test":"expresso"}}; - }).call(module.exports); - - __require.modules["/node_modules/burrito/node_modules/traverse/package.json"]._cached = module.exports; - return module.exports; -}; - -require.modules["/node_modules/burrito/node_modules/traverse/index.js"] = function () { - var module = { exports : {} }; - var exports = module.exports; - var __dirname = "/node_modules/burrito/node_modules/traverse"; - var __filename = "/node_modules/burrito/node_modules/traverse/index.js"; - - var require = function (file) { - return __require(file, "/node_modules/burrito/node_modules/traverse"); - }; - - require.resolve = function (file) { - return __require.resolve(name, "/node_modules/burrito/node_modules/traverse"); - }; - - require.modules = __require.modules; - __require.modules["/node_modules/burrito/node_modules/traverse/index.js"]._cached = module.exports; - - (function () { - module.exports = Traverse; -function Traverse (obj) { - if (!(this instanceof Traverse)) return new Traverse(obj); - this.value = obj; -} - -Traverse.prototype.get = function (ps) { - var node = this.value; - for (var i = 0; i < ps.length; i ++) { - var key = ps[i]; - if (!Object.hasOwnProperty.call(node, key)) { - node = undefined; - break; - } - node = node[key]; - } - return node; -}; - -Traverse.prototype.set = function (ps, value) { - var node = this.value; - for (var i = 0; i < ps.length - 1; i ++) { - var key = ps[i]; - if (!Object.hasOwnProperty.call(node, key)) node[key] = {}; - node = node[key]; - } - node[ps[i]] = value; - return value; -}; - -Traverse.prototype.map = function (cb) { - return walk(this.value, cb, true); -}; - -Traverse.prototype.forEach = function (cb) { - this.value = walk(this.value, cb, false); - return this.value; -}; - -Traverse.prototype.reduce = function (cb, init) { - var skip = arguments.length === 1; - var acc = skip ? this.value : init; - this.forEach(function (x) { - if (!this.isRoot || !skip) { - acc = cb.call(this, acc, x); - } - }); - return acc; -}; - -Traverse.prototype.paths = function () { - var acc = []; - this.forEach(function (x) { - acc.push(this.path); - }); - return acc; -}; - -Traverse.prototype.nodes = function () { - var acc = []; - this.forEach(function (x) { - acc.push(this.node); - }); - return acc; -}; - -Traverse.prototype.clone = function () { - var parents = [], nodes = []; - - return (function clone (src) { - for (var i = 0; i < parents.length; i++) { - if (parents[i] === src) { - return nodes[i]; - } - } - - if (typeof src === 'object' && src !== null) { - var dst = copy(src); - - parents.push(src); - nodes.push(dst); - - forEach(Object_keys(src), function (key) { - dst[key] = clone(src[key]); - }); - - parents.pop(); - nodes.pop(); - return dst; - } - else { - return src; - } - })(this.value); -}; - -function walk (root, cb, immutable) { - var path = []; - var parents = []; - var alive = true; - - return (function walker (node_) { - var node = immutable ? copy(node_) : node_; - var modifiers = {}; - - var keepGoing = true; - - var state = { - node : node, - node_ : node_, - path : [].concat(path), - parent : parents[parents.length - 1], - parents : parents, - key : path.slice(-1)[0], - isRoot : path.length === 0, - level : path.length, - circular : null, - update : function (x, stopHere) { - if (!state.isRoot) { - state.parent.node[state.key] = x; - } - state.node = x; - if (stopHere) keepGoing = false; - }, - 'delete' : function () { - delete state.parent.node[state.key]; - }, - remove : function () { - if (Array_isArray(state.parent.node)) { - state.parent.node.splice(state.key, 1); - } - else { - delete state.parent.node[state.key]; - } - }, - keys : null, - before : function (f) { modifiers.before = f }, - after : function (f) { modifiers.after = f }, - pre : function (f) { modifiers.pre = f }, - post : function (f) { modifiers.post = f }, - stop : function () { alive = false }, - block : function () { keepGoing = false } - }; - - if (!alive) return state; - - if (typeof node === 'object' && node !== null) { - state.keys = Object_keys(node); - - state.isLeaf = state.keys.length == 0; - - for (var i = 0; i < parents.length; i++) { - if (parents[i].node_ === node_) { - state.circular = parents[i]; - break; - } - } - } - else { - state.isLeaf = true; - } - - state.notLeaf = !state.isLeaf; - state.notRoot = !state.isRoot; - - // use return values to update if defined - var ret = cb.call(state, state.node); - if (ret !== undefined && state.update) state.update(ret); - - if (modifiers.before) modifiers.before.call(state, state.node); - - if (!keepGoing) return state; - - if (typeof state.node == 'object' - && state.node !== null && !state.circular) { - parents.push(state); - - forEach(state.keys, function (key, i) { - path.push(key); - - if (modifiers.pre) modifiers.pre.call(state, state.node[key], key); - - var child = walker(state.node[key]); - if (immutable && Object.hasOwnProperty.call(state.node, key)) { - state.node[key] = child.node; - } - - child.isLast = i == state.keys.length - 1; - child.isFirst = i == 0; - - if (modifiers.post) modifiers.post.call(state, child); - - path.pop(); - }); - parents.pop(); - } - - if (modifiers.after) modifiers.after.call(state, state.node); - - return state; - })(root).node; -} - -function copy (src) { - if (typeof src === 'object' && src !== null) { - var dst; - - if (Array_isArray(src)) { - dst = []; - } - else if (src instanceof Date) { - dst = new Date(src); - } - else if (src instanceof Boolean) { - dst = new Boolean(src); - } - else if (src instanceof Number) { - dst = new Number(src); - } - else if (src instanceof String) { - dst = new String(src); - } - else if (Object.create && Object.getPrototypeOf) { - dst = Object.create(Object.getPrototypeOf(src)); - } - else if (src.__proto__ || src.constructor.prototype) { - var proto = src.__proto__ || src.constructor.prototype || {}; - var T = function () {}; - T.prototype = proto; - dst = new T; - if (!dst.__proto__) dst.__proto__ = proto; - } - - forEach(Object_keys(src), function (key) { - dst[key] = src[key]; - }); - return dst; - } - else return src; -} - -var Object_keys = Object.keys || function keys (obj) { - var res = []; - for (var key in obj) res.push(key) - return res; -}; - -var Array_isArray = Array.isArray || function isArray (xs) { - return Object.prototype.toString.call(xs) === '[object Array]'; -}; - -var forEach = function (xs, fn) { - if (xs.forEach) return xs.forEach(fn) - else for (var i = 0; i < xs.length; i++) { - fn(xs[i], i, xs); - } -}; - -forEach(Object_keys(Traverse.prototype), function (key) { - Traverse[key] = function (obj) { - var args = [].slice.call(arguments, 1); - var t = Traverse(obj); - return t[key].apply(t, args); - }; -}); -; - }).call(module.exports); - - __require.modules["/node_modules/burrito/node_modules/traverse/index.js"]._cached = module.exports; - return module.exports; -}; - -require.modules["vm"] = function () { - var module = { exports : {} }; - var exports = module.exports; - var __dirname = "."; - var __filename = "vm"; - - var require = function (file) { - return __require(file, "."); - }; - - require.resolve = function (file) { - return __require.resolve(name, "."); - }; - - require.modules = __require.modules; - __require.modules["vm"]._cached = module.exports; - - (function () { - var Object_keys = function (obj) { - if (Object.keys) return Object.keys(obj) - else { - var res = []; - for (var key in obj) res.push(key) - return res; - } -}; - -var forEach = function (xs, fn) { - if (xs.forEach) return xs.forEach(fn) - else for (var i = 0; i < xs.length; i++) { - fn(xs[i], i, xs); - } -}; - -var Script = exports.Script = function NodeScript (code) { - if (!(this instanceof Script)) return new Script(code); - this.code = code; -}; - -var iframe = document.createElement('iframe'); -if (!iframe.style) iframe.style = {}; -iframe.style.display = 'none'; - -var iframeCapable = true; // until proven otherwise -if (navigator.appName === 'Microsoft Internet Explorer') { - var m = navigator.appVersion.match(/\bMSIE (\d+\.\d+);/); - if (m && parseFloat(m[1]) <= 9.0) { - iframeCapable = false; - } -} - -Script.prototype.runInNewContext = function (context) { - if (!context) context = {}; - - if (!iframeCapable) { - var keys = Object_keys(context); - var args = []; - for (var i = 0; i < keys.length; i++) { - args.push(context[keys[i]]); - } - - var fn = Function(keys, this.code); - return fn.apply(null, args); - } - - document.body.appendChild(iframe); - - var win = iframe.contentWindow - || (window.frames && window.frames[window.frames.length - 1]) - || window[window.length - 1] - ; - - forEach(Object_keys(context), function (key) { - win[key] = context[key]; - iframe[key] = context[key]; - }); - - if (win.eval) { - // chrome and ff can just .eval() - var res = win.eval(this.code); - } - else { - // this works in IE9 but not anything newer - iframe.setAttribute('src', - 'javascript:__browserifyVmResult=(' + this.code + ')' - ); - if ('__browserifyVmResult' in win) { - var res = win.__browserifyVmResult; - } - else { - iframeCapable = false; - res = this.runInThisContext(context); - } - } - - forEach(Object_keys(win), function (key) { - context[key] = win[key]; - }); - - document.body.removeChild(iframe); - - return res; -}; - -Script.prototype.runInThisContext = function () { - return eval(this.code); // maybe... -}; - -Script.prototype.runInContext = function (context) { - // seems to be just runInNewContext on magical context objects which are - // otherwise indistinguishable from objects except plain old objects - // for the parameter segfaults node - return this.runInNewContext(context); -}; - -forEach(Object_keys(Script.prototype), function (name) { - exports[name] = Script[name] = function (code) { - var s = Script(code); - return s[name].apply(s, [].slice.call(arguments, 1)); - }; -}); - -exports.createScript = function (code) { - return exports.Script(code); -}; - -exports.createContext = Script.createContext = function (context) { - // not really sure what this one does - // seems to just make a shallow copy - var copy = {}; - forEach(Object_keys(context), function (key) { - copy[key] = context[key]; - }); - return copy; -}; -; - }).call(module.exports); - - __require.modules["vm"]._cached = module.exports; - return module.exports; -}; - -require.modules["/node_modules/jsonify/package.json"] = function () { - var module = { exports : {} }; - var exports = module.exports; - var __dirname = "/node_modules/jsonify"; - var __filename = "/node_modules/jsonify/package.json"; - - var require = function (file) { - return __require(file, "/node_modules/jsonify"); - }; - - require.resolve = function (file) { - return __require.resolve(name, "/node_modules/jsonify"); - }; - - require.modules = __require.modules; - __require.modules["/node_modules/jsonify/package.json"]._cached = module.exports; - - (function () { - module.exports = {"name":"jsonify","version":"0.0.0","description":"JSON without touching any globals","main":"index.js","directories":{"lib":".","test":"test"},"devDependencies":{"tap":"0.0.x","garbage":"0.0.x"},"scripts":{"test":"tap test"},"repository":{"type":"git","url":"http://github.com/substack/jsonify.git"},"keywords":["json","browser"],"author":{"name":"Douglas Crockford","url":"http://crockford.com/"},"license":"Public Domain"}; - }).call(module.exports); - - __require.modules["/node_modules/jsonify/package.json"]._cached = module.exports; - return module.exports; -}; - -require.modules["/node_modules/jsonify/index.js"] = function () { - var module = { exports : {} }; - var exports = module.exports; - var __dirname = "/node_modules/jsonify"; - var __filename = "/node_modules/jsonify/index.js"; - - var require = function (file) { - return __require(file, "/node_modules/jsonify"); - }; - - require.resolve = function (file) { - return __require.resolve(name, "/node_modules/jsonify"); - }; - - require.modules = __require.modules; - __require.modules["/node_modules/jsonify/index.js"]._cached = module.exports; - - (function () { - exports.parse = require('./lib/parse'); -exports.stringify = require('./lib/stringify'); -; - }).call(module.exports); - - __require.modules["/node_modules/jsonify/index.js"]._cached = module.exports; - return module.exports; -}; - -require.modules["/node_modules/jsonify/lib/parse.js"] = function () { - var module = { exports : {} }; - var exports = module.exports; - var __dirname = "/node_modules/jsonify/lib"; - var __filename = "/node_modules/jsonify/lib/parse.js"; - - var require = function (file) { - return __require(file, "/node_modules/jsonify/lib"); - }; - - require.resolve = function (file) { - return __require.resolve(name, "/node_modules/jsonify/lib"); - }; - - require.modules = __require.modules; - __require.modules["/node_modules/jsonify/lib/parse.js"]._cached = module.exports; - - (function () { - var at, // The index of the current character - ch, // The current character - escapee = { - '"': '"', - '\\': '\\', - '/': '/', - b: '\b', - f: '\f', - n: '\n', - r: '\r', - t: '\t' - }, - text, - - error = function (m) { - // Call error when something is wrong. - throw { - name: 'SyntaxError', - message: m, - at: at, - text: text - }; - }, - - next = function (c) { - // If a c parameter is provided, verify that it matches the current character. - if (c && c !== ch) { - error("Expected '" + c + "' instead of '" + ch + "'"); - } - - // Get the next character. When there are no more characters, - // return the empty string. - - ch = text.charAt(at); - at += 1; - return ch; - }, - - number = function () { - // Parse a number value. - var number, - string = ''; - - if (ch === '-') { - string = '-'; - next('-'); - } - while (ch >= '0' && ch <= '9') { - string += ch; - next(); - } - if (ch === '.') { - string += '.'; - while (next() && ch >= '0' && ch <= '9') { - string += ch; - } - } - if (ch === 'e' || ch === 'E') { - string += ch; - next(); - if (ch === '-' || ch === '+') { - string += ch; - next(); - } - while (ch >= '0' && ch <= '9') { - string += ch; - next(); - } - } - number = +string; - if (!isFinite(number)) { - error("Bad number"); - } else { - return number; - } - }, - - string = function () { - // Parse a string value. - var hex, - i, - string = '', - uffff; - - // When parsing for string values, we must look for " and \ characters. - if (ch === '"') { - while (next()) { - if (ch === '"') { - next(); - return string; - } else if (ch === '\\') { - next(); - if (ch === 'u') { - uffff = 0; - for (i = 0; i < 4; i += 1) { - hex = parseInt(next(), 16); - if (!isFinite(hex)) { - break; - } - uffff = uffff * 16 + hex; - } - string += String.fromCharCode(uffff); - } else if (typeof escapee[ch] === 'string') { - string += escapee[ch]; - } else { - break; - } - } else { - string += ch; - } - } - } - error("Bad string"); - }, - - white = function () { - -// Skip whitespace. - - while (ch && ch <= ' ') { - next(); - } - }, - - word = function () { - -// true, false, or null. - - switch (ch) { - case 't': - next('t'); - next('r'); - next('u'); - next('e'); - return true; - case 'f': - next('f'); - next('a'); - next('l'); - next('s'); - next('e'); - return false; - case 'n': - next('n'); - next('u'); - next('l'); - next('l'); - return null; - } - error("Unexpected '" + ch + "'"); - }, - - value, // Place holder for the value function. - - array = function () { - -// Parse an array value. - - var array = []; - - if (ch === '[') { - next('['); - white(); - if (ch === ']') { - next(']'); - return array; // empty array - } - while (ch) { - array.push(value()); - white(); - if (ch === ']') { - next(']'); - return array; - } - next(','); - white(); - } - } - error("Bad array"); - }, - - object = function () { - -// Parse an object value. - - var key, - object = {}; - - if (ch === '{') { - next('{'); - white(); - if (ch === '}') { - next('}'); - return object; // empty object - } - while (ch) { - key = string(); - white(); - next(':'); - if (Object.hasOwnProperty.call(object, key)) { - error('Duplicate key "' + key + '"'); - } - object[key] = value(); - white(); - if (ch === '}') { - next('}'); - return object; - } - next(','); - white(); - } - } - error("Bad object"); - }; - -value = function () { - -// Parse a JSON value. It could be an object, an array, a string, a number, -// or a word. - - white(); - switch (ch) { - case '{': - return object(); - case '[': - return array(); - case '"': - return string(); - case '-': - return number(); - default: - return ch >= '0' && ch <= '9' ? number() : word(); - } -}; - -// Return the json_parse function. It will have access to all of the above -// functions and variables. - -module.exports = function (source, reviver) { - var result; - - text = source; - at = 0; - ch = ' '; - result = value(); - white(); - if (ch) { - error("Syntax error"); - } - - // If there is a reviver function, we recursively walk the new structure, - // passing each name/value pair to the reviver function for possible - // transformation, starting with a temporary root object that holds the result - // in an empty key. If there is not a reviver function, we simply return the - // result. - - return typeof reviver === 'function' ? (function walk(holder, key) { - var k, v, value = holder[key]; - if (value && typeof value === 'object') { - for (k in value) { - if (Object.prototype.hasOwnProperty.call(value, k)) { - v = walk(value, k); - if (v !== undefined) { - value[k] = v; - } else { - delete value[k]; - } - } - } - } - return reviver.call(holder, key, value); - }({'': result}, '')) : result; -}; -; - }).call(module.exports); - - __require.modules["/node_modules/jsonify/lib/parse.js"]._cached = module.exports; - return module.exports; -}; - -require.modules["/node_modules/jsonify/lib/stringify.js"] = function () { - var module = { exports : {} }; - var exports = module.exports; - var __dirname = "/node_modules/jsonify/lib"; - var __filename = "/node_modules/jsonify/lib/stringify.js"; - - var require = function (file) { - return __require(file, "/node_modules/jsonify/lib"); - }; - - require.resolve = function (file) { - return __require.resolve(name, "/node_modules/jsonify/lib"); - }; - - require.modules = __require.modules; - __require.modules["/node_modules/jsonify/lib/stringify.js"]._cached = module.exports; - - (function () { - var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, - escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, - gap, - indent, - meta = { // table of character substitutions - '\b': '\\b', - '\t': '\\t', - '\n': '\\n', - '\f': '\\f', - '\r': '\\r', - '"' : '\\"', - '\\': '\\\\' - }, - rep; - -function quote(string) { - // If the string contains no control characters, no quote characters, and no - // backslash characters, then we can safely slap some quotes around it. - // Otherwise we must also replace the offending characters with safe escape - // sequences. - - escapable.lastIndex = 0; - return escapable.test(string) ? '"' + string.replace(escapable, function (a) { - var c = meta[a]; - return typeof c === 'string' ? c : - '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); - }) + '"' : '"' + string + '"'; -} - -function str(key, holder) { - // Produce a string from holder[key]. - var i, // The loop counter. - k, // The member key. - v, // The member value. - length, - mind = gap, - partial, - value = holder[key]; - - // If the value has a toJSON method, call it to obtain a replacement value. - if (value && typeof value === 'object' && - typeof value.toJSON === 'function') { - value = value.toJSON(key); - } - - // If we were called with a replacer function, then call the replacer to - // obtain a replacement value. - if (typeof rep === 'function') { - value = rep.call(holder, key, value); - } - - // What happens next depends on the value's type. - switch (typeof value) { - case 'string': - return quote(value); - - case 'number': - // JSON numbers must be finite. Encode non-finite numbers as null. - return isFinite(value) ? String(value) : 'null'; - - case 'boolean': - case 'null': - // If the value is a boolean or null, convert it to a string. Note: - // typeof null does not produce 'null'. The case is included here in - // the remote chance that this gets fixed someday. - return String(value); - - case 'object': - if (!value) return 'null'; - gap += indent; - partial = []; - - // Array.isArray - if (Object.prototype.toString.apply(value) === '[object Array]') { - length = value.length; - for (i = 0; i < length; i += 1) { - partial[i] = str(i, value) || 'null'; - } - - // Join all of the elements together, separated with commas, and - // wrap them in brackets. - v = partial.length === 0 ? '[]' : gap ? - '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' : - '[' + partial.join(',') + ']'; - gap = mind; - return v; - } - - // If the replacer is an array, use it to select the members to be - // stringified. - if (rep && typeof rep === 'object') { - length = rep.length; - for (i = 0; i < length; i += 1) { - k = rep[i]; - if (typeof k === 'string') { - v = str(k, value); - if (v) { - partial.push(quote(k) + (gap ? ': ' : ':') + v); - } - } - } - } - else { - // Otherwise, iterate through all of the keys in the object. - for (k in value) { - if (Object.prototype.hasOwnProperty.call(value, k)) { - v = str(k, value); - if (v) { - partial.push(quote(k) + (gap ? ': ' : ':') + v); - } - } - } - } - - // Join all of the member texts together, separated with commas, - // and wrap them in braces. - - v = partial.length === 0 ? '{}' : gap ? - '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' : - '{' + partial.join(',') + '}'; - gap = mind; - return v; - } -} - -module.exports = function (value, replacer, space) { - var i; - gap = ''; - indent = ''; - - // If the space parameter is a number, make an indent string containing that - // many spaces. - if (typeof space === 'number') { - for (i = 0; i < space; i += 1) { - indent += ' '; - } - } - // If the space parameter is a string, it will be used as the indent string. - else if (typeof space === 'string') { - indent = space; - } - - // If there is a replacer, it must be a function or an array. - // Otherwise, throw an error. - rep = replacer; - if (replacer && typeof replacer !== 'function' - && (typeof replacer !== 'object' || typeof replacer.length !== 'number')) { - throw new Error('JSON.stringify'); - } - - // Make a fake root object containing our value under the key of ''. - // Return the result of stringifying the value. - return str('', {'': value}); -}; -; - }).call(module.exports); - - __require.modules["/node_modules/jsonify/lib/stringify.js"]._cached = module.exports; - return module.exports; -}; - -require.modules["/node_modules/burrito/index.js"] = function () { - var module = { exports : {} }; - var exports = module.exports; - var __dirname = "/node_modules/burrito"; - var __filename = "/node_modules/burrito/index.js"; - - var require = function (file) { - return __require(file, "/node_modules/burrito"); - }; - - require.resolve = function (file) { - return __require.resolve(name, "/node_modules/burrito"); - }; - - require.modules = __require.modules; - __require.modules["/node_modules/burrito/index.js"]._cached = module.exports; - - (function () { - var uglify = require('uglify-js'); -var parser = uglify.parser; -var parse = function (expr) { - if (typeof expr !== 'string') throw 'expression should be a string'; - - //try { - var args = [].slice.call(arguments); - var ast = parser.parse.apply(null, args); - /* } - catch (err) { - if (err.message === undefined - || err.line === undefined - || err.col === undefined - || err.pos === undefined - ) { throw err } - - var e = new SyntaxError( - err.message - + '\n at line ' + err.line + ':' + err.col + ' in expression:\n\n' - + ' ' + expr.split(/\r?\n/)[err.line] - ); - - e.original = err; - e.line = err.line; - e.col = err.col; - e.pos = err.pos; - throw e; - } - */ - return ast; -}; - -var deparse = function (ast, b) { - return uglify.uglify.gen_code(ast, { beautify : b }); -}; - -var traverse = require('traverse'); -var vm = require('vm'); - -var burrito = module.exports = function (code, cb) { - var ast = Array_isArray(code) - ? code // already an ast - : parse(code.toString(), false, true) - ; - - var ast_ = traverse(ast).map(function mapper () { - wrapNode(this, cb); - }); - - return deparse(parse(deparse(ast_)), true); -}; - -var wrapNode = burrito.wrapNode = function (state, cb) { - var node = state.node; - - var ann = Array_isArray(node) && node[0] - && typeof node[0] === 'object' && node[0].name - ? node[0] - : null - ; - - if (!ann) return undefined; - - var self = { - name : ann.name, - node : node, - start : node[0].start, - end : node[0].end, - value : node.slice(1), - state : state - }; - - self.wrap = function (s) { - var subsrc = deparse( - traverse(node).map(function (x) { - if (!this.isRoot) wrapNode(this, cb) - }) - ); - - if (self.name === 'binary') { - var a = deparse(traverse(node[2]).map(function (x) { - if (!this.isRoot) wrapNode(this, cb) - })); - var b = deparse(traverse(node[3]).map(function (x) { - if (!this.isRoot) wrapNode(this, cb) - })); - } - - var src = ''; - - if (typeof s === 'function') { - if (self.name === 'binary') { - src = s(subsrc, a, b); - } - else { - src = s(subsrc); - } - } - else { - src = s.toString() - .replace(/%s/g, function () { - return subsrc - }) - ; - - if (self.name === 'binary') { - src = src - .replace(/%a/g, function () { return a }) - .replace(/%b/g, function () { return b }) - ; - } - } - - var expr = parse(src); - state.update(expr, true); - }; - - var cache = {}; - - self.parent = state.isRoot ? null : function () { - if (!cache.parent) { - var s = state; - var x; - do { - s = s.parent; - if (s) x = wrapNode(s); - } while (s && !x); - - cache.parent = x; - } - - return cache.parent; - }; - - self.source = function () { - if (!cache.source) cache.source = deparse(node); - return cache.source; - }; - - self.label = function () { - return burrito.label(self); - }; - - if (cb) cb.call(state, self); - - if (self.node[0].name === 'conditional') { - self.wrap('[%s][0]'); - } - - return self; -} - -burrito.microwave = function (code, context, cb) { - if (!cb) { cb = context; context = {} }; - if (!context) context = {}; - - var src = burrito(code, cb); - return vm.runInNewContext(src, context); -}; - -burrito.generateName = function (len) { - var name = ''; - var lower = '$'.charCodeAt(0); - var upper = 'z'.charCodeAt(0); - - while (name.length < len) { - var c = String.fromCharCode(Math.floor( - Math.random() * (upper - lower + 1) + lower - )); - if ((name + c).match(/^[A-Za-z_$][A-Za-z0-9_$]*$/)) name += c; - } - - return name; -}; - -burrito.parse = parse; -burrito.deparse = deparse; - -burrito.label = function (node) { - if (node.name === 'call') { - if (typeof node.value[0] === 'string') { - return node.value[0]; - } - else if (node.value[0] && typeof node.value[0][1] === 'string') { - return node.value[0][1]; - } - else { - return null; - } - } - else if (node.name === 'var') { - return node.value[0].map(function (x) { return x[0] }); - } - else if (node.name === 'defun') { - return node.value[0]; - } - else if (node.name === 'function') { - return node.value[0]; - } - else { - return null; - } -}; - -var Array_isArray = Array.isArray || function isArray (xs) { - return Object.prototype.toString.call(xs) === '[object Array]'; -}; -; - }).call(module.exports); - - __require.modules["/node_modules/burrito/index.js"]._cached = module.exports; - return module.exports; -}; - -process.nextTick(function () { - var module = { exports : {} }; - var exports = module.exports; - var __dirname = "/"; - var __filename = "//home/substack/projects/node-burrito/example/web"; - - var require = function (file) { - return __require(file, "/"); - }; - require.modules = __require.modules; - - var burrito = require('burrito'); -var json = require('jsonify'); - -var src = [ - 'function f () { g() }', - 'function g () { h() }', - 'function h () { throw "moo" + Array(x).join("!") }', - 'var x = 4', - 'f()' -].join('\r\n'); - -window.onload = function () { - burrito(src, function (node) { - document.body.innerHTML += node.name + '
\n'; - }); -}; -if (document.readyState === 'complete') window.onload(); -; -}); diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/example/web/index.html b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/example/web/index.html deleted file mode 100644 index 66804fb..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/example/web/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - -

-
-
diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/example/web/main.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/example/web/main.js
deleted file mode 100644
index cc81a8b..0000000
--- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/example/web/main.js
+++ /dev/null
@@ -1,17 +0,0 @@
-var burrito = require('burrito');
-var json = require('jsonify');
-
-var src = [
-    'function f () { g() }',
-    'function g () { h() }',
-    'function h () { throw "moo" + Array(x).join("!") }',
-    'var x = 4',
-    'f()'
-].join('\r\n');
-
-window.onload = function () {
-    burrito(src, function (node) {
-        document.body.innerHTML += node.name + '
\n'; - }); -}; -if (document.readyState === 'complete') window.onload(); diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/example/web/server.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/example/web/server.js deleted file mode 100644 index 6bce020..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/example/web/server.js +++ /dev/null @@ -1,12 +0,0 @@ -var express = require('express'); -var browserify = require('browserify'); - -var app = express.createServer(); -app.use(express.static(__dirname)); -app.use(browserify({ - entry : __dirname + '/main.js', - watch : true, -})); - -app.listen(8081); -console.log('Listening on :8081'); diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/example/wrap.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/example/wrap.js deleted file mode 100644 index 1642401..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/example/wrap.js +++ /dev/null @@ -1,7 +0,0 @@ -var burrito = require('burrito'); - -var src = burrito('f() && g(h())\nfoo()', function (node) { - if (node.name === 'call') node.wrap('qqq(%s)'); -}); - -console.log(src); diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/index.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/index.js deleted file mode 100644 index 60ef569..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/index.js +++ /dev/null @@ -1,208 +0,0 @@ -var uglify = require('uglify-js'); -var parser = uglify.parser; -var parse = function (expr) { - if (typeof expr !== 'string') throw 'expression should be a string'; - - try { - var ast = parser.parse.apply(null, arguments); - } - catch (err) { - if (err.message === undefined - || err.line === undefined - || err.col === undefined - || err.pos === undefined - ) { throw err } - - var e = new SyntaxError( - err.message - + '\n at line ' + err.line + ':' + err.col + ' in expression:\n\n' - + ' ' + expr.split(/\r?\n/)[err.line] - ); - - e.original = err; - e.line = err.line; - e.col = err.col; - e.pos = err.pos; - throw e; - } - return ast; -}; - -var deparse = function (ast, b) { - return uglify.uglify.gen_code(ast, { beautify : b }); -}; - -var traverse = require('traverse'); -var vm = require('vm'); - -var burrito = module.exports = function (code, cb) { - var ast = Array_isArray(code) - ? code // already an ast - : parse(code.toString(), false, true) - ; - - var ast_ = traverse(ast).map(function mapper () { - wrapNode(this, cb); - }); - - return deparse(parse(deparse(ast_)), true); -}; - -var wrapNode = burrito.wrapNode = function (state, cb) { - var node = state.node; - - var ann = Array_isArray(node) && node[0] - && typeof node[0] === 'object' && node[0].name - ? node[0] - : null - ; - - if (!ann) return undefined; - - var self = { - name : ann.name, - node : node, - start : node[0].start, - end : node[0].end, - value : node.slice(1), - state : state - }; - - self.wrap = function (s) { - var subsrc = deparse( - traverse(node).map(function (x) { - if (!this.isRoot) wrapNode(this, cb) - }) - ); - - if (self.name === 'binary') { - var a = deparse(traverse(node[2]).map(function (x) { - if (!this.isRoot) wrapNode(this, cb) - })); - var b = deparse(traverse(node[3]).map(function (x) { - if (!this.isRoot) wrapNode(this, cb) - })); - } - - var src = ''; - - if (typeof s === 'function') { - if (self.name === 'binary') { - src = s(subsrc, a, b); - } - else { - src = s(subsrc); - } - } - else { - src = s.toString() - .replace(/%s/g, function () { - return subsrc - }) - ; - - if (self.name === 'binary') { - src = src - .replace(/%a/g, function () { return a }) - .replace(/%b/g, function () { return b }) - ; - } - } - - var expr = parse(src); - state.update(expr, true); - }; - - var cache = {}; - - self.parent = state.isRoot ? null : function () { - if (!cache.parent) { - var s = state; - var x; - do { - s = s.parent; - if (s) x = wrapNode(s); - } while (s && !x); - - cache.parent = x; - } - - return cache.parent; - }; - - self.source = function () { - if (!cache.source) cache.source = deparse(node); - return cache.source; - }; - - self.label = function () { - return burrito.label(self); - }; - - if (cb) cb.call(state, self); - - if (self.node[0].name === 'conditional') { - self.wrap('[%s][0]'); - } - - return self; -} - -burrito.microwave = function (code, context, cb) { - if (!cb) { cb = context; context = {} }; - if (!context) context = {}; - - var src = burrito(code, cb); - return vm.runInNewContext(src, context); -}; - -burrito.generateName = function (len) { - var name = ''; - var lower = '$'.charCodeAt(0); - var upper = 'z'.charCodeAt(0); - - while (name.length < len) { - var c = String.fromCharCode(Math.floor( - Math.random() * (upper - lower + 1) + lower - )); - if ((name + c).match(/^[A-Za-z_$][A-Za-z0-9_$]*$/)) name += c; - } - - return name; -}; - -burrito.parse = parse; -burrito.deparse = deparse; - -burrito.label = function (node) { - if (node.name === 'call') { - if (typeof node.value[0] === 'string') { - return node.value[0]; - } - else if (node.value[0] && typeof node.value[0][1] === 'string') { - return node.value[0][1]; - } - else if (node.value[0][0] === 'dot') { - return node.value[0][node.value[0].length - 1]; - } - else { - return null; - } - } - else if (node.name === 'var') { - return node.value[0].map(function (x) { return x[0] }); - } - else if (node.name === 'defun') { - return node.value[0]; - } - else if (node.name === 'function') { - return node.value[0]; - } - else { - return null; - } -}; - -var Array_isArray = Array.isArray || function isArray (xs) { - return Object.prototype.toString.call(xs) === '[object Array]'; -}; diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/.bin/uglifyjs b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/.bin/uglifyjs deleted file mode 100644 index 27606b8..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/.bin/uglifyjs +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -basedir=`dirname "$0"` - -case `uname` in - *CYGWIN*) basedir=`cygpath -w "$basedir"`;; -esac - -if [ -x "$basedir/node" ]; then - "$basedir/node" "$basedir/../uglify-js/bin/uglifyjs" "$@" - ret=$? -else - node "$basedir/../uglify-js/bin/uglifyjs" "$@" - ret=$? -fi -exit $ret diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/.bin/uglifyjs.cmd b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/.bin/uglifyjs.cmd deleted file mode 100644 index 88ff40f..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/.bin/uglifyjs.cmd +++ /dev/null @@ -1,5 +0,0 @@ -@IF EXIST "%~dp0\node.exe" ( - "%~dp0\node.exe" "%~dp0\..\uglify-js\bin\uglifyjs" %* -) ELSE ( - node "%~dp0\..\uglify-js\bin\uglifyjs" %* -) \ No newline at end of file diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/.npmignore b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/.npmignore deleted file mode 100644 index 3c3629e..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/LICENSE b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/LICENSE deleted file mode 100644 index 7b75500..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -Copyright 2010 James Halliday (mail@substack.net) - -This project is free software released under the MIT/X11 license: -http://www.opensource.org/licenses/mit-license.php - -Copyright 2010 James Halliday (mail@substack.net) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/README.markdown b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/README.markdown deleted file mode 100644 index f86ef76..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/README.markdown +++ /dev/null @@ -1,237 +0,0 @@ -traverse -======== - -Traverse and transform objects by visiting every node on a recursive walk. - -examples -======== - -transform negative numbers in-place ------------------------------------ - -negative.js - -````javascript -var traverse = require('traverse'); -var obj = [ 5, 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 } ]; - -traverse(obj).forEach(function (x) { - if (x < 0) this.update(x + 128); -}); - -console.dir(obj); -```` - -Output: - - [ 5, 6, 125, [ 7, 8, 126, 1 ], { f: 10, g: 115 } ] - -collect leaf nodes ------------------- - -leaves.js - -````javascript -var traverse = require('traverse'); - -var obj = { - a : [1,2,3], - b : 4, - c : [5,6], - d : { e : [7,8], f : 9 }, -}; - -var leaves = traverse(obj).reduce(function (acc, x) { - if (this.isLeaf) acc.push(x); - return acc; -}, []); - -console.dir(leaves); -```` - -Output: - - [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ] - -scrub circular references -------------------------- - -scrub.js: - -````javascript -var traverse = require('traverse'); - -var obj = { a : 1, b : 2, c : [ 3, 4 ] }; -obj.c.push(obj); - -var scrubbed = traverse(obj).map(function (x) { - if (this.circular) this.remove() -}); -console.dir(scrubbed); -```` - -output: - - { a: 1, b: 2, c: [ 3, 4 ] } - -context -======= - -Each method that takes a callback has a context (its `this` object) with these -attributes: - -this.node ---------- - -The present node on the recursive walk - -this.path ---------- - -An array of string keys from the root to the present node - -this.parent ------------ - -The context of the node's parent. -This is `undefined` for the root node. - -this.key --------- - -The name of the key of the present node in its parent. -This is `undefined` for the root node. - -this.isRoot, this.notRoot -------------------------- - -Whether the present node is the root node - -this.isLeaf, this.notLeaf -------------------------- - -Whether or not the present node is a leaf node (has no children) - -this.level ----------- - -Depth of the node within the traversal - -this.circular -------------- - -If the node equals one of its parents, the `circular` attribute is set to the -context of that parent and the traversal progresses no deeper. - -this.update(value, stopHere=false) ----------------------------------- - -Set a new value for the present node. - -All the elements in `value` will be recursively traversed unless `stopHere` is -true. - -this.remove(stopHere=false) -------------- - -Remove the current element from the output. If the node is in an Array it will -be spliced off. Otherwise it will be deleted from its parent. - -this.delete(stopHere=false) -------------- - -Delete the current element from its parent in the output. Calls `delete` even on -Arrays. - -this.before(fn) ---------------- - -Call this function before any of the children are traversed. - -You can assign into `this.keys` here to traverse in a custom order. - -this.after(fn) --------------- - -Call this function after any of the children are traversed. - -this.pre(fn) ------------- - -Call this function before each of the children are traversed. - -this.post(fn) -------------- - -Call this function after each of the children are traversed. - -methods -======= - -.map(fn) --------- - -Execute `fn` for each node in the object and return a new object with the -results of the walk. To update nodes in the result use `this.update(value)`. - -.forEach(fn) ------------- - -Execute `fn` for each node in the object but unlike `.map()`, when -`this.update()` is called it updates the object in-place. - -.reduce(fn, acc) ----------------- - -For each node in the object, perform a -[left-fold](http://en.wikipedia.org/wiki/Fold_(higher-order_function)) -with the return value of `fn(acc, node)`. - -If `acc` isn't specified, `acc` is set to the root object for the first step -and the root element is skipped. - -.paths() --------- - -Return an `Array` of every possible non-cyclic path in the object. -Paths are `Array`s of string keys. - -.nodes() --------- - -Return an `Array` of every node in the object. - -.clone() --------- - -Create a deep clone of the object. - -install -======= - -Using [npm](http://npmjs.org) do: - - $ npm install traverse - -test -==== - -Using [expresso](http://github.com/visionmedia/expresso) do: - - $ expresso - - 100% wahoo, your stuff is not broken! - -in the browser -============== - -Use [browserify](https://github.com/substack/node-browserify) to run traverse in -the browser. - -traverse has been tested and works with: - -* Internet Explorer 5.5, 6.0, 7.0, 8.0, 9.0 -* Firefox 3.5 -* Chrome 6.0 -* Opera 10.6 -* Safari 5.0 diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/examples/json.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/examples/json.js deleted file mode 100644 index 50d612e..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/examples/json.js +++ /dev/null @@ -1,16 +0,0 @@ -var traverse = require('traverse'); - -var id = 54; -var callbacks = {}; -var obj = { moo : function () {}, foo : [2,3,4, function () {}] }; - -var scrubbed = traverse(obj).map(function (x) { - if (typeof x === 'function') { - callbacks[id] = { id : id, f : x, path : this.path }; - this.update('[Function]'); - id++; - } -}); - -console.dir(scrubbed); -console.dir(callbacks); diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/examples/leaves.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/examples/leaves.js deleted file mode 100644 index c1b310b..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/examples/leaves.js +++ /dev/null @@ -1,15 +0,0 @@ -var traverse = require('traverse'); - -var obj = { - a : [1,2,3], - b : 4, - c : [5,6], - d : { e : [7,8], f : 9 }, -}; - -var leaves = traverse(obj).reduce(function (acc, x) { - if (this.isLeaf) acc.push(x); - return acc; -}, []); - -console.dir(leaves); diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/examples/negative.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/examples/negative.js deleted file mode 100644 index 78608a0..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/examples/negative.js +++ /dev/null @@ -1,8 +0,0 @@ -var traverse = require('traverse'); -var obj = [ 5, 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 } ]; - -traverse(obj).forEach(function (x) { - if (x < 0) this.update(x + 128); -}); - -console.dir(obj); diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/examples/scrub.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/examples/scrub.js deleted file mode 100644 index 5d15b91..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/examples/scrub.js +++ /dev/null @@ -1,10 +0,0 @@ -// scrub out circular references -var traverse = require('traverse'); - -var obj = { a : 1, b : 2, c : [ 3, 4 ] }; -obj.c.push(obj); - -var scrubbed = traverse(obj).map(function (x) { - if (this.circular) this.remove() -}); -console.dir(scrubbed); diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/examples/stringify.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/examples/stringify.js deleted file mode 100644 index 167b68b..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/examples/stringify.js +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env node -var traverse = require('traverse'); - -var obj = [ 'five', 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 } ]; - -var s = ''; -traverse(obj).forEach(function to_s (node) { - if (Array.isArray(node)) { - this.before(function () { s += '[' }); - this.post(function (child) { - if (!child.isLast) s += ','; - }); - this.after(function () { s += ']' }); - } - else if (typeof node == 'object') { - this.before(function () { s += '{' }); - this.pre(function (x, key) { - to_s(key); - s += ':'; - }); - this.post(function (child) { - if (!child.isLast) s += ','; - }); - this.after(function () { s += '}' }); - } - else if (typeof node == 'string') { - s += '"' + node.toString().replace(/"/g, '\\"') + '"'; - } - else if (typeof node == 'function') { - s += 'null'; - } - else { - s += node.toString(); - } -}); - -console.log('JSON.stringify: ' + JSON.stringify(obj)); -console.log('this stringify: ' + s); diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/index.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/index.js deleted file mode 100644 index 038a1ad..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/index.js +++ /dev/null @@ -1,267 +0,0 @@ -module.exports = Traverse; -function Traverse (obj) { - if (!(this instanceof Traverse)) return new Traverse(obj); - this.value = obj; -} - -Traverse.prototype.get = function (ps) { - var node = this.value; - for (var i = 0; i < ps.length; i ++) { - var key = ps[i]; - if (!Object.hasOwnProperty.call(node, key)) { - node = undefined; - break; - } - node = node[key]; - } - return node; -}; - -Traverse.prototype.set = function (ps, value) { - var node = this.value; - for (var i = 0; i < ps.length - 1; i ++) { - var key = ps[i]; - if (!Object.hasOwnProperty.call(node, key)) node[key] = {}; - node = node[key]; - } - node[ps[i]] = value; - return value; -}; - -Traverse.prototype.map = function (cb) { - return walk(this.value, cb, true); -}; - -Traverse.prototype.forEach = function (cb) { - this.value = walk(this.value, cb, false); - return this.value; -}; - -Traverse.prototype.reduce = function (cb, init) { - var skip = arguments.length === 1; - var acc = skip ? this.value : init; - this.forEach(function (x) { - if (!this.isRoot || !skip) { - acc = cb.call(this, acc, x); - } - }); - return acc; -}; - -Traverse.prototype.paths = function () { - var acc = []; - this.forEach(function (x) { - acc.push(this.path); - }); - return acc; -}; - -Traverse.prototype.nodes = function () { - var acc = []; - this.forEach(function (x) { - acc.push(this.node); - }); - return acc; -}; - -Traverse.prototype.clone = function () { - var parents = [], nodes = []; - - return (function clone (src) { - for (var i = 0; i < parents.length; i++) { - if (parents[i] === src) { - return nodes[i]; - } - } - - if (typeof src === 'object' && src !== null) { - var dst = copy(src); - - parents.push(src); - nodes.push(dst); - - forEach(Object_keys(src), function (key) { - dst[key] = clone(src[key]); - }); - - parents.pop(); - nodes.pop(); - return dst; - } - else { - return src; - } - })(this.value); -}; - -function walk (root, cb, immutable) { - var path = []; - var parents = []; - var alive = true; - - return (function walker (node_) { - var node = immutable ? copy(node_) : node_; - var modifiers = {}; - - var keepGoing = true; - - var state = { - node : node, - node_ : node_, - path : [].concat(path), - parent : parents[parents.length - 1], - parents : parents, - key : path.slice(-1)[0], - isRoot : path.length === 0, - level : path.length, - circular : null, - update : function (x, stopHere) { - if (!state.isRoot) { - state.parent.node[state.key] = x; - } - state.node = x; - if (stopHere) keepGoing = false; - }, - 'delete' : function (stopHere) { - delete state.parent.node[state.key]; - if (stopHere) keepGoing = false; - }, - remove : function (stopHere) { - if (Array_isArray(state.parent.node)) { - state.parent.node.splice(state.key, 1); - } - else { - delete state.parent.node[state.key]; - } - if (stopHere) keepGoing = false; - }, - keys : null, - before : function (f) { modifiers.before = f }, - after : function (f) { modifiers.after = f }, - pre : function (f) { modifiers.pre = f }, - post : function (f) { modifiers.post = f }, - stop : function () { alive = false }, - block : function () { keepGoing = false } - }; - - if (!alive) return state; - - if (typeof node === 'object' && node !== null) { - state.keys = Object_keys(node); - - state.isLeaf = state.keys.length == 0; - - for (var i = 0; i < parents.length; i++) { - if (parents[i].node_ === node_) { - state.circular = parents[i]; - break; - } - } - } - else { - state.isLeaf = true; - } - - state.notLeaf = !state.isLeaf; - state.notRoot = !state.isRoot; - - // use return values to update if defined - var ret = cb.call(state, state.node); - if (ret !== undefined && state.update) state.update(ret); - - if (modifiers.before) modifiers.before.call(state, state.node); - - if (!keepGoing) return state; - - if (typeof state.node == 'object' - && state.node !== null && !state.circular) { - parents.push(state); - - forEach(state.keys, function (key, i) { - path.push(key); - - if (modifiers.pre) modifiers.pre.call(state, state.node[key], key); - - var child = walker(state.node[key]); - if (immutable && Object.hasOwnProperty.call(state.node, key)) { - state.node[key] = child.node; - } - - child.isLast = i == state.keys.length - 1; - child.isFirst = i == 0; - - if (modifiers.post) modifiers.post.call(state, child); - - path.pop(); - }); - parents.pop(); - } - - if (modifiers.after) modifiers.after.call(state, state.node); - - return state; - })(root).node; -} - -function copy (src) { - if (typeof src === 'object' && src !== null) { - var dst; - - if (Array_isArray(src)) { - dst = []; - } - else if (src instanceof Date) { - dst = new Date(src); - } - else if (src instanceof Boolean) { - dst = new Boolean(src); - } - else if (src instanceof Number) { - dst = new Number(src); - } - else if (src instanceof String) { - dst = new String(src); - } - else if (Object.create && Object.getPrototypeOf) { - dst = Object.create(Object.getPrototypeOf(src)); - } - else if (src.__proto__ || src.constructor.prototype) { - var proto = src.__proto__ || src.constructor.prototype || {}; - var T = function () {}; - T.prototype = proto; - dst = new T; - if (!dst.__proto__) dst.__proto__ = proto; - } - - forEach(Object_keys(src), function (key) { - dst[key] = src[key]; - }); - return dst; - } - else return src; -} - -var Object_keys = Object.keys || function keys (obj) { - var res = []; - for (var key in obj) res.push(key) - return res; -}; - -var Array_isArray = Array.isArray || function isArray (xs) { - return Object.prototype.toString.call(xs) === '[object Array]'; -}; - -var forEach = function (xs, fn) { - if (xs.forEach) return xs.forEach(fn) - else for (var i = 0; i < xs.length; i++) { - fn(xs[i], i, xs); - } -}; - -forEach(Object_keys(Traverse.prototype), function (key) { - Traverse[key] = function (obj) { - var args = [].slice.call(arguments, 1); - var t = Traverse(obj); - return t[key].apply(t, args); - }; -}); diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/main.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/main.js deleted file mode 100644 index d562d37..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/main.js +++ /dev/null @@ -1,10 +0,0 @@ -// scrub out circular references -var traverse = require('./index.js'); - -var obj = { a : 1, b : 2, c : [ 3, 4 ] }; -obj.c.push(obj); - -var scrubbed = traverse(obj).map(function (x) { - if (this.circular) this.remove() -}); -console.dir(scrubbed); diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/package.json b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/package.json deleted file mode 100644 index c55d2d6..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "traverse", - "version": "0.5.2", - "description": "Traverse and transform objects by visiting every node on a recursive walk", - "author": { - "name": "James Halliday" - }, - "license": "MIT/X11", - "main": "./index", - "repository": { - "type": "git", - "url": "http://github.com/substack/js-traverse.git" - }, - "devDependencies": { - "expresso": "0.7.x" - }, - "scripts": { - "test": "expresso" - }, - "readme": "traverse\n========\n\nTraverse and transform objects by visiting every node on a recursive walk.\n\nexamples\n========\n\ntransform negative numbers in-place\n-----------------------------------\n\nnegative.js\n\n````javascript\nvar traverse = require('traverse');\nvar obj = [ 5, 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 } ];\n\ntraverse(obj).forEach(function (x) {\n if (x < 0) this.update(x + 128);\n});\n\nconsole.dir(obj);\n````\n\nOutput:\n\n [ 5, 6, 125, [ 7, 8, 126, 1 ], { f: 10, g: 115 } ]\n\ncollect leaf nodes\n------------------\n\nleaves.js\n\n````javascript\nvar traverse = require('traverse');\n\nvar obj = {\n a : [1,2,3],\n b : 4,\n c : [5,6],\n d : { e : [7,8], f : 9 },\n};\n\nvar leaves = traverse(obj).reduce(function (acc, x) {\n if (this.isLeaf) acc.push(x);\n return acc;\n}, []);\n\nconsole.dir(leaves);\n````\n\nOutput:\n\n [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ]\n\nscrub circular references\n-------------------------\n\nscrub.js:\n\n````javascript\nvar traverse = require('traverse');\n\nvar obj = { a : 1, b : 2, c : [ 3, 4 ] };\nobj.c.push(obj);\n\nvar scrubbed = traverse(obj).map(function (x) {\n if (this.circular) this.remove()\n});\nconsole.dir(scrubbed);\n````\n\noutput:\n\n { a: 1, b: 2, c: [ 3, 4 ] }\n\ncontext\n=======\n\nEach method that takes a callback has a context (its `this` object) with these\nattributes:\n\nthis.node\n---------\n\nThe present node on the recursive walk\n\nthis.path\n---------\n\nAn array of string keys from the root to the present node\n\nthis.parent\n-----------\n\nThe context of the node's parent.\nThis is `undefined` for the root node.\n\nthis.key\n--------\n\nThe name of the key of the present node in its parent.\nThis is `undefined` for the root node.\n\nthis.isRoot, this.notRoot\n-------------------------\n\nWhether the present node is the root node\n\nthis.isLeaf, this.notLeaf\n-------------------------\n\nWhether or not the present node is a leaf node (has no children)\n\nthis.level\n----------\n\nDepth of the node within the traversal\n\nthis.circular\n-------------\n\nIf the node equals one of its parents, the `circular` attribute is set to the\ncontext of that parent and the traversal progresses no deeper.\n\nthis.update(value, stopHere=false)\n----------------------------------\n\nSet a new value for the present node.\n\nAll the elements in `value` will be recursively traversed unless `stopHere` is\ntrue.\n\nthis.remove(stopHere=false)\n-------------\n\nRemove the current element from the output. If the node is in an Array it will\nbe spliced off. Otherwise it will be deleted from its parent.\n\nthis.delete(stopHere=false)\n-------------\n\nDelete the current element from its parent in the output. Calls `delete` even on\nArrays.\n\nthis.before(fn)\n---------------\n\nCall this function before any of the children are traversed.\n\nYou can assign into `this.keys` here to traverse in a custom order.\n\nthis.after(fn)\n--------------\n\nCall this function after any of the children are traversed.\n\nthis.pre(fn)\n------------\n\nCall this function before each of the children are traversed.\n\nthis.post(fn)\n-------------\n\nCall this function after each of the children are traversed.\n\nmethods\n=======\n\n.map(fn)\n--------\n\nExecute `fn` for each node in the object and return a new object with the\nresults of the walk. To update nodes in the result use `this.update(value)`.\n\n.forEach(fn)\n------------\n\nExecute `fn` for each node in the object but unlike `.map()`, when\n`this.update()` is called it updates the object in-place.\n\n.reduce(fn, acc)\n----------------\n\nFor each node in the object, perform a\n[left-fold](http://en.wikipedia.org/wiki/Fold_(higher-order_function))\nwith the return value of `fn(acc, node)`.\n\nIf `acc` isn't specified, `acc` is set to the root object for the first step\nand the root element is skipped.\n\n.paths()\n--------\n\nReturn an `Array` of every possible non-cyclic path in the object.\nPaths are `Array`s of string keys.\n\n.nodes()\n--------\n\nReturn an `Array` of every node in the object.\n\n.clone()\n--------\n\nCreate a deep clone of the object.\n\ninstall\n=======\n\nUsing [npm](http://npmjs.org) do:\n\n $ npm install traverse\n\ntest\n====\n\nUsing [expresso](http://github.com/visionmedia/expresso) do:\n\n $ expresso\n \n 100% wahoo, your stuff is not broken!\n\nin the browser\n==============\n\nUse [browserify](https://github.com/substack/node-browserify) to run traverse in\nthe browser.\n\ntraverse has been tested and works with:\n\n* Internet Explorer 5.5, 6.0, 7.0, 8.0, 9.0\n* Firefox 3.5\n* Chrome 6.0\n* Opera 10.6\n* Safari 5.0\n", - "readmeFilename": "README.markdown", - "_id": "traverse@0.5.2", - "_from": "traverse@~0.5.1" -} diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/circular.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/circular.js deleted file mode 100644 index 9162601..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/circular.js +++ /dev/null @@ -1,115 +0,0 @@ -var assert = require('assert'); -var Traverse = require('../'); -var deepEqual = require('./lib/deep_equal'); -var util = require('util'); - -exports.circular = function () { - var obj = { x : 3 }; - obj.y = obj; - var foundY = false; - Traverse(obj).forEach(function (x) { - if (this.path.join('') == 'y') { - assert.equal( - util.inspect(this.circular.node), - util.inspect(obj) - ); - foundY = true; - } - }); - assert.ok(foundY); -}; - -exports.deepCirc = function () { - var obj = { x : [ 1, 2, 3 ], y : [ 4, 5 ] }; - obj.y[2] = obj; - - var times = 0; - Traverse(obj).forEach(function (x) { - if (this.circular) { - assert.deepEqual(this.circular.path, []); - assert.deepEqual(this.path, [ 'y', 2 ]); - times ++; - } - }); - - assert.deepEqual(times, 1); -}; - -exports.doubleCirc = function () { - var obj = { x : [ 1, 2, 3 ], y : [ 4, 5 ] }; - obj.y[2] = obj; - obj.x.push(obj.y); - - var circs = []; - Traverse(obj).forEach(function (x) { - if (this.circular) { - circs.push({ circ : this.circular, self : this, node : x }); - } - }); - - assert.deepEqual(circs[0].self.path, [ 'x', 3, 2 ]); - assert.deepEqual(circs[0].circ.path, []); - - assert.deepEqual(circs[1].self.path, [ 'y', 2 ]); - assert.deepEqual(circs[1].circ.path, []); - - assert.deepEqual(circs.length, 2); -}; - -exports.circDubForEach = function () { - var obj = { x : [ 1, 2, 3 ], y : [ 4, 5 ] }; - obj.y[2] = obj; - obj.x.push(obj.y); - - Traverse(obj).forEach(function (x) { - if (this.circular) this.update('...'); - }); - - assert.deepEqual(obj, { x : [ 1, 2, 3, [ 4, 5, '...' ] ], y : [ 4, 5, '...' ] }); -}; - -exports.circDubMap = function () { - var obj = { x : [ 1, 2, 3 ], y : [ 4, 5 ] }; - obj.y[2] = obj; - obj.x.push(obj.y); - - var c = Traverse(obj).map(function (x) { - if (this.circular) { - this.update('...'); - } - }); - - assert.deepEqual(c, { x : [ 1, 2, 3, [ 4, 5, '...' ] ], y : [ 4, 5, '...' ] }); -}; - -exports.circClone = function () { - var obj = { x : [ 1, 2, 3 ], y : [ 4, 5 ] }; - obj.y[2] = obj; - obj.x.push(obj.y); - - var clone = Traverse.clone(obj); - assert.ok(obj !== clone); - - assert.ok(clone.y[2] === clone); - assert.ok(clone.y[2] !== obj); - assert.ok(clone.x[3][2] === clone); - assert.ok(clone.x[3][2] !== obj); - assert.deepEqual(clone.x.slice(0,3), [1,2,3]); - assert.deepEqual(clone.y.slice(0,2), [4,5]); -}; - -exports.circMapScrub = function () { - var obj = { a : 1, b : 2 }; - obj.c = obj; - - var scrubbed = Traverse(obj).map(function (node) { - if (this.circular) this.remove(); - }); - assert.deepEqual( - Object.keys(scrubbed).sort(), - [ 'a', 'b' ] - ); - assert.ok(deepEqual(scrubbed, { a : 1, b : 2 })); - - assert.equal(obj.c, obj); -}; diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/date.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/date.js deleted file mode 100644 index 4ca06dc..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/date.js +++ /dev/null @@ -1,35 +0,0 @@ -var assert = require('assert'); -var Traverse = require('../'); - -exports.dateEach = function () { - var obj = { x : new Date, y : 10, z : 5 }; - - var counts = {}; - - Traverse(obj).forEach(function (node) { - var t = (node instanceof Date && 'Date') || typeof node; - counts[t] = (counts[t] || 0) + 1; - }); - - assert.deepEqual(counts, { - object : 1, - Date : 1, - number : 2, - }); -}; - -exports.dateMap = function () { - var obj = { x : new Date, y : 10, z : 5 }; - - var res = Traverse(obj).map(function (node) { - if (typeof node === 'number') this.update(node + 100); - }); - - assert.ok(obj.x !== res.x); - assert.deepEqual(res, { - x : obj.x, - y : 110, - z : 105, - }); -}; - diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/equal.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/equal.js deleted file mode 100644 index decc755..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/equal.js +++ /dev/null @@ -1,220 +0,0 @@ -var assert = require('assert'); -var traverse = require('../'); -var deepEqual = require('./lib/deep_equal'); - -exports.deepDates = function () { - assert.ok( - deepEqual( - { d : new Date, x : [ 1, 2, 3 ] }, - { d : new Date, x : [ 1, 2, 3 ] } - ), - 'dates should be equal' - ); - - var d0 = new Date; - setTimeout(function () { - assert.ok( - !deepEqual( - { d : d0, x : [ 1, 2, 3 ], }, - { d : new Date, x : [ 1, 2, 3 ] } - ), - 'microseconds should count in date equality' - ); - }, 5); -}; - -exports.deepCircular = function () { - var a = [1]; - a.push(a); // a = [ 1, *a ] - - var b = [1]; - b.push(a); // b = [ 1, [ 1, *a ] ] - - assert.ok( - !deepEqual(a, b), - 'circular ref mount points count towards equality' - ); - - var c = [1]; - c.push(c); // c = [ 1, *c ] - assert.ok( - deepEqual(a, c), - 'circular refs are structurally the same here' - ); - - var d = [1]; - d.push(a); // c = [ 1, [ 1, *d ] ] - assert.ok( - deepEqual(b, d), - 'non-root circular ref structural comparison' - ); -}; - -exports.deepInstances = function () { - assert.ok( - !deepEqual([ new Boolean(false) ], [ false ]), - 'boolean instances are not real booleans' - ); - - assert.ok( - !deepEqual([ new String('x') ], [ 'x' ]), - 'string instances are not real strings' - ); - - assert.ok( - !deepEqual([ new Number(4) ], [ 4 ]), - 'number instances are not real numbers' - ); - - assert.ok( - deepEqual([ new RegExp('x') ], [ /x/ ]), - 'regexp instances are real regexps' - ); - - assert.ok( - !deepEqual([ new RegExp(/./) ], [ /../ ]), - 'these regexps aren\'t the same' - ); - - assert.ok( - !deepEqual( - [ function (x) { return x * 2 } ], - [ function (x) { return x * 2 } ] - ), - 'functions with the same .toString() aren\'t necessarily the same' - ); - - var f = function (x) { return x * 2 }; - assert.ok( - deepEqual([ f ], [ f ]), - 'these functions are actually equal' - ); -}; - -exports.deepEqual = function () { - assert.ok( - !deepEqual([ 1, 2, 3 ], { 0 : 1, 1 : 2, 2 : 3 }), - 'arrays are not objects' - ); -}; - -exports.falsy = function () { - assert.ok( - !deepEqual([ undefined ], [ null ]), - 'null is not undefined!' - ); - - assert.ok( - !deepEqual([ null ], [ undefined ]), - 'undefined is not null!' - ); - - assert.ok( - !deepEqual( - { a : 1, b : 2, c : [ 3, undefined, 5 ] }, - { a : 1, b : 2, c : [ 3, null, 5 ] } - ), - 'undefined is not null, however deeply!' - ); - - assert.ok( - !deepEqual( - { a : 1, b : 2, c : [ 3, undefined, 5 ] }, - { a : 1, b : 2, c : [ 3, null, 5 ] } - ), - 'null is not undefined, however deeply!' - ); - - assert.ok( - !deepEqual( - { a : 1, b : 2, c : [ 3, undefined, 5 ] }, - { a : 1, b : 2, c : [ 3, null, 5 ] } - ), - 'null is not undefined, however deeply!' - ); -}; - -exports.deletedArrayEqual = function () { - var xs = [ 1, 2, 3, 4 ]; - delete xs[2]; - - var ys = Object.create(Array.prototype); - ys[0] = 1; - ys[1] = 2; - ys[3] = 4; - - assert.ok( - deepEqual(xs, ys), - 'arrays with deleted elements are only equal to' - + ' arrays with similarly deleted elements' - ); - - assert.ok( - !deepEqual(xs, [ 1, 2, undefined, 4 ]), - 'deleted array elements cannot be undefined' - ); - - assert.ok( - !deepEqual(xs, [ 1, 2, null, 4 ]), - 'deleted array elements cannot be null' - ); -}; - -exports.deletedObjectEqual = function () { - var obj = { a : 1, b : 2, c : 3 }; - delete obj.c; - - assert.ok( - deepEqual(obj, { a : 1, b : 2 }), - 'deleted object elements should not show up' - ); - - assert.ok( - !deepEqual(obj, { a : 1, b : 2, c : undefined }), - 'deleted object elements are not undefined' - ); - - assert.ok( - !deepEqual(obj, { a : 1, b : 2, c : null }), - 'deleted object elements are not null' - ); -}; - -exports.emptyKeyEqual = function () { - assert.ok(!deepEqual( - { a : 1 }, { a : 1, '' : 55 } - )); -}; - -exports.deepArguments = function () { - assert.ok( - !deepEqual( - [ 4, 5, 6 ], - (function () { return arguments })(4, 5, 6) - ), - 'arguments are not arrays' - ); - - assert.ok( - deepEqual( - (function () { return arguments })(4, 5, 6), - (function () { return arguments })(4, 5, 6) - ), - 'arguments should equal' - ); -}; - -exports.deepUn = function () { - assert.ok(!deepEqual({ a : 1, b : 2 }, undefined)); - assert.ok(!deepEqual({ a : 1, b : 2 }, {})); - assert.ok(!deepEqual(undefined, { a : 1, b : 2 })); - assert.ok(!deepEqual({}, { a : 1, b : 2 })); - assert.ok(deepEqual(undefined, undefined)); - assert.ok(deepEqual(null, null)); - assert.ok(!deepEqual(undefined, null)); -}; - -exports.deepLevels = function () { - var xs = [ 1, 2, [ 3, 4, [ 5, 6 ] ] ]; - assert.ok(!deepEqual(xs, [])); -}; diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/instance.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/instance.js deleted file mode 100644 index 8d73525..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/instance.js +++ /dev/null @@ -1,17 +0,0 @@ -var assert = require('assert'); -var Traverse = require('../'); -var EventEmitter = require('events').EventEmitter; - -exports['check instanceof on node elems'] = function () { - - var counts = { emitter : 0 }; - - Traverse([ new EventEmitter, 3, 4, { ev : new EventEmitter }]) - .forEach(function (node) { - if (node instanceof EventEmitter) counts.emitter ++; - }) - ; - - assert.equal(counts.emitter, 2); -}; - diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/interface.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/interface.js deleted file mode 100644 index fce5bf9..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/interface.js +++ /dev/null @@ -1,42 +0,0 @@ -var assert = require('assert'); -var Traverse = require('../'); - -exports['interface map'] = function () { - var obj = { a : [ 5,6,7 ], b : { c : [8] } }; - - assert.deepEqual( - Traverse.paths(obj) - .sort() - .map(function (path) { return path.join('/') }) - .slice(1) - .join(' ') - , - 'a a/0 a/1 a/2 b b/c b/c/0' - ); - - assert.deepEqual( - Traverse.nodes(obj), - [ - { a: [ 5, 6, 7 ], b: { c: [ 8 ] } }, - [ 5, 6, 7 ], 5, 6, 7, - { c: [ 8 ] }, [ 8 ], 8 - ] - ); - - assert.deepEqual( - Traverse.map(obj, function (node) { - if (typeof node == 'number') { - return node + 1000; - } - else if (Array.isArray(node)) { - return node.join(' '); - } - }), - { a: '5 6 7', b: { c: '8' } } - ); - - var nodes = 0; - Traverse.forEach(obj, function (node) { nodes ++ }); - assert.deepEqual(nodes, 8); -}; - diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/json.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/json.js deleted file mode 100644 index 0a04529..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/json.js +++ /dev/null @@ -1,47 +0,0 @@ -var assert = require('assert'); -var Traverse = require('../'); - -exports['json test'] = function () { - var id = 54; - var callbacks = {}; - var obj = { moo : function () {}, foo : [2,3,4, function () {}] }; - - var scrubbed = Traverse(obj).map(function (x) { - if (typeof x === 'function') { - callbacks[id] = { id : id, f : x, path : this.path }; - this.update('[Function]'); - id++; - } - }); - - assert.equal( - scrubbed.moo, '[Function]', - 'obj.moo replaced with "[Function]"' - ); - - assert.equal( - scrubbed.foo[3], '[Function]', - 'obj.foo[3] replaced with "[Function]"' - ); - - assert.deepEqual(scrubbed, { - moo : '[Function]', - foo : [ 2, 3, 4, "[Function]" ] - }, 'Full JSON string matches'); - - assert.deepEqual( - typeof obj.moo, 'function', - 'Original obj.moo still a function' - ); - - assert.deepEqual( - typeof obj.foo[3], 'function', - 'Original obj.foo[3] still a function' - ); - - assert.deepEqual(callbacks, { - 54: { id: 54, f : obj.moo, path: [ 'moo' ] }, - 55: { id: 55, f : obj.foo[3], path: [ 'foo', '3' ] }, - }, 'Check the generated callbacks list'); -}; - diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/keys.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/keys.js deleted file mode 100644 index 7ecd545..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/keys.js +++ /dev/null @@ -1,29 +0,0 @@ -var assert = require('assert'); -var Traverse = require('../'); - -exports['sort test'] = function () { - var acc = []; - Traverse({ - a: 30, - b: 22, - id: 9 - }).forEach(function (node) { - if ((! Array.isArray(node)) && typeof node === 'object') { - this.before(function(node) { - this.keys = Object.keys(node); - this.keys.sort(function(a, b) { - a = [a === "id" ? 0 : 1, a]; - b = [b === "id" ? 0 : 1, b]; - return a < b ? -1 : a > b ? 1 : 0; - }); - }); - } - if (this.isLeaf) acc.push(node); - }); - - assert.equal( - acc.join(' '), - '9 30 22', - 'Traversal in a custom order' - ); -}; diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/leaves.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/leaves.js deleted file mode 100644 index e520b72..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/leaves.js +++ /dev/null @@ -1,21 +0,0 @@ -var assert = require('assert'); -var Traverse = require('../'); - -exports['leaves test'] = function () { - var acc = []; - Traverse({ - a : [1,2,3], - b : 4, - c : [5,6], - d : { e : [7,8], f : 9 } - }).forEach(function (x) { - if (this.isLeaf) acc.push(x); - }); - - assert.equal( - acc.join(' '), - '1 2 3 4 5 6 7 8 9', - 'Traversal in the right(?) order' - ); -}; - diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/lib/deep_equal.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/lib/deep_equal.js deleted file mode 100644 index 4fa07bb..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/lib/deep_equal.js +++ /dev/null @@ -1,92 +0,0 @@ -var traverse = require('../../'); - -module.exports = function (a, b) { - if (arguments.length !== 2) { - throw new Error( - 'deepEqual requires exactly two objects to compare against' - ); - } - - var equal = true; - var node = b; - - traverse(a).forEach(function (y) { - var notEqual = (function () { - equal = false; - //this.stop(); - return undefined; - }).bind(this); - - //if (node === undefined || node === null) return notEqual(); - - if (!this.isRoot) { - /* - if (!Object.hasOwnProperty.call(node, this.key)) { - return notEqual(); - } - */ - if (typeof node !== 'object') return notEqual(); - node = node[this.key]; - } - - var x = node; - - this.post(function () { - node = x; - }); - - var toS = function (o) { - return Object.prototype.toString.call(o); - }; - - if (this.circular) { - if (traverse(b).get(this.circular.path) !== x) notEqual(); - } - else if (typeof x !== typeof y) { - notEqual(); - } - else if (x === null || y === null || x === undefined || y === undefined) { - if (x !== y) notEqual(); - } - else if (x.__proto__ !== y.__proto__) { - notEqual(); - } - else if (x === y) { - // nop - } - else if (typeof x === 'function') { - if (x instanceof RegExp) { - // both regexps on account of the __proto__ check - if (x.toString() != y.toString()) notEqual(); - } - else if (x !== y) notEqual(); - } - else if (typeof x === 'object') { - if (toS(y) === '[object Arguments]' - || toS(x) === '[object Arguments]') { - if (toS(x) !== toS(y)) { - notEqual(); - } - } - else if (x instanceof Date || y instanceof Date) { - if (!(x instanceof Date) || !(y instanceof Date) - || x.getTime() !== y.getTime()) { - notEqual(); - } - } - else { - var kx = Object.keys(x); - var ky = Object.keys(y); - if (kx.length !== ky.length) return notEqual(); - for (var i = 0; i < kx.length; i++) { - var k = kx[i]; - if (!Object.hasOwnProperty.call(y, k)) { - notEqual(); - } - } - } - } - }); - - return equal; -}; diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/mutability.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/mutability.js deleted file mode 100644 index 2236f56..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/mutability.js +++ /dev/null @@ -1,252 +0,0 @@ -var assert = require('assert'); -var Traverse = require('../'); -var deepEqual = require('./lib/deep_equal'); - -exports.mutate = function () { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - var res = Traverse(obj).forEach(function (x) { - if (typeof x === 'number' && x % 2 === 0) { - this.update(x * 10); - } - }); - assert.deepEqual(obj, res); - assert.deepEqual(obj, { a : 1, b : 20, c : [ 3, 40 ] }); -}; - -exports.mutateT = function () { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - var res = Traverse.forEach(obj, function (x) { - if (typeof x === 'number' && x % 2 === 0) { - this.update(x * 10); - } - }); - assert.deepEqual(obj, res); - assert.deepEqual(obj, { a : 1, b : 20, c : [ 3, 40 ] }); -}; - -exports.map = function () { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - var res = Traverse(obj).map(function (x) { - if (typeof x === 'number' && x % 2 === 0) { - this.update(x * 10); - } - }); - assert.deepEqual(obj, { a : 1, b : 2, c : [ 3, 4 ] }); - assert.deepEqual(res, { a : 1, b : 20, c : [ 3, 40 ] }); -}; - -exports.mapT = function () { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - var res = Traverse.map(obj, function (x) { - if (typeof x === 'number' && x % 2 === 0) { - this.update(x * 10); - } - }); - assert.deepEqual(obj, { a : 1, b : 2, c : [ 3, 4 ] }); - assert.deepEqual(res, { a : 1, b : 20, c : [ 3, 40 ] }); -}; - -exports.clone = function () { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - var res = Traverse(obj).clone(); - assert.deepEqual(obj, res); - assert.ok(obj !== res); - obj.a ++; - assert.deepEqual(res.a, 1); - obj.c.push(5); - assert.deepEqual(res.c, [ 3, 4 ]); -}; - -exports.cloneT = function () { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - var res = Traverse.clone(obj); - assert.deepEqual(obj, res); - assert.ok(obj !== res); - obj.a ++; - assert.deepEqual(res.a, 1); - obj.c.push(5); - assert.deepEqual(res.c, [ 3, 4 ]); -}; - -exports.reduce = function () { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - var res = Traverse(obj).reduce(function (acc, x) { - if (this.isLeaf) acc.push(x); - return acc; - }, []); - assert.deepEqual(obj, { a : 1, b : 2, c : [ 3, 4 ] }); - assert.deepEqual(res, [ 1, 2, 3, 4 ]); -}; - -exports.reduceInit = function () { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - var res = Traverse(obj).reduce(function (acc, x) { - if (this.isRoot) assert.fail('got root'); - return acc; - }); - assert.deepEqual(obj, { a : 1, b : 2, c : [ 3, 4 ] }); - assert.deepEqual(res, obj); -}; - -exports.remove = function () { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - Traverse(obj).forEach(function (x) { - if (this.isLeaf && x % 2 == 0) this.remove(); - }); - - assert.deepEqual(obj, { a : 1, c : [ 3 ] }); -}; - -exports.removeNoStop = function() { - var obj = { a : 1, b : 2, c : { d: 3, e: 4 }, f: 5 }; - - var keys = []; - Traverse(obj).forEach(function (x) { - keys.push(this.key) - if (this.key == 'c') this.remove(); - }); - - assert.deepEqual(keys, [undefined, 'a', 'b', 'c', 'd', 'e', 'f']) -} - -exports.removeStop = function() { - var obj = { a : 1, b : 2, c : { d: 3, e: 4 }, f: 5 }; - - var keys = []; - Traverse(obj).forEach(function (x) { - keys.push(this.key) - if (this.key == 'c') this.remove(true); - }); - - assert.deepEqual(keys, [undefined, 'a', 'b', 'c', 'f']) -} - -exports.removeMap = function () { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - var res = Traverse(obj).map(function (x) { - if (this.isLeaf && x % 2 == 0) this.remove(); - }); - - assert.deepEqual(obj, { a : 1, b : 2, c : [ 3, 4 ] }); - assert.deepEqual(res, { a : 1, c : [ 3 ] }); -}; - -exports.delete = function () { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - Traverse(obj).forEach(function (x) { - if (this.isLeaf && x % 2 == 0) this.delete(); - }); - - assert.ok(!deepEqual( - obj, { a : 1, c : [ 3, undefined ] } - )); - - assert.ok(deepEqual( - obj, { a : 1, c : [ 3 ] } - )); - - assert.ok(!deepEqual( - obj, { a : 1, c : [ 3, null ] } - )); -}; - -exports.deleteNoStop = function() { - var obj = { a : 1, b : 2, c : { d: 3, e: 4 } }; - - var keys = []; - Traverse(obj).forEach(function (x) { - keys.push(this.key) - if (this.key == 'c') this.delete(); - }); - - assert.deepEqual(keys, [undefined, 'a', 'b', 'c', 'd', 'e']) -} - -exports.deleteStop = function() { - var obj = { a : 1, b : 2, c : { d: 3, e: 4 } }; - - var keys = []; - Traverse(obj).forEach(function (x) { - keys.push(this.key) - if (this.key == 'c') this.delete(true); - }); - - assert.deepEqual(keys, [undefined, 'a', 'b', 'c']) -} - -exports.deleteRedux = function () { - var obj = { a : 1, b : 2, c : [ 3, 4, 5 ] }; - Traverse(obj).forEach(function (x) { - if (this.isLeaf && x % 2 == 0) this.delete(); - }); - - assert.ok(!deepEqual( - obj, { a : 1, c : [ 3, undefined, 5 ] } - )); - - assert.ok(deepEqual( - obj, { a : 1, c : [ 3 ,, 5 ] } - )); - - assert.ok(!deepEqual( - obj, { a : 1, c : [ 3, null, 5 ] } - )); - - assert.ok(!deepEqual( - obj, { a : 1, c : [ 3, 5 ] } - )); -}; - -exports.deleteMap = function () { - var obj = { a : 1, b : 2, c : [ 3, 4 ] }; - var res = Traverse(obj).map(function (x) { - if (this.isLeaf && x % 2 == 0) this.delete(); - }); - - assert.ok(deepEqual( - obj, - { a : 1, b : 2, c : [ 3, 4 ] } - )); - - var xs = [ 3, 4 ]; - delete xs[1]; - - assert.ok(deepEqual( - res, { a : 1, c : xs } - )); - - assert.ok(deepEqual( - res, { a : 1, c : [ 3, ] } - )); - - assert.ok(deepEqual( - res, { a : 1, c : [ 3 ] } - )); -}; - -exports.deleteMapRedux = function () { - var obj = { a : 1, b : 2, c : [ 3, 4, 5 ] }; - var res = Traverse(obj).map(function (x) { - if (this.isLeaf && x % 2 == 0) this.delete(); - }); - - assert.ok(deepEqual( - obj, - { a : 1, b : 2, c : [ 3, 4, 5 ] } - )); - - var xs = [ 3, 4, 5 ]; - delete xs[1]; - - assert.ok(deepEqual( - res, { a : 1, c : xs } - )); - - assert.ok(!deepEqual( - res, { a : 1, c : [ 3, 5 ] } - )); - - assert.ok(deepEqual( - res, { a : 1, c : [ 3 ,, 5 ] } - )); -}; diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/negative.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/negative.js deleted file mode 100644 index f92dfb0..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/negative.js +++ /dev/null @@ -1,20 +0,0 @@ -var Traverse = require('../'); -var assert = require('assert'); - -exports['negative update test'] = function () { - var obj = [ 5, 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 } ]; - var fixed = Traverse.map(obj, function (x) { - if (x < 0) this.update(x + 128); - }); - - assert.deepEqual(fixed, - [ 5, 6, 125, [ 7, 8, 126, 1 ], { f: 10, g: 115 } ], - 'Negative values += 128' - ); - - assert.deepEqual(obj, - [ 5, 6, -3, [ 7, 8, -2, 1 ], { f: 10, g: -13 } ], - 'Original references not modified' - ); -} - diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/obj.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/obj.js deleted file mode 100644 index d46fd38..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/obj.js +++ /dev/null @@ -1,15 +0,0 @@ -var assert = require('assert'); -var Traverse = require('../'); - -exports['traverse an object with nested functions'] = function () { - var to = setTimeout(function () { - assert.fail('never ran'); - }, 1000); - - function Cons (x) { - clearTimeout(to); - assert.equal(x, 10); - }; - Traverse(new Cons(10)); -}; - diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/siblings.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/siblings.js deleted file mode 100644 index 99c0f1b..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/siblings.js +++ /dev/null @@ -1,35 +0,0 @@ -var assert = require('assert'); -var traverse = require('../'); - -exports.siblings = function () { - var obj = { a : 1, b : 2, c : [ 4, 5, 6 ] }; - - var res = traverse(obj).reduce(function (acc, x) { - var p = '/' + this.path.join('/'); - if (this.parent) { - acc[p] = { - siblings : this.parent.keys, - key : this.key, - index : this.parent.keys.indexOf(this.key) - }; - } - else { - acc[p] = { - siblings : [], - key : this.key, - index : -1 - } - } - return acc; - }, {}); - - assert.deepEqual(res, { - '/' : { siblings : [], key : undefined, index : -1 }, - '/a' : { siblings : [ 'a', 'b', 'c' ], key : 'a', index : 0 }, - '/b' : { siblings : [ 'a', 'b', 'c' ], key : 'b', index : 1 }, - '/c' : { siblings : [ 'a', 'b', 'c' ], key : 'c', index : 2 }, - '/c/0' : { siblings : [ '0', '1', '2' ], key : '0', index : 0 }, - '/c/1' : { siblings : [ '0', '1', '2' ], key : '1', index : 1 }, - '/c/2' : { siblings : [ '0', '1', '2' ], key : '2', index : 2 } - }); -}; diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/stop.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/stop.js deleted file mode 100644 index 3529847..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/stop.js +++ /dev/null @@ -1,41 +0,0 @@ -var assert = require('assert'); -var traverse = require('../'); - -exports.stop = function () { - var visits = 0; - traverse('abcdefghij'.split('')).forEach(function (node) { - if (typeof node === 'string') { - visits ++; - if (node === 'e') this.stop() - } - }); - - assert.equal(visits, 5); -}; - -exports.stopMap = function () { - var s = traverse('abcdefghij'.split('')).map(function (node) { - if (typeof node === 'string') { - if (node === 'e') this.stop() - return node.toUpperCase(); - } - }).join(''); - - assert.equal(s, 'ABCDEfghij'); -}; - -exports.stopReduce = function () { - var obj = { - a : [ 4, 5 ], - b : [ 6, [ 7, 8, 9 ] ] - }; - var xs = traverse(obj).reduce(function (acc, node) { - if (this.isLeaf) { - if (node === 7) this.stop(); - else acc.push(node) - } - return acc; - }, []); - - assert.deepEqual(xs, [ 4, 5, 6 ]); -}; diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/stringify.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/stringify.js deleted file mode 100644 index 932f5d3..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/stringify.js +++ /dev/null @@ -1,36 +0,0 @@ -var assert = require('assert'); -var Traverse = require('../'); - -exports.stringify = function () { - var obj = [ 5, 6, -3, [ 7, 8, -2, 1 ], { f : 10, g : -13 } ]; - - var s = ''; - Traverse(obj).forEach(function (node) { - if (Array.isArray(node)) { - this.before(function () { s += '[' }); - this.post(function (child) { - if (!child.isLast) s += ','; - }); - this.after(function () { s += ']' }); - } - else if (typeof node == 'object') { - this.before(function () { s += '{' }); - this.pre(function (x, key) { - s += '"' + key + '"' + ':'; - }); - this.post(function (child) { - if (!child.isLast) s += ','; - }); - this.after(function () { s += '}' }); - } - else if (typeof node == 'function') { - s += 'null'; - } - else { - s += node.toString(); - } - }); - - assert.equal(s, JSON.stringify(obj)); -} - diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/subexpr.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/subexpr.js deleted file mode 100644 index a217beb..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/subexpr.js +++ /dev/null @@ -1,34 +0,0 @@ -var traverse = require('../'); -var assert = require('assert'); - -exports.subexpr = function () { - var obj = [ 'a', 4, 'b', 5, 'c', 6 ]; - var r = traverse(obj).map(function (x) { - if (typeof x === 'number') { - this.update([ x - 0.1, x, x + 0.1 ], true); - } - }); - - assert.deepEqual(obj, [ 'a', 4, 'b', 5, 'c', 6 ]); - assert.deepEqual(r, [ - 'a', [ 3.9, 4, 4.1 ], - 'b', [ 4.9, 5, 5.1 ], - 'c', [ 5.9, 6, 6.1 ], - ]); -}; - -exports.block = function () { - var obj = [ [ 1 ], [ 2 ], [ 3 ] ]; - var r = traverse(obj).map(function (x) { - if (Array.isArray(x) && !this.isRoot) { - if (x[0] === 5) this.block() - else this.update([ [ x[0] + 1 ] ]) - } - }); - - assert.deepEqual(r, [ - [ [ [ [ [ 5 ] ] ] ] ], - [ [ [ [ 5 ] ] ] ], - [ [ [ 5 ] ] ], - ]); -}; diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/super_deep.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/super_deep.js deleted file mode 100644 index acac2fd..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/traverse/test/super_deep.js +++ /dev/null @@ -1,55 +0,0 @@ -var assert = require('assert'); -var traverse = require('../'); -var deepEqual = require('./lib/deep_equal'); - -exports.super_deep = function () { - var util = require('util'); - var a0 = make(); - var a1 = make(); - assert.ok(deepEqual(a0, a1)); - - a0.c.d.moo = true; - assert.ok(!deepEqual(a0, a1)); - - a1.c.d.moo = true; - assert.ok(deepEqual(a0, a1)); - - // TODO: this one - //a0.c.a = a1; - //assert.ok(!deepEqual(a0, a1)); -}; - -function make () { - var a = { self : 'a' }; - var b = { self : 'b' }; - var c = { self : 'c' }; - var d = { self : 'd' }; - var e = { self : 'e' }; - - a.a = a; - a.b = b; - a.c = c; - - b.a = a; - b.b = b; - b.c = c; - - c.a = a; - c.b = b; - c.c = c; - c.d = d; - - d.a = a; - d.b = b; - d.c = c; - d.d = d; - d.e = e; - - e.a = a; - e.b = b; - e.c = c; - e.d = d; - e.e = e; - - return a; -} diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/.npmignore b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/.npmignore deleted file mode 100644 index d97eaa0..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -.DS_Store -.tmp*~ -*.local.* -.pinf-* \ No newline at end of file diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/README.html b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/README.html deleted file mode 100644 index 8f5223f..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/README.html +++ /dev/null @@ -1,1026 +0,0 @@ - - - - -UglifyJS -- a JavaScript parser/compressor/beautifier - - - - - - - - - - - - -
- -

UglifyJS – a JavaScript parser/compressor/beautifier

- - - - -
-

1 UglifyJS — a JavaScript parser/compressor/beautifier

-
- - -

-This package implements a general-purpose JavaScript -parser/compressor/beautifier toolkit. It is developed on NodeJS, but it -should work on any JavaScript platform supporting the CommonJS module system -(and if your platform of choice doesn't support CommonJS, you can easily -implement it, or discard the exports.* lines from UglifyJS sources). -

-

-The tokenizer/parser generates an abstract syntax tree from JS code. You -can then traverse the AST to learn more about the code, or do various -manipulations on it. This part is implemented in parse-js.js and it's a -port to JavaScript of the excellent parse-js Common Lisp library from Marijn Haverbeke. -

-

-( See cl-uglify-js if you're looking for the Common Lisp version of -UglifyJS. ) -

-

-The second part of this package, implemented in process.js, inspects and -manipulates the AST generated by the parser to provide the following: -

-
    -
  • -ability to re-generate JavaScript code from the AST. Optionally -indented—you can use this if you want to “beautify” a program that has -been compressed, so that you can inspect the source. But you can also run -our code generator to print out an AST without any whitespace, so you -achieve compression as well. - -
  • -
  • -shorten variable names (usually to single characters). Our mangler will -analyze the code and generate proper variable names, depending on scope -and usage, and is smart enough to deal with globals defined elsewhere, or -with eval() calls or with{} statements. In short, if eval() or -with{} are used in some scope, then all variables in that scope and any -variables in the parent scopes will remain unmangled, and any references -to such variables remain unmangled as well. - -
  • -
  • -various small optimizations that may lead to faster code but certainly -lead to smaller code. Where possible, we do the following: - -
      -
    • -foo["bar"] ==> foo.bar - -
    • -
    • -remove block brackets {} - -
    • -
    • -join consecutive var declarations: -var a = 10; var b = 20; ==> var a=10,b=20; - -
    • -
    • -resolve simple constant expressions: 1 +2 * 3 ==> 7. We only do the -replacement if the result occupies less bytes; for example 1/3 would -translate to 0.333333333333, so in this case we don't replace it. - -
    • -
    • -consecutive statements in blocks are merged into a sequence; in many -cases, this leaves blocks with a single statement, so then we can remove -the block brackets. - -
    • -
    • -various optimizations for IF statements: - -
        -
      • -if (foo) bar(); else baz(); ==> foo?bar():baz(); -
      • -
      • -if (!foo) bar(); else baz(); ==> foo?baz():bar(); -
      • -
      • -if (foo) bar(); ==> foo&&bar(); -
      • -
      • -if (!foo) bar(); ==> foo||bar(); -
      • -
      • -if (foo) return bar(); else return baz(); ==> return foo?bar():baz(); -
      • -
      • -if (foo) return bar(); else something(); ==> {if(foo)return bar();something()} - -
      • -
      -
    • -
    • -remove some unreachable code and warn about it (code that follows a -return, throw, break or continue statement, except -function/variable declarations). - -
    • -
    • -act a limited version of a pre-processor (c.f. the pre-processor of -C/C++) to allow you to safely replace selected global symbols with -specified values. When combined with the optimisations above this can -make UglifyJS operate slightly more like a compilation process, in -that when certain symbols are replaced by constant values, entire code -blocks may be optimised away as unreachable. -
    • -
    -
  • -
- - - -
- -
-

1.1 Unsafe transformations

-
- - -

-The following transformations can in theory break code, although they're -probably safe in most practical cases. To enable them you need to pass the ---unsafe flag. -

- -
- -
-

1.1.1 Calls involving the global Array constructor

-
- - -

-The following transformations occur: -

- - - -
new Array(1, 2, 3, 4)  => [1,2,3,4]
-Array(a, b, c)         => [a,b,c]
-new Array(5)           => Array(5)
-new Array(a)           => Array(a)
-
- - - -

-These are all safe if the Array name isn't redefined. JavaScript does allow -one to globally redefine Array (and pretty much everything, in fact) but I -personally don't see why would anyone do that. -

-

-UglifyJS does handle the case where Array is redefined locally, or even -globally but with a function or var declaration. Therefore, in the -following cases UglifyJS doesn't touch calls or instantiations of Array: -

- - - -
// case 1.  globally declared variable
-  var Array;
-  new Array(1, 2, 3);
-  Array(a, b);
-
-  // or (can be declared later)
-  new Array(1, 2, 3);
-  var Array;
-
-  // or (can be a function)
-  new Array(1, 2, 3);
-  function Array() { ... }
-
-// case 2.  declared in a function
-  (function(){
-    a = new Array(1, 2, 3);
-    b = Array(5, 6);
-    var Array;
-  })();
-
-  // or
-  (function(Array){
-    return Array(5, 6, 7);
-  })();
-
-  // or
-  (function(){
-    return new Array(1, 2, 3, 4);
-    function Array() { ... }
-  })();
-
-  // etc.
-
- - - -
- -
- -
-

1.1.2 obj.toString() ==> obj+“”

-
- - -
-
- -
- -
-

1.2 Install (NPM)

-
- - -

-UglifyJS is now available through NPM — npm install uglify-js should do -the job. -

-
- -
- -
-

1.3 Install latest code from GitHub

-
- - - - - -
## clone the repository
-mkdir -p /where/you/wanna/put/it
-cd /where/you/wanna/put/it
-git clone git://github.com/mishoo/UglifyJS.git
-
-## make the module available to Node
-mkdir -p ~/.node_libraries/
-cd ~/.node_libraries/
-ln -s /where/you/wanna/put/it/UglifyJS/uglify-js.js
-
-## and if you want the CLI script too:
-mkdir -p ~/bin
-cd ~/bin
-ln -s /where/you/wanna/put/it/UglifyJS/bin/uglifyjs
-  # (then add ~/bin to your $PATH if it's not there already)
-
- - - -
- -
- -
-

1.4 Usage

-
- - -

-There is a command-line tool that exposes the functionality of this library -for your shell-scripting needs: -

- - - -
uglifyjs [ options... ] [ filename ]
-
- - - -

-filename should be the last argument and should name the file from which -to read the JavaScript code. If you don't specify it, it will read code -from STDIN. -

-

-Supported options: -

-
    -
  • --b or --beautify — output indented code; when passed, additional -options control the beautifier: - -
      -
    • --i N or --indent N — indentation level (number of spaces) - -
    • -
    • --q or --quote-keys — quote keys in literal objects (by default, -only keys that cannot be identifier names will be quotes). - -
    • -
    -
  • -
  • ---ascii — pass this argument to encode non-ASCII characters as -\uXXXX sequences. By default UglifyJS won't bother to do it and will -output Unicode characters instead. (the output is always encoded in UTF8, -but if you pass this option you'll only get ASCII). - -
  • -
  • --nm or --no-mangle — don't mangle variable names - -
  • -
  • --ns or --no-squeeze — don't call ast_squeeze() (which does various -optimizations that result in smaller, less readable code). - -
  • -
  • --mt or --mangle-toplevel — mangle names in the toplevel scope too -(by default we don't do this). - -
  • -
  • ---no-seqs — when ast_squeeze() is called (thus, unless you pass ---no-squeeze) it will reduce consecutive statements in blocks into a -sequence. For example, "a = 10; b = 20; foo();" will be written as -"a=10,b=20,foo();". In various occasions, this allows us to discard the -block brackets (since the block becomes a single statement). This is ON -by default because it seems safe and saves a few hundred bytes on some -libs that I tested it on, but pass --no-seqs to disable it. - -
  • -
  • ---no-dead-code — by default, UglifyJS will remove code that is -obviously unreachable (code that follows a return, throw, break or -continue statement and is not a function/variable declaration). Pass -this option to disable this optimization. - -
  • -
  • --nc or --no-copyright — by default, uglifyjs will keep the initial -comment tokens in the generated code (assumed to be copyright information -etc.). If you pass this it will discard it. - -
  • -
  • --o filename or --output filename — put the result in filename. If -this isn't given, the result goes to standard output (or see next one). - -
  • -
  • ---overwrite — if the code is read from a file (not from STDIN) and you -pass --overwrite then the output will be written in the same file. - -
  • -
  • ---ast — pass this if you want to get the Abstract Syntax Tree instead -of JavaScript as output. Useful for debugging or learning more about the -internals. - -
  • -
  • --v or --verbose — output some notes on STDERR (for now just how long -each operation takes). - -
  • -
  • --d SYMBOL[=VALUE] or --define SYMBOL[=VALUE] — will replace -all instances of the specified symbol where used as an identifier -(except where symbol has properly declared by a var declaration or -use as function parameter or similar) with the specified value. This -argument may be specified multiple times to define multiple -symbols - if no value is specified the symbol will be replaced with -the value true, or you can specify a numeric value (such as -1024), a quoted string value (such as ="object"= or -='https://github.com'), or the name of another symbol or keyword (such as =null or document). -This allows you, for example, to assign meaningful names to key -constant values but discard the symbolic names in the uglified -version for brevity/efficiency, or when used wth care, allows -UglifyJS to operate as a form of conditional compilation -whereby defining appropriate values may, by dint of the constant -folding and dead code removal features above, remove entire -superfluous code blocks (e.g. completely remove instrumentation or -trace code for production use). -Where string values are being defined, the handling of quotes are -likely to be subject to the specifics of your command shell -environment, so you may need to experiment with quoting styles -depending on your platform, or you may find the option ---define-from-module more suitable for use. - -
  • -
  • --define-from-module SOMEMODULE — will load the named module (as -per the NodeJS require() function) and iterate all the exported -properties of the module defining them as symbol names to be defined -(as if by the --define option) per the name of each property -(i.e. without the module name prefix) and given the value of the -property. This is a much easier way to handle and document groups of -symbols to be defined rather than a large number of --define -options. - -
  • -
  • ---unsafe — enable other additional optimizations that are known to be -unsafe in some contrived situations, but could still be generally useful. -For now only these: - -
      -
    • -foo.toString() ==> foo+"" -
    • -
    • -new Array(x,…) ==> [x,…] -
    • -
    • -new Array(x) ==> Array(x) - -
    • -
    -
  • -
  • ---max-line-len (default 32K characters) — add a newline after around -32K characters. I've seen both FF and Chrome croak when all the code was -on a single line of around 670K. Pass –max-line-len 0 to disable this -safety feature. - -
  • -
  • ---reserved-names — some libraries rely on certain names to be used, as -pointed out in issue #92 and #81, so this option allow you to exclude such -names from the mangler. For example, to keep names require and $super -intact you'd specify –reserved-names "require,$super". - -
  • -
  • ---inline-script – when you want to include the output literally in an -HTML <script> tag you can use this option to prevent </script from -showing up in the output. - -
  • -
  • ---lift-vars – when you pass this, UglifyJS will apply the following -transformations (see the notes in API, ast_lift_variables): - -
      -
    • -put all var declarations at the start of the scope -
    • -
    • -make sure a variable is declared only once -
    • -
    • -discard unused function arguments -
    • -
    • -discard unused inner (named) functions -
    • -
    • -finally, try to merge assignments into that one var declaration, if -possible. -
    • -
    -
  • -
- - - -
- -
-

1.4.1 API

-
- - -

-To use the library from JavaScript, you'd do the following (example for -NodeJS): -

- - - -
var jsp = require("uglify-js").parser;
-var pro = require("uglify-js").uglify;
-
-var orig_code = "... JS code here";
-var ast = jsp.parse(orig_code); // parse code and get the initial AST
-ast = pro.ast_mangle(ast); // get a new AST with mangled names
-ast = pro.ast_squeeze(ast); // get an AST with compression optimizations
-var final_code = pro.gen_code(ast); // compressed code here
-
- - - -

-The above performs the full compression that is possible right now. As you -can see, there are a sequence of steps which you can apply. For example if -you want compressed output but for some reason you don't want to mangle -variable names, you would simply skip the line that calls -pro.ast_mangle(ast). -

-

-Some of these functions take optional arguments. Here's a description: -

-
    -
  • -jsp.parse(code, strict_semicolons) – parses JS code and returns an AST. -strict_semicolons is optional and defaults to false. If you pass -true then the parser will throw an error when it expects a semicolon and -it doesn't find it. For most JS code you don't want that, but it's useful -if you want to strictly sanitize your code. - -
  • -
  • -pro.ast_lift_variables(ast) – merge and move var declarations to the -scop of the scope; discard unused function arguments or variables; discard -unused (named) inner functions. It also tries to merge assignments -following the var declaration into it. - -

    -If your code is very hand-optimized concerning var declarations, this -lifting variable declarations might actually increase size. For me it -helps out. On jQuery it adds 865 bytes (243 after gzip). YMMV. Also -note that (since it's not enabled by default) this operation isn't yet -heavily tested (please report if you find issues!). -

    -

    -Note that although it might increase the image size (on jQuery it gains -865 bytes, 243 after gzip) it's technically more correct: in certain -situations, dead code removal might drop variable declarations, which -would not happen if the variables are lifted in advance. -

    -

    -Here's an example of what it does: -

    -
  • -
- - - - -
function f(a, b, c, d, e) {
-    var q;
-    var w;
-    w = 10;
-    q = 20;
-    for (var i = 1; i < 10; ++i) {
-        var boo = foo(a);
-    }
-    for (var i = 0; i < 1; ++i) {
-        var boo = bar(c);
-    }
-    function foo(){ ... }
-    function bar(){ ... }
-    function baz(){ ... }
-}
-
-// transforms into ==>
-
-function f(a, b, c) {
-    var i, boo, w = 10, q = 20;
-    for (i = 1; i < 10; ++i) {
-        boo = foo(a);
-    }
-    for (i = 0; i < 1; ++i) {
-        boo = bar(c);
-    }
-    function foo() { ... }
-    function bar() { ... }
-}
-
- - - -
    -
  • -pro.ast_mangle(ast, options) – generates a new AST containing mangled -(compressed) variable and function names. It supports the following -options: - -
      -
    • -toplevel – mangle toplevel names (by default we don't touch them). -
    • -
    • -except – an array of names to exclude from compression. -
    • -
    • -defines – an object with properties named after symbols to -replace (see the --define option for the script) and the values -representing the AST replacement value. - -
    • -
    -
  • -
  • -pro.ast_squeeze(ast, options) – employs further optimizations designed -to reduce the size of the code that gen_code would generate from the -AST. Returns a new AST. options can be a hash; the supported options -are: - -
      -
    • -make_seqs (default true) which will cause consecutive statements in a -block to be merged using the "sequence" (comma) operator - -
    • -
    • -dead_code (default true) which will remove unreachable code. - -
    • -
    -
  • -
  • -pro.gen_code(ast, options) – generates JS code from the AST. By -default it's minified, but using the options argument you can get nicely -formatted output. options is, well, optional :-) and if you pass it it -must be an object and supports the following properties (below you can see -the default values): - -
      -
    • -beautify: false – pass true if you want indented output -
    • -
    • -indent_start: 0 (only applies when beautify is true) – initial -indentation in spaces -
    • -
    • -indent_level: 4 (only applies when beautify is true) -- -indentation level, in spaces (pass an even number) -
    • -
    • -quote_keys: false – if you pass true it will quote all keys in -literal objects -
    • -
    • -space_colon: false (only applies when beautify is true) – wether -to put a space before the colon in object literals -
    • -
    • -ascii_only: false – pass true if you want to encode non-ASCII -characters as \uXXXX. -
    • -
    • -inline_script: false – pass true to escape occurrences of -</script in strings -
    • -
    -
  • -
- - -
- -
- -
-

1.4.2 Beautifier shortcoming – no more comments

-
- - -

-The beautifier can be used as a general purpose indentation tool. It's -useful when you want to make a minified file readable. One limitation, -though, is that it discards all comments, so you don't really want to use it -to reformat your code, unless you don't have, or don't care about, comments. -

-

-In fact it's not the beautifier who discards comments — they are dumped at -the parsing stage, when we build the initial AST. Comments don't really -make sense in the AST, and while we could add nodes for them, it would be -inconvenient because we'd have to add special rules to ignore them at all -the processing stages. -

-
- -
- -
-

1.4.3 Use as a code pre-processor

-
- - -

-The --define option can be used, particularly when combined with the -constant folding logic, as a form of pre-processor to enable or remove -particular constructions, such as might be used for instrumenting -development code, or to produce variations aimed at a specific -platform. -

-

-The code below illustrates the way this can be done, and how the -symbol replacement is performed. -

- - - -
CLAUSE1: if (typeof DEVMODE === 'undefined') {
-    DEVMODE = true;
-}
-
-CLAUSE2: function init() {
-    if (DEVMODE) {
-        console.log("init() called");
-    }
-    ....
-    DEVMODE &amp;&amp; console.log("init() complete");
-}
-
-CLAUSE3: function reportDeviceStatus(device) {
-    var DEVMODE = device.mode, DEVNAME = device.name;
-    if (DEVMODE === 'open') {
-        ....
-    }
-}
-
- - - -

-When the above code is normally executed, the undeclared global -variable DEVMODE will be assigned the value true (see CLAUSE1) -and so the init() function (CLAUSE2) will write messages to the -console log when executed, but in CLAUSE3 a locally declared -variable will mask access to the DEVMODE global symbol. -

-

-If the above code is processed by UglifyJS with an argument of ---define DEVMODE=false then UglifyJS will replace DEVMODE with the -boolean constant value false within CLAUSE1 and CLAUSE2, but it -will leave CLAUSE3 as it stands because there DEVMODE resolves to -a validly declared variable. -

-

-And more so, the constant-folding features of UglifyJS will recognise -that the if condition of CLAUSE1 is thus always false, and so will -remove the test and body of CLAUSE1 altogether (including the -otherwise slightly problematical statement false = true; which it -will have formed by replacing DEVMODE in the body). Similarly, -within CLAUSE2 both calls to console.log() will be removed -altogether. -

-

-In this way you can mimic, to a limited degree, the functionality of -the C/C++ pre-processor to enable or completely remove blocks -depending on how certain symbols are defined - perhaps using UglifyJS -to generate different versions of source aimed at different -environments -

-

-It is recommmended (but not made mandatory) that symbols designed for -this purpose are given names consisting of UPPER_CASE_LETTERS to -distinguish them from other (normal) symbols and avoid the sort of -clash that CLAUSE3 above illustrates. -

-
-
- -
- -
-

1.5 Compression – how good is it?

-
- - -

-Here are updated statistics. (I also updated my Google Closure and YUI -installations). -

-

-We're still a lot better than YUI in terms of compression, though slightly -slower. We're still a lot faster than Closure, and compression after gzip -is comparable. -

- - -- - - - - - - - - - -
FileUglifyJSUglifyJS+gzipClosureClosure+gzipYUIYUI+gzip
jquery-1.6.2.js91001 (0:01.59)3189690678 (0:07.40)31979101527 (0:01.82)34646
paper.js142023 (0:01.65)43334134301 (0:07.42)42495173383 (0:01.58)48785
prototype.js88544 (0:01.09)2668086955 (0:06.97)2632692130 (0:00.79)28624
thelib-full.js (DynarchLIB)251939 (0:02.55)72535249911 (0:09.05)72696258869 (0:01.94)76584
- - -
- -
- -
-

1.6 Bugs?

-
- - -

-Unfortunately, for the time being there is no automated test suite. But I -ran the compressor manually on non-trivial code, and then I tested that the -generated code works as expected. A few hundred times. -

-

-DynarchLIB was started in times when there was no good JS minifier. -Therefore I was quite religious about trying to write short code manually, -and as such DL contains a lot of syntactic hacks1 such as “foo == bar ? a -= 10 : b = 20”, though the more readable version would clearly be to use -“if/else”. -

-

-Since the parser/compressor runs fine on DL and jQuery, I'm quite confident -that it's solid enough for production use. If you can identify any bugs, -I'd love to hear about them (use the Google Group or email me directly). -

-
- -
- -
-

1.7 Links

-
- - - - - -
- -
- -
-

1.8 License

-
- - -

-UglifyJS is released under the BSD license: -

- - - -
Copyright 2010 (c) Mihai Bazon <mihai.bazon@gmail.com>
-Based on parse-js (http://marijn.haverbeke.nl/parse-js/).
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-    * Redistributions of source code must retain the above
-      copyright notice, this list of conditions and the following
-      disclaimer.
-
-    * Redistributions in binary form must reproduce the above
-      copyright notice, this list of conditions and the following
-      disclaimer in the documentation and/or other materials
-      provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
-EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
-OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
-TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
-THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGE.
-
- - - - -
-
-
-
-

Footnotes:

-
-

1 I even reported a few bugs and suggested some fixes in the original -parse-js library, and Marijn pushed fixes literally in minutes. -

-
-
-
-

Author: Mihai Bazon -

-

Date: 2011-08-29 19:17:55 EEST

-

HTML generated by org-mode 7.01trans in emacs 23

-
-
- - diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/README.org b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/README.org deleted file mode 100644 index 50c9c27..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/README.org +++ /dev/null @@ -1,571 +0,0 @@ -#+TITLE: UglifyJS -- a JavaScript parser/compressor/beautifier -#+KEYWORDS: javascript, js, parser, compiler, compressor, mangle, minify, minifier -#+DESCRIPTION: a JavaScript parser/compressor/beautifier in JavaScript -#+STYLE: -#+AUTHOR: Mihai Bazon -#+EMAIL: mihai.bazon@gmail.com - -* UglifyJS --- a JavaScript parser/compressor/beautifier - -This package implements a general-purpose JavaScript -parser/compressor/beautifier toolkit. It is developed on [[http://nodejs.org/][NodeJS]], but it -should work on any JavaScript platform supporting the CommonJS module system -(and if your platform of choice doesn't support CommonJS, you can easily -implement it, or discard the =exports.*= lines from UglifyJS sources). - -The tokenizer/parser generates an abstract syntax tree from JS code. You -can then traverse the AST to learn more about the code, or do various -manipulations on it. This part is implemented in [[../lib/parse-js.js][parse-js.js]] and it's a -port to JavaScript of the excellent [[http://marijn.haverbeke.nl/parse-js/][parse-js]] Common Lisp library from [[http://marijn.haverbeke.nl/][Marijn -Haverbeke]]. - -( See [[http://github.com/mishoo/cl-uglify-js][cl-uglify-js]] if you're looking for the Common Lisp version of -UglifyJS. ) - -The second part of this package, implemented in [[../lib/process.js][process.js]], inspects and -manipulates the AST generated by the parser to provide the following: - -- ability to re-generate JavaScript code from the AST. Optionally - indented---you can use this if you want to “beautify” a program that has - been compressed, so that you can inspect the source. But you can also run - our code generator to print out an AST without any whitespace, so you - achieve compression as well. - -- shorten variable names (usually to single characters). Our mangler will - analyze the code and generate proper variable names, depending on scope - and usage, and is smart enough to deal with globals defined elsewhere, or - with =eval()= calls or =with{}= statements. In short, if =eval()= or - =with{}= are used in some scope, then all variables in that scope and any - variables in the parent scopes will remain unmangled, and any references - to such variables remain unmangled as well. - -- various small optimizations that may lead to faster code but certainly - lead to smaller code. Where possible, we do the following: - - - foo["bar"] ==> foo.bar - - - remove block brackets ={}= - - - join consecutive var declarations: - var a = 10; var b = 20; ==> var a=10,b=20; - - - resolve simple constant expressions: 1 +2 * 3 ==> 7. We only do the - replacement if the result occupies less bytes; for example 1/3 would - translate to 0.333333333333, so in this case we don't replace it. - - - consecutive statements in blocks are merged into a sequence; in many - cases, this leaves blocks with a single statement, so then we can remove - the block brackets. - - - various optimizations for IF statements: - - - if (foo) bar(); else baz(); ==> foo?bar():baz(); - - if (!foo) bar(); else baz(); ==> foo?baz():bar(); - - if (foo) bar(); ==> foo&&bar(); - - if (!foo) bar(); ==> foo||bar(); - - if (foo) return bar(); else return baz(); ==> return foo?bar():baz(); - - if (foo) return bar(); else something(); ==> {if(foo)return bar();something()} - - - remove some unreachable code and warn about it (code that follows a - =return=, =throw=, =break= or =continue= statement, except - function/variable declarations). - - - act a limited version of a pre-processor (c.f. the pre-processor of - C/C++) to allow you to safely replace selected global symbols with - specified values. When combined with the optimisations above this can - make UglifyJS operate slightly more like a compilation process, in - that when certain symbols are replaced by constant values, entire code - blocks may be optimised away as unreachable. - -** <> - -The following transformations can in theory break code, although they're -probably safe in most practical cases. To enable them you need to pass the -=--unsafe= flag. - -*** Calls involving the global Array constructor - -The following transformations occur: - -#+BEGIN_SRC js -new Array(1, 2, 3, 4) => [1,2,3,4] -Array(a, b, c) => [a,b,c] -new Array(5) => Array(5) -new Array(a) => Array(a) -#+END_SRC - -These are all safe if the Array name isn't redefined. JavaScript does allow -one to globally redefine Array (and pretty much everything, in fact) but I -personally don't see why would anyone do that. - -UglifyJS does handle the case where Array is redefined locally, or even -globally but with a =function= or =var= declaration. Therefore, in the -following cases UglifyJS *doesn't touch* calls or instantiations of Array: - -#+BEGIN_SRC js -// case 1. globally declared variable - var Array; - new Array(1, 2, 3); - Array(a, b); - - // or (can be declared later) - new Array(1, 2, 3); - var Array; - - // or (can be a function) - new Array(1, 2, 3); - function Array() { ... } - -// case 2. declared in a function - (function(){ - a = new Array(1, 2, 3); - b = Array(5, 6); - var Array; - })(); - - // or - (function(Array){ - return Array(5, 6, 7); - })(); - - // or - (function(){ - return new Array(1, 2, 3, 4); - function Array() { ... } - })(); - - // etc. -#+END_SRC - -*** =obj.toString()= ==> =obj+“”= - -** Install (NPM) - -UglifyJS is now available through NPM --- =npm install uglify-js= should do -the job. - -** Install latest code from GitHub - -#+BEGIN_SRC sh -## clone the repository -mkdir -p /where/you/wanna/put/it -cd /where/you/wanna/put/it -git clone git://github.com/mishoo/UglifyJS.git - -## make the module available to Node -mkdir -p ~/.node_libraries/ -cd ~/.node_libraries/ -ln -s /where/you/wanna/put/it/UglifyJS/uglify-js.js - -## and if you want the CLI script too: -mkdir -p ~/bin -cd ~/bin -ln -s /where/you/wanna/put/it/UglifyJS/bin/uglifyjs - # (then add ~/bin to your $PATH if it's not there already) -#+END_SRC - -** Usage - -There is a command-line tool that exposes the functionality of this library -for your shell-scripting needs: - -#+BEGIN_SRC sh -uglifyjs [ options... ] [ filename ] -#+END_SRC - -=filename= should be the last argument and should name the file from which -to read the JavaScript code. If you don't specify it, it will read code -from STDIN. - -Supported options: - -- =-b= or =--beautify= --- output indented code; when passed, additional - options control the beautifier: - - - =-i N= or =--indent N= --- indentation level (number of spaces) - - - =-q= or =--quote-keys= --- quote keys in literal objects (by default, - only keys that cannot be identifier names will be quotes). - -- =--ascii= --- pass this argument to encode non-ASCII characters as - =\uXXXX= sequences. By default UglifyJS won't bother to do it and will - output Unicode characters instead. (the output is always encoded in UTF8, - but if you pass this option you'll only get ASCII). - -- =-nm= or =--no-mangle= --- don't mangle variable names - -- =-ns= or =--no-squeeze= --- don't call =ast_squeeze()= (which does various - optimizations that result in smaller, less readable code). - -- =-mt= or =--mangle-toplevel= --- mangle names in the toplevel scope too - (by default we don't do this). - -- =--no-seqs= --- when =ast_squeeze()= is called (thus, unless you pass - =--no-squeeze=) it will reduce consecutive statements in blocks into a - sequence. For example, "a = 10; b = 20; foo();" will be written as - "a=10,b=20,foo();". In various occasions, this allows us to discard the - block brackets (since the block becomes a single statement). This is ON - by default because it seems safe and saves a few hundred bytes on some - libs that I tested it on, but pass =--no-seqs= to disable it. - -- =--no-dead-code= --- by default, UglifyJS will remove code that is - obviously unreachable (code that follows a =return=, =throw=, =break= or - =continue= statement and is not a function/variable declaration). Pass - this option to disable this optimization. - -- =-nc= or =--no-copyright= --- by default, =uglifyjs= will keep the initial - comment tokens in the generated code (assumed to be copyright information - etc.). If you pass this it will discard it. - -- =-o filename= or =--output filename= --- put the result in =filename=. If - this isn't given, the result goes to standard output (or see next one). - -- =--overwrite= --- if the code is read from a file (not from STDIN) and you - pass =--overwrite= then the output will be written in the same file. - -- =--ast= --- pass this if you want to get the Abstract Syntax Tree instead - of JavaScript as output. Useful for debugging or learning more about the - internals. - -- =-v= or =--verbose= --- output some notes on STDERR (for now just how long - each operation takes). - -- =-d SYMBOL[=VALUE]= or =--define SYMBOL[=VALUE]= --- will replace - all instances of the specified symbol where used as an identifier - (except where symbol has properly declared by a var declaration or - use as function parameter or similar) with the specified value. This - argument may be specified multiple times to define multiple - symbols - if no value is specified the symbol will be replaced with - the value =true=, or you can specify a numeric value (such as - =1024=), a quoted string value (such as ="object"= or - ='https://github.com'=), or the name of another symbol or keyword - (such as =null= or =document=). - This allows you, for example, to assign meaningful names to key - constant values but discard the symbolic names in the uglified - version for brevity/efficiency, or when used wth care, allows - UglifyJS to operate as a form of *conditional compilation* - whereby defining appropriate values may, by dint of the constant - folding and dead code removal features above, remove entire - superfluous code blocks (e.g. completely remove instrumentation or - trace code for production use). - Where string values are being defined, the handling of quotes are - likely to be subject to the specifics of your command shell - environment, so you may need to experiment with quoting styles - depending on your platform, or you may find the option - =--define-from-module= more suitable for use. - -- =-define-from-module SOMEMODULE= --- will load the named module (as - per the NodeJS =require()= function) and iterate all the exported - properties of the module defining them as symbol names to be defined - (as if by the =--define= option) per the name of each property - (i.e. without the module name prefix) and given the value of the - property. This is a much easier way to handle and document groups of - symbols to be defined rather than a large number of =--define= - options. - -- =--unsafe= --- enable other additional optimizations that are known to be - unsafe in some contrived situations, but could still be generally useful. - For now only these: - - - foo.toString() ==> foo+"" - - new Array(x,...) ==> [x,...] - - new Array(x) ==> Array(x) - -- =--max-line-len= (default 32K characters) --- add a newline after around - 32K characters. I've seen both FF and Chrome croak when all the code was - on a single line of around 670K. Pass --max-line-len 0 to disable this - safety feature. - -- =--reserved-names= --- some libraries rely on certain names to be used, as - pointed out in issue #92 and #81, so this option allow you to exclude such - names from the mangler. For example, to keep names =require= and =$super= - intact you'd specify --reserved-names "require,$super". - -- =--inline-script= -- when you want to include the output literally in an - HTML =\n\n\n\n
\n\n

UglifyJS – a JavaScript parser/compressor/beautifier

\n\n\n\n\n
\n

1 UglifyJS — a JavaScript parser/compressor/beautifier

\n
\n\n\n

\nThis package implements a general-purpose JavaScript\nparser/compressor/beautifier toolkit. It is developed on NodeJS, but it\nshould work on any JavaScript platform supporting the CommonJS module system\n(and if your platform of choice doesn't support CommonJS, you can easily\nimplement it, or discard the exports.* lines from UglifyJS sources).\n

\n

\nThe tokenizer/parser generates an abstract syntax tree from JS code. You\ncan then traverse the AST to learn more about the code, or do various\nmanipulations on it. This part is implemented in parse-js.js and it's a\nport to JavaScript of the excellent parse-js Common Lisp library from Marijn Haverbeke.\n

\n

\n( See cl-uglify-js if you're looking for the Common Lisp version of\nUglifyJS. )\n

\n

\nThe second part of this package, implemented in process.js, inspects and\nmanipulates the AST generated by the parser to provide the following:\n

\n
    \n
  • \nability to re-generate JavaScript code from the AST. Optionally\nindented—you can use this if you want to “beautify” a program that has\nbeen compressed, so that you can inspect the source. But you can also run\nour code generator to print out an AST without any whitespace, so you\nachieve compression as well.\n\n
  • \n
  • \nshorten variable names (usually to single characters). Our mangler will\nanalyze the code and generate proper variable names, depending on scope\nand usage, and is smart enough to deal with globals defined elsewhere, or\nwith eval() calls or with{} statements. In short, if eval() or\nwith{} are used in some scope, then all variables in that scope and any\nvariables in the parent scopes will remain unmangled, and any references\nto such variables remain unmangled as well.\n\n
  • \n
  • \nvarious small optimizations that may lead to faster code but certainly\nlead to smaller code. Where possible, we do the following:\n\n
      \n
    • \nfoo[\"bar\"] ==> foo.bar\n\n
    • \n
    • \nremove block brackets {}\n\n
    • \n
    • \njoin consecutive var declarations:\nvar a = 10; var b = 20; ==> var a=10,b=20;\n\n
    • \n
    • \nresolve simple constant expressions: 1 +2 * 3 ==> 7. We only do the\nreplacement if the result occupies less bytes; for example 1/3 would\ntranslate to 0.333333333333, so in this case we don't replace it.\n\n
    • \n
    • \nconsecutive statements in blocks are merged into a sequence; in many\ncases, this leaves blocks with a single statement, so then we can remove\nthe block brackets.\n\n
    • \n
    • \nvarious optimizations for IF statements:\n\n
        \n
      • \nif (foo) bar(); else baz(); ==> foo?bar():baz();\n
      • \n
      • \nif (!foo) bar(); else baz(); ==> foo?baz():bar();\n
      • \n
      • \nif (foo) bar(); ==> foo&&bar();\n
      • \n
      • \nif (!foo) bar(); ==> foo||bar();\n
      • \n
      • \nif (foo) return bar(); else return baz(); ==> return foo?bar():baz();\n
      • \n
      • \nif (foo) return bar(); else something(); ==> {if(foo)return bar();something()}\n\n
      • \n
      \n
    • \n
    • \nremove some unreachable code and warn about it (code that follows a\nreturn, throw, break or continue statement, except\nfunction/variable declarations).\n\n
    • \n
    • \nact a limited version of a pre-processor (c.f. the pre-processor of\nC/C++) to allow you to safely replace selected global symbols with\nspecified values. When combined with the optimisations above this can\nmake UglifyJS operate slightly more like a compilation process, in\nthat when certain symbols are replaced by constant values, entire code\nblocks may be optimised away as unreachable.\n
    • \n
    \n
  • \n
\n\n\n\n
\n\n
\n

1.1 Unsafe transformations

\n
\n\n\n

\nThe following transformations can in theory break code, although they're\nprobably safe in most practical cases. To enable them you need to pass the\n--unsafe flag.\n

\n\n
\n\n
\n

1.1.1 Calls involving the global Array constructor

\n
\n\n\n

\nThe following transformations occur:\n

\n\n\n\n
new Array(1, 2, 3, 4)  => [1,2,3,4]\nArray(a, b, c)         => [a,b,c]\nnew Array(5)           => Array(5)\nnew Array(a)           => Array(a)\n
\n\n\n\n

\nThese are all safe if the Array name isn't redefined. JavaScript does allow\none to globally redefine Array (and pretty much everything, in fact) but I\npersonally don't see why would anyone do that.\n

\n

\nUglifyJS does handle the case where Array is redefined locally, or even\nglobally but with a function or var declaration. Therefore, in the\nfollowing cases UglifyJS doesn't touch calls or instantiations of Array:\n

\n\n\n\n
// case 1.  globally declared variable\n  var Array;\n  new Array(1, 2, 3);\n  Array(a, b);\n\n  // or (can be declared later)\n  new Array(1, 2, 3);\n  var Array;\n\n  // or (can be a function)\n  new Array(1, 2, 3);\n  function Array() { ... }\n\n// case 2.  declared in a function\n  (function(){\n    a = new Array(1, 2, 3);\n    b = Array(5, 6);\n    var Array;\n  })();\n\n  // or\n  (function(Array){\n    return Array(5, 6, 7);\n  })();\n\n  // or\n  (function(){\n    return new Array(1, 2, 3, 4);\n    function Array() { ... }\n  })();\n\n  // etc.\n
\n\n\n\n
\n\n
\n\n
\n

1.1.2 obj.toString() ==> obj+“”

\n
\n\n\n
\n
\n\n
\n\n
\n

1.2 Install (NPM)

\n
\n\n\n

\nUglifyJS is now available through NPM — npm install uglify-js should do\nthe job.\n

\n
\n\n
\n\n
\n

1.3 Install latest code from GitHub

\n
\n\n\n\n\n\n
## clone the repository\nmkdir -p /where/you/wanna/put/it\ncd /where/you/wanna/put/it\ngit clone git://github.com/mishoo/UglifyJS.git\n\n## make the module available to Node\nmkdir -p ~/.node_libraries/\ncd ~/.node_libraries/\nln -s /where/you/wanna/put/it/UglifyJS/uglify-js.js\n\n## and if you want the CLI script too:\nmkdir -p ~/bin\ncd ~/bin\nln -s /where/you/wanna/put/it/UglifyJS/bin/uglifyjs\n  # (then add ~/bin to your $PATH if it's not there already)\n
\n\n\n\n
\n\n
\n\n
\n

1.4 Usage

\n
\n\n\n

\nThere is a command-line tool that exposes the functionality of this library\nfor your shell-scripting needs:\n

\n\n\n\n
uglifyjs [ options... ] [ filename ]\n
\n\n\n\n

\nfilename should be the last argument and should name the file from which\nto read the JavaScript code. If you don't specify it, it will read code\nfrom STDIN.\n

\n

\nSupported options:\n

\n
    \n
  • \n-b or --beautify — output indented code; when passed, additional\noptions control the beautifier:\n\n
      \n
    • \n-i N or --indent N — indentation level (number of spaces)\n\n
    • \n
    • \n-q or --quote-keys — quote keys in literal objects (by default,\nonly keys that cannot be identifier names will be quotes).\n\n
    • \n
    \n
  • \n
  • \n--ascii — pass this argument to encode non-ASCII characters as\n\\uXXXX sequences. By default UglifyJS won't bother to do it and will\noutput Unicode characters instead. (the output is always encoded in UTF8,\nbut if you pass this option you'll only get ASCII).\n\n
  • \n
  • \n-nm or --no-mangle — don't mangle variable names\n\n
  • \n
  • \n-ns or --no-squeeze — don't call ast_squeeze() (which does various\noptimizations that result in smaller, less readable code).\n\n
  • \n
  • \n-mt or --mangle-toplevel — mangle names in the toplevel scope too\n(by default we don't do this).\n\n
  • \n
  • \n--no-seqs — when ast_squeeze() is called (thus, unless you pass\n--no-squeeze) it will reduce consecutive statements in blocks into a\nsequence. For example, \"a = 10; b = 20; foo();\" will be written as\n\"a=10,b=20,foo();\". In various occasions, this allows us to discard the\nblock brackets (since the block becomes a single statement). This is ON\nby default because it seems safe and saves a few hundred bytes on some\nlibs that I tested it on, but pass --no-seqs to disable it.\n\n
  • \n
  • \n--no-dead-code — by default, UglifyJS will remove code that is\nobviously unreachable (code that follows a return, throw, break or\ncontinue statement and is not a function/variable declaration). Pass\nthis option to disable this optimization.\n\n
  • \n
  • \n-nc or --no-copyright — by default, uglifyjs will keep the initial\ncomment tokens in the generated code (assumed to be copyright information\netc.). If you pass this it will discard it.\n\n
  • \n
  • \n-o filename or --output filename — put the result in filename. If\nthis isn't given, the result goes to standard output (or see next one).\n\n
  • \n
  • \n--overwrite — if the code is read from a file (not from STDIN) and you\npass --overwrite then the output will be written in the same file.\n\n
  • \n
  • \n--ast — pass this if you want to get the Abstract Syntax Tree instead\nof JavaScript as output. Useful for debugging or learning more about the\ninternals.\n\n
  • \n
  • \n-v or --verbose — output some notes on STDERR (for now just how long\neach operation takes).\n\n
  • \n
  • \n-d SYMBOL[=VALUE] or --define SYMBOL[=VALUE] — will replace\nall instances of the specified symbol where used as an identifier\n(except where symbol has properly declared by a var declaration or\nuse as function parameter or similar) with the specified value. This\nargument may be specified multiple times to define multiple\nsymbols - if no value is specified the symbol will be replaced with\nthe value true, or you can specify a numeric value (such as\n1024), a quoted string value (such as =\"object\"= or\n='https://github.com'), or the name of another symbol or keyword (such as =null or document). \nThis allows you, for example, to assign meaningful names to key\nconstant values but discard the symbolic names in the uglified\nversion for brevity/efficiency, or when used wth care, allows\nUglifyJS to operate as a form of conditional compilation\nwhereby defining appropriate values may, by dint of the constant\nfolding and dead code removal features above, remove entire\nsuperfluous code blocks (e.g. completely remove instrumentation or\ntrace code for production use).\nWhere string values are being defined, the handling of quotes are\nlikely to be subject to the specifics of your command shell\nenvironment, so you may need to experiment with quoting styles\ndepending on your platform, or you may find the option\n--define-from-module more suitable for use.\n\n
  • \n
  • \n-define-from-module SOMEMODULE — will load the named module (as\nper the NodeJS require() function) and iterate all the exported\nproperties of the module defining them as symbol names to be defined\n(as if by the --define option) per the name of each property\n(i.e. without the module name prefix) and given the value of the\nproperty. This is a much easier way to handle and document groups of\nsymbols to be defined rather than a large number of --define\noptions.\n\n
  • \n
  • \n--unsafe — enable other additional optimizations that are known to be\nunsafe in some contrived situations, but could still be generally useful.\nFor now only these:\n\n
      \n
    • \nfoo.toString() ==> foo+\"\"\n
    • \n
    • \nnew Array(x,…) ==> [x,…]\n
    • \n
    • \nnew Array(x) ==> Array(x)\n\n
    • \n
    \n
  • \n
  • \n--max-line-len (default 32K characters) — add a newline after around\n32K characters. I've seen both FF and Chrome croak when all the code was\non a single line of around 670K. Pass –max-line-len 0 to disable this\nsafety feature.\n\n
  • \n
  • \n--reserved-names — some libraries rely on certain names to be used, as\npointed out in issue #92 and #81, so this option allow you to exclude such\nnames from the mangler. For example, to keep names require and $super\nintact you'd specify –reserved-names \"require,$super\".\n\n
  • \n
  • \n--inline-script – when you want to include the output literally in an\nHTML <script> tag you can use this option to prevent </script from\nshowing up in the output.\n\n
  • \n
  • \n--lift-vars – when you pass this, UglifyJS will apply the following\ntransformations (see the notes in API, ast_lift_variables):\n\n
      \n
    • \nput all var declarations at the start of the scope\n
    • \n
    • \nmake sure a variable is declared only once\n
    • \n
    • \ndiscard unused function arguments\n
    • \n
    • \ndiscard unused inner (named) functions\n
    • \n
    • \nfinally, try to merge assignments into that one var declaration, if\npossible.\n
    • \n
    \n
  • \n
\n\n\n\n
\n\n
\n

1.4.1 API

\n
\n\n\n

\nTo use the library from JavaScript, you'd do the following (example for\nNodeJS):\n

\n\n\n\n
var jsp = require(\"uglify-js\").parser;\nvar pro = require(\"uglify-js\").uglify;\n\nvar orig_code = \"... JS code here\";\nvar ast = jsp.parse(orig_code); // parse code and get the initial AST\nast = pro.ast_mangle(ast); // get a new AST with mangled names\nast = pro.ast_squeeze(ast); // get an AST with compression optimizations\nvar final_code = pro.gen_code(ast); // compressed code here\n
\n\n\n\n

\nThe above performs the full compression that is possible right now. As you\ncan see, there are a sequence of steps which you can apply. For example if\nyou want compressed output but for some reason you don't want to mangle\nvariable names, you would simply skip the line that calls\npro.ast_mangle(ast).\n

\n

\nSome of these functions take optional arguments. Here's a description:\n

\n
    \n
  • \njsp.parse(code, strict_semicolons) – parses JS code and returns an AST.\nstrict_semicolons is optional and defaults to false. If you pass\ntrue then the parser will throw an error when it expects a semicolon and\nit doesn't find it. For most JS code you don't want that, but it's useful\nif you want to strictly sanitize your code.\n\n
  • \n
  • \npro.ast_lift_variables(ast) – merge and move var declarations to the\nscop of the scope; discard unused function arguments or variables; discard\nunused (named) inner functions. It also tries to merge assignments\nfollowing the var declaration into it.\n\n

    \nIf your code is very hand-optimized concerning var declarations, this\nlifting variable declarations might actually increase size. For me it\nhelps out. On jQuery it adds 865 bytes (243 after gzip). YMMV. Also\nnote that (since it's not enabled by default) this operation isn't yet\nheavily tested (please report if you find issues!).\n

    \n

    \nNote that although it might increase the image size (on jQuery it gains\n865 bytes, 243 after gzip) it's technically more correct: in certain\nsituations, dead code removal might drop variable declarations, which\nwould not happen if the variables are lifted in advance.\n

    \n

    \nHere's an example of what it does:\n

    \n
  • \n
\n\n\n\n\n
function f(a, b, c, d, e) {\n    var q;\n    var w;\n    w = 10;\n    q = 20;\n    for (var i = 1; i < 10; ++i) {\n        var boo = foo(a);\n    }\n    for (var i = 0; i < 1; ++i) {\n        var boo = bar(c);\n    }\n    function foo(){ ... }\n    function bar(){ ... }\n    function baz(){ ... }\n}\n\n// transforms into ==>\n\nfunction f(a, b, c) {\n    var i, boo, w = 10, q = 20;\n    for (i = 1; i < 10; ++i) {\n        boo = foo(a);\n    }\n    for (i = 0; i < 1; ++i) {\n        boo = bar(c);\n    }\n    function foo() { ... }\n    function bar() { ... }\n}\n
\n\n\n\n
    \n
  • \npro.ast_mangle(ast, options) – generates a new AST containing mangled\n(compressed) variable and function names. It supports the following\noptions:\n\n
      \n
    • \ntoplevel – mangle toplevel names (by default we don't touch them).\n
    • \n
    • \nexcept – an array of names to exclude from compression.\n
    • \n
    • \ndefines – an object with properties named after symbols to\nreplace (see the --define option for the script) and the values\nrepresenting the AST replacement value.\n\n
    • \n
    \n
  • \n
  • \npro.ast_squeeze(ast, options) – employs further optimizations designed\nto reduce the size of the code that gen_code would generate from the\nAST. Returns a new AST. options can be a hash; the supported options\nare:\n\n
      \n
    • \nmake_seqs (default true) which will cause consecutive statements in a\nblock to be merged using the \"sequence\" (comma) operator\n\n
    • \n
    • \ndead_code (default true) which will remove unreachable code.\n\n
    • \n
    \n
  • \n
  • \npro.gen_code(ast, options) – generates JS code from the AST. By\ndefault it's minified, but using the options argument you can get nicely\nformatted output. options is, well, optional :-) and if you pass it it\nmust be an object and supports the following properties (below you can see\nthe default values):\n\n
      \n
    • \nbeautify: false – pass true if you want indented output\n
    • \n
    • \nindent_start: 0 (only applies when beautify is true) – initial\nindentation in spaces\n
    • \n
    • \nindent_level: 4 (only applies when beautify is true) --\nindentation level, in spaces (pass an even number)\n
    • \n
    • \nquote_keys: false – if you pass true it will quote all keys in\nliteral objects\n
    • \n
    • \nspace_colon: false (only applies when beautify is true) – wether\nto put a space before the colon in object literals\n
    • \n
    • \nascii_only: false – pass true if you want to encode non-ASCII\ncharacters as \\uXXXX.\n
    • \n
    • \ninline_script: false – pass true to escape occurrences of\n</script in strings\n
    • \n
    \n
  • \n
\n\n\n
\n\n
\n\n
\n

1.4.2 Beautifier shortcoming – no more comments

\n
\n\n\n

\nThe beautifier can be used as a general purpose indentation tool. It's\nuseful when you want to make a minified file readable. One limitation,\nthough, is that it discards all comments, so you don't really want to use it\nto reformat your code, unless you don't have, or don't care about, comments.\n

\n

\nIn fact it's not the beautifier who discards comments — they are dumped at\nthe parsing stage, when we build the initial AST. Comments don't really\nmake sense in the AST, and while we could add nodes for them, it would be\ninconvenient because we'd have to add special rules to ignore them at all\nthe processing stages.\n

\n
\n\n
\n\n
\n

1.4.3 Use as a code pre-processor

\n
\n\n\n

\nThe --define option can be used, particularly when combined with the\nconstant folding logic, as a form of pre-processor to enable or remove\nparticular constructions, such as might be used for instrumenting\ndevelopment code, or to produce variations aimed at a specific\nplatform.\n

\n

\nThe code below illustrates the way this can be done, and how the\nsymbol replacement is performed.\n

\n\n\n\n
CLAUSE1: if (typeof DEVMODE === 'undefined') {\n    DEVMODE = true;\n}\n\nCLAUSE2: function init() {\n    if (DEVMODE) {\n        console.log(\"init() called\");\n    }\n    ....\n    DEVMODE &amp;&amp; console.log(\"init() complete\");\n}\n\nCLAUSE3: function reportDeviceStatus(device) {\n    var DEVMODE = device.mode, DEVNAME = device.name;\n    if (DEVMODE === 'open') {\n        ....\n    }\n}\n
\n\n\n\n

\nWhen the above code is normally executed, the undeclared global\nvariable DEVMODE will be assigned the value true (see CLAUSE1)\nand so the init() function (CLAUSE2) will write messages to the\nconsole log when executed, but in CLAUSE3 a locally declared\nvariable will mask access to the DEVMODE global symbol.\n

\n

\nIf the above code is processed by UglifyJS with an argument of\n--define DEVMODE=false then UglifyJS will replace DEVMODE with the\nboolean constant value false within CLAUSE1 and CLAUSE2, but it\nwill leave CLAUSE3 as it stands because there DEVMODE resolves to\na validly declared variable.\n

\n

\nAnd more so, the constant-folding features of UglifyJS will recognise\nthat the if condition of CLAUSE1 is thus always false, and so will\nremove the test and body of CLAUSE1 altogether (including the\notherwise slightly problematical statement false = true; which it\nwill have formed by replacing DEVMODE in the body). Similarly,\nwithin CLAUSE2 both calls to console.log() will be removed\naltogether.\n

\n

\nIn this way you can mimic, to a limited degree, the functionality of\nthe C/C++ pre-processor to enable or completely remove blocks\ndepending on how certain symbols are defined - perhaps using UglifyJS\nto generate different versions of source aimed at different\nenvironments\n

\n

\nIt is recommmended (but not made mandatory) that symbols designed for\nthis purpose are given names consisting of UPPER_CASE_LETTERS to\ndistinguish them from other (normal) symbols and avoid the sort of\nclash that CLAUSE3 above illustrates.\n

\n
\n
\n\n
\n\n
\n

1.5 Compression – how good is it?

\n
\n\n\n

\nHere are updated statistics. (I also updated my Google Closure and YUI\ninstallations).\n

\n

\nWe're still a lot better than YUI in terms of compression, though slightly\nslower. We're still a lot faster than Closure, and compression after gzip\nis comparable.\n

\n\n\n\n\n\n\n\n\n\n\n\n\n\n
FileUglifyJSUglifyJS+gzipClosureClosure+gzipYUIYUI+gzip
jquery-1.6.2.js91001 (0:01.59)3189690678 (0:07.40)31979101527 (0:01.82)34646
paper.js142023 (0:01.65)43334134301 (0:07.42)42495173383 (0:01.58)48785
prototype.js88544 (0:01.09)2668086955 (0:06.97)2632692130 (0:00.79)28624
thelib-full.js (DynarchLIB)251939 (0:02.55)72535249911 (0:09.05)72696258869 (0:01.94)76584
\n\n\n
\n\n
\n\n
\n

1.6 Bugs?

\n
\n\n\n

\nUnfortunately, for the time being there is no automated test suite. But I\nran the compressor manually on non-trivial code, and then I tested that the\ngenerated code works as expected. A few hundred times.\n

\n

\nDynarchLIB was started in times when there was no good JS minifier.\nTherefore I was quite religious about trying to write short code manually,\nand as such DL contains a lot of syntactic hacks1 such as “foo == bar ? a\n= 10 : b = 20”, though the more readable version would clearly be to use\n“if/else”.\n

\n

\nSince the parser/compressor runs fine on DL and jQuery, I'm quite confident\nthat it's solid enough for production use. If you can identify any bugs,\nI'd love to hear about them (use the Google Group or email me directly).\n

\n
\n\n
\n\n
\n

1.7 Links

\n
\n\n\n\n\n\n
\n\n
\n\n
\n

1.8 License

\n
\n\n\n

\nUglifyJS is released under the BSD license:\n

\n\n\n\n
Copyright 2010 (c) Mihai Bazon <mihai.bazon@gmail.com>\nBased on parse-js (http://marijn.haverbeke.nl/parse-js/).\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n\n    * Redistributions of source code must retain the above\n      copyright notice, this list of conditions and the following\n      disclaimer.\n\n    * Redistributions in binary form must reproduce the above\n      copyright notice, this list of conditions and the following\n      disclaimer in the documentation and/or other materials\n      provided with the distribution.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY\nEXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE\nLIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,\nOR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\nPROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\nPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR\nTORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF\nTHE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGE.\n
\n\n\n\n\n
\n
\n
\n
\n

Footnotes:

\n
\n

1 I even reported a few bugs and suggested some fixes in the original\nparse-js library, and Marijn pushed fixes literally in minutes.\n

\n
\n
\n
\n

Author: Mihai Bazon\n

\n

Date: 2011-08-29 19:17:55 EEST

\n

HTML generated by org-mode 7.01trans in emacs 23

\n
\n
\n\n\n", - "readmeFilename": "README.html", - "_id": "uglify-js@1.1.1", - "_from": "uglify-js@~1.1.1" -} diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/package.json~ b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/package.json~ deleted file mode 100644 index 8ca4d35..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/package.json~ +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name" : "uglify-js", - - "description" : "JavaScript parser and compressor/beautifier toolkit", - - "author" : { - "name" : "Mihai Bazon", - "email" : "mihai.bazon@gmail.com", - "url" : "http://mihai.bazon.net/blog" - }, - - "version" : "1.1.0", - - "main" : "./uglify-js.js", - - "bin" : { - "uglifyjs" : "./bin/uglifyjs" - }, - - "repository": { - "type": "git", - "url": "git@github.com:mishoo/UglifyJS.git" - } -} diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/beautify.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/beautify.js deleted file mode 100644 index f19369e..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/beautify.js +++ /dev/null @@ -1,28 +0,0 @@ -#! /usr/bin/env node - -global.sys = require("sys"); -var fs = require("fs"); - -var jsp = require("../lib/parse-js"); -var pro = require("../lib/process"); - -var filename = process.argv[2]; -fs.readFile(filename, "utf8", function(err, text){ - try { - var ast = time_it("parse", function(){ return jsp.parse(text); }); - ast = time_it("mangle", function(){ return pro.ast_mangle(ast); }); - ast = time_it("squeeze", function(){ return pro.ast_squeeze(ast); }); - var gen = time_it("generate", function(){ return pro.gen_code(ast, false); }); - sys.puts(gen); - } catch(ex) { - sys.debug(ex.stack); - sys.debug(sys.inspect(ex)); - sys.debug(JSON.stringify(ex)); - } -}); - -function time_it(name, cont) { - var t1 = new Date().getTime(); - try { return cont(); } - finally { sys.debug("// " + name + ": " + ((new Date().getTime() - t1) / 1000).toFixed(3) + " sec."); } -}; diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/testparser.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/testparser.js deleted file mode 100644 index 02c19a9..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/testparser.js +++ /dev/null @@ -1,403 +0,0 @@ -#! /usr/bin/env node - -var parseJS = require("../lib/parse-js"); -var sys = require("sys"); - -// write debug in a very straightforward manner -var debug = function(){ - sys.log(Array.prototype.slice.call(arguments).join(', ')); -}; - -ParserTestSuite(function(i, input, desc){ - try { - parseJS.parse(input); - debug("ok " + i + ": " + desc); - } catch(e){ - debug("FAIL " + i + " " + desc + " (" + e + ")"); - } -}); - -function ParserTestSuite(callback){ - var inps = [ - ["var abc;", "Regular variable statement w/o assignment"], - ["var abc = 5;", "Regular variable statement with assignment"], - ["/* */;", "Multiline comment"], - ['/** **/;', 'Double star multiline comment'], - ["var f = function(){;};", "Function expression in var assignment"], - ['hi; // moo\n;', 'single line comment'], - ['var varwithfunction;', 'Dont match keywords as substrings'], // difference between `var withsomevar` and `"str"` (local search and lits) - ['a + b;', 'addition'], - ["'a';", 'single string literal'], - ["'a\\n';", 'single string literal with escaped return'], - ['"a";', 'double string literal'], - ['"a\\n";', 'double string literal with escaped return'], - ['"var";', 'string is a keyword'], - ['"variable";', 'string starts with a keyword'], - ['"somevariable";', 'string contains a keyword'], - ['"somevar";', 'string ends with a keyword'], - ['500;', 'int literal'], - ['500.;', 'float literal w/o decimals'], - ['500.432;', 'float literal with decimals'], - ['.432432;', 'float literal w/o int'], - ['(a,b,c);', 'parens and comma'], - ['[1,2,abc];', 'array literal'], - ['var o = {a:1};', 'object literal unquoted key'], - ['var o = {"b":2};', 'object literal quoted key'], // opening curly may not be at the start of a statement... - ['var o = {c:c};', 'object literal keyname is identifier'], - ['var o = {a:1,"b":2,c:c};', 'object literal combinations'], - ['var x;\nvar y;', 'two lines'], - ['var x;\nfunction n(){; }', 'function def'], - ['var x;\nfunction n(abc){; }', 'function def with arg'], - ['var x;\nfunction n(abc, def){ ;}', 'function def with args'], - ['function n(){ "hello"; }', 'function def with body'], - ['/a/;', 'regex literal'], - ['/a/b;', 'regex literal with flag'], - ['/a/ / /b/;', 'regex div regex'], - ['a/b/c;', 'triple division looks like regex'], - ['+function(){/regex/;};', 'regex at start of function body'], - // http://code.google.com/p/es-lab/source/browse/trunk/tests/parser/parsertests.js?r=86 - // http://code.google.com/p/es-lab/source/browse/trunk/tests/parser/parsertests.js?r=430 - - // first tests for the lexer, should also parse as program (when you append a semi) - - // comments - ['//foo!@#^&$1234\nbar;', 'single line comment'], - ['/* abcd!@#@$* { } && null*/;', 'single line multi line comment'], - ['/*foo\nbar*/;','multi line comment'], - ['/*x*x*/;','multi line comment with *'], - ['/**/;','empty comment'], - // identifiers - ["x;",'1 identifier'], - ["_x;",'2 identifier'], - ["xyz;",'3 identifier'], - ["$x;",'4 identifier'], - ["x$;",'5 identifier'], - ["_;",'6 identifier'], - ["x5;",'7 identifier'], - ["x_y;",'8 identifier'], - ["x+5;",'9 identifier'], - ["xyz123;",'10 identifier'], - ["x1y1z1;",'11 identifier'], - ["foo\\u00D8bar;",'12 identifier unicode escape'], - //["foo�bar;",'13 identifier unicode embedded (might fail)'], - // numbers - ["5;", '1 number'], - ["5.5;", '2 number'], - ["0;", '3 number'], - ["0.0;", '4 number'], - ["0.001;", '5 number'], - ["1.e2;", '6 number'], - ["1.e-2;", '7 number'], - ["1.E2;", '8 number'], - ["1.E-2;", '9 number'], - [".5;", '10 number'], - [".5e3;", '11 number'], - [".5e-3;", '12 number'], - ["0.5e3;", '13 number'], - ["55;", '14 number'], - ["123;", '15 number'], - ["55.55;", '16 number'], - ["55.55e10;", '17 number'], - ["123.456;", '18 number'], - ["1+e;", '20 number'], - ["0x01;", '22 number'], - ["0XCAFE;", '23 number'], - ["0x12345678;", '24 number'], - ["0x1234ABCD;", '25 number'], - ["0x0001;", '26 number'], - // strings - ["\"foo\";", '1 string'], - ["\'foo\';", '2 string'], - ["\"x\";", '3 string'], - ["\'\';", '4 string'], - ["\"foo\\tbar\";", '5 string'], - ["\"!@#$%^&*()_+{}[]\";", '6 string'], - ["\"/*test*/\";", '7 string'], - ["\"//test\";", '8 string'], - ["\"\\\\\";", '9 string'], - ["\"\\u0001\";", '10 string'], - ["\"\\uFEFF\";", '11 string'], - ["\"\\u10002\";", '12 string'], - ["\"\\x55\";", '13 string'], - ["\"\\x55a\";", '14 string'], - ["\"a\\\\nb\";", '15 string'], - ['";"', '16 string: semi in a string'], - ['"a\\\nb";', '17 string: line terminator escape'], - // literals - ["null;", "null"], - ["true;", "true"], - ["false;", "false"], - // regex - ["/a/;", "1 regex"], - ["/abc/;", "2 regex"], - ["/abc[a-z]*def/g;", "3 regex"], - ["/\\b/;", "4 regex"], - ["/[a-zA-Z]/;", "5 regex"], - - // program tests (for as far as they havent been covered above) - - // regexp - ["/foo(.*)/g;", "another regexp"], - // arrays - ["[];", "1 array"], - ["[ ];", "2 array"], - ["[1];", "3 array"], - ["[1,2];", "4 array"], - ["[1,2,,];", "5 array"], - ["[1,2,3];", "6 array"], - ["[1,2,3,,,];", "7 array"], - // objects - ["{};", "1 object"], - ["({x:5});", "2 object"], - ["({x:5,y:6});", "3 object"], - ["({x:5,});", "4 object"], - ["({if:5});", "5 object"], - ["({ get x() {42;} });", "6 object"], - ["({ set y(a) {1;} });", "7 object"], - // member expression - ["o.m;", "1 member expression"], - ["o['m'];", "2 member expression"], - ["o['n']['m'];", "3 member expression"], - ["o.n.m;", "4 member expression"], - ["o.if;", "5 member expression"], - // call and invoke expressions - ["f();", "1 call/invoke expression"], - ["f(x);", "2 call/invoke expression"], - ["f(x,y);", "3 call/invoke expression"], - ["o.m();", "4 call/invoke expression"], - ["o['m'];", "5 call/invoke expression"], - ["o.m(x);", "6 call/invoke expression"], - ["o['m'](x);", "7 call/invoke expression"], - ["o.m(x,y);", "8 call/invoke expression"], - ["o['m'](x,y);", "9 call/invoke expression"], - ["f(x)(y);", "10 call/invoke expression"], - ["f().x;", "11 call/invoke expression"], - - // eval - ["eval('x');", "1 eval"], - ["(eval)('x');", "2 eval"], - ["(1,eval)('x');", "3 eval"], - ["eval(x,y);", "4 eval"], - // new expression - ["new f();", "1 new expression"], - ["new o;", "2 new expression"], - ["new o.m;", "3 new expression"], - ["new o.m(x);", "4 new expression"], - ["new o.m(x,y);", "5 new expression"], - // prefix/postfix - ["++x;", "1 pre/postfix"], - ["x++;", "2 pre/postfix"], - ["--x;", "3 pre/postfix"], - ["x--;", "4 pre/postfix"], - ["x ++;", "5 pre/postfix"], - ["x /* comment */ ++;", "6 pre/postfix"], - ["++ /* comment */ x;", "7 pre/postfix"], - // unary operators - ["delete x;", "1 unary operator"], - ["void x;", "2 unary operator"], - ["+ x;", "3 unary operator"], - ["-x;", "4 unary operator"], - ["~x;", "5 unary operator"], - ["!x;", "6 unary operator"], - // meh - ["new Date++;", "new date ++"], - ["+x++;", " + x ++"], - // expression expressions - ["1 * 2;", "1 expression expressions"], - ["1 / 2;", "2 expression expressions"], - ["1 % 2;", "3 expression expressions"], - ["1 + 2;", "4 expression expressions"], - ["1 - 2;", "5 expression expressions"], - ["1 << 2;", "6 expression expressions"], - ["1 >>> 2;", "7 expression expressions"], - ["1 >> 2;", "8 expression expressions"], - ["1 * 2 + 3;", "9 expression expressions"], - ["(1+2)*3;", "10 expression expressions"], - ["1*(2+3);", "11 expression expressions"], - ["xy;", "13 expression expressions"], - ["x<=y;", "14 expression expressions"], - ["x>=y;", "15 expression expressions"], - ["x instanceof y;", "16 expression expressions"], - ["x in y;", "17 expression expressions"], - ["x&y;", "18 expression expressions"], - ["x^y;", "19 expression expressions"], - ["x|y;", "20 expression expressions"], - ["x+y>>= y;", "1 assignment"], - ["x <<= y;", "2 assignment"], - ["x = y;", "3 assignment"], - ["x += y;", "4 assignment"], - ["x /= y;", "5 assignment"], - // comma - ["x, y;", "comma"], - // block - ["{};", "1 block"], - ["{x;};", "2 block"], - ["{x;y;};", "3 block"], - // vars - ["var x;", "1 var"], - ["var x,y;", "2 var"], - ["var x=1,y=2;", "3 var"], - ["var x,y=2;", "4 var"], - // empty - [";", "1 empty"], - ["\n;", "2 empty"], - // expression statement - ["x;", "1 expression statement"], - ["5;", "2 expression statement"], - ["1+2;", "3 expression statement"], - // if - ["if (c) x; else y;", "1 if statement"], - ["if (c) x;", "2 if statement"], - ["if (c) {} else {};", "3 if statement"], - ["if (c1) if (c2) s1; else s2;", "4 if statement"], - // while - ["do s; while (e);", "1 while statement"], - ["do { s; } while (e);", "2 while statement"], - ["while (e) s;", "3 while statement"], - ["while (e) { s; };", "4 while statement"], - // for - ["for (;;) ;", "1 for statement"], - ["for (;c;x++) x;", "2 for statement"], - ["for (i;i> 1; -var c = 8 >>> 1; \ No newline at end of file diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue34.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue34.js deleted file mode 100644 index 022f7a3..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue34.js +++ /dev/null @@ -1,3 +0,0 @@ -var a = {}; -a["this"] = 1; -a["that"] = 2; \ No newline at end of file diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue4.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue4.js deleted file mode 100644 index 0b76103..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue4.js +++ /dev/null @@ -1,3 +0,0 @@ -var a = 2e3; -var b = 2e-3; -var c = 2e-5; \ No newline at end of file diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue48.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue48.js deleted file mode 100644 index 031e85b..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue48.js +++ /dev/null @@ -1 +0,0 @@ -var s, i; s = ''; i = 0; \ No newline at end of file diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue50.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue50.js deleted file mode 100644 index 060f9df..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue50.js +++ /dev/null @@ -1,9 +0,0 @@ -function bar(a) { - try { - foo(); - } catch(e) { - alert("Exception caught (foo not defined)"); - } - alert(a); // 10 in FF, "[object Error]" in IE -} -bar(10); diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue53.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue53.js deleted file mode 100644 index 4f8b32f..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue53.js +++ /dev/null @@ -1 +0,0 @@ -x = (y, z) diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue54.1.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue54.1.js deleted file mode 100644 index 967052e..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue54.1.js +++ /dev/null @@ -1,3 +0,0 @@ -foo.toString(); -a.toString(16); -b.toString.call(c); diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue68.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue68.js deleted file mode 100644 index 14054d0..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue68.js +++ /dev/null @@ -1,5 +0,0 @@ -function f() { - if (a) return; - g(); - function g(){} -}; diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue69.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue69.js deleted file mode 100644 index d25ecd6..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue69.js +++ /dev/null @@ -1 +0,0 @@ -[(a,b)] diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue9.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue9.js deleted file mode 100644 index 6158861..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/issue9.js +++ /dev/null @@ -1,4 +0,0 @@ -var a = { - a: 1, - b: 2, // <-- trailing comma -}; diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/mangle.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/mangle.js deleted file mode 100644 index c271a26..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/mangle.js +++ /dev/null @@ -1,5 +0,0 @@ -(function() { - var x = function fun(a, fun, b) { - return fun; - }; -}()); diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/null_string.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/null_string.js deleted file mode 100644 index a675b1c..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/null_string.js +++ /dev/null @@ -1 +0,0 @@ -var nullString = "\0" \ No newline at end of file diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/strict-equals.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/strict-equals.js deleted file mode 100644 index b631f4c..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/strict-equals.js +++ /dev/null @@ -1,3 +0,0 @@ -typeof a === 'string' -b + "" !== c + "" -d < e === f < g diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/var.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/var.js deleted file mode 100644 index 746ea98..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/var.js +++ /dev/null @@ -1,3 +0,0 @@ -// var declarations after each other should be combined -var a = 1; -var b = 2; \ No newline at end of file diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/whitespace.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/whitespace.js deleted file mode 100644 index 6a15c46..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/whitespace.js +++ /dev/null @@ -1,21 +0,0 @@ -function id(a) { - // Form-Feed - // Vertical Tab - // No-Break Space - ᠎// Mongolian Vowel Separator -  // En quad -  // Em quad -  // En space -  // Em space -  // Three-Per-Em Space -  // Four-Per-Em Space -  // Six-Per-Em Space -  // Figure Space -  // Punctuation Space -  // Thin Space -  // Hair Space -  // Narrow No-Break Space -  // Medium Mathematical Space -  // Ideographic Space - return a; -} diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/with.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/with.js deleted file mode 100644 index de266ed..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/compress/test/with.js +++ /dev/null @@ -1,2 +0,0 @@ -with({}) { -}; diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/scripts.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/scripts.js deleted file mode 100644 index 9fdd96c..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/test/unit/scripts.js +++ /dev/null @@ -1,55 +0,0 @@ -var fs = require('fs'), - uglify = require('uglify-js'), - jsp = uglify.parser, - nodeunit = require('nodeunit'), - path = require('path'), - pro = uglify.uglify; - -var Script = process.binding('evals').Script; - -var scriptsPath = __dirname; - -function compress(code) { - var ast = jsp.parse(code); - ast = pro.ast_mangle(ast); - ast = pro.ast_squeeze(ast, { no_warnings: true }); - ast = pro.ast_squeeze_more(ast); - return pro.gen_code(ast); -}; - -var testDir = path.join(scriptsPath, "compress", "test"); -var expectedDir = path.join(scriptsPath, "compress", "expected"); - -function getTester(script) { - return function(test) { - var testPath = path.join(testDir, script); - var expectedPath = path.join(expectedDir, script); - var content = fs.readFileSync(testPath, 'utf-8'); - var outputCompress = compress(content); - - // Check if the noncompressdata is larger or same size as the compressed data - test.ok(content.length >= outputCompress.length); - - // Check that a recompress gives the same result - var outputReCompress = compress(content); - test.equal(outputCompress, outputReCompress); - - // Check if the compressed output is what is expected - var expected = fs.readFileSync(expectedPath, 'utf-8'); - test.equal(outputCompress, expected.replace(/(\r?\n)+$/, "")); - - test.done(); - }; -}; - -var tests = {}; - -var scripts = fs.readdirSync(testDir); -for (var i in scripts) { - var script = scripts[i]; - if (/\.js$/.test(script)) { - tests[script] = getTester(script); - } -} - -module.exports = nodeunit.testCase(tests); diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/tmp/hoist.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/tmp/hoist.js deleted file mode 100644 index 4bf2b94..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/tmp/hoist.js +++ /dev/null @@ -1,33 +0,0 @@ -function foo(arg1, arg2, arg3, arg4, arg5, arg6) { - var a = 5; - { - var d = 10, mak = 20, buz = 30; - var q = buz * 2; - } - if (moo) { - var a, b, c; - } - for (var arg1 = 0, d = 20; arg1 < 10; ++arg1) - console.log(arg3); - for (var i in mak) {} - for (j in d) {} - var d; - - function test() { - - }; - - //test(); - - (function moo(first, second){ - console.log(first); - })(1); - - (function moo(first, second){ - console.log(moo()); - })(1); -} - - -var foo; -var bar; diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/tmp/instrument.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/tmp/instrument.js deleted file mode 100644 index c6a9d79..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/tmp/instrument.js +++ /dev/null @@ -1,97 +0,0 @@ -// sample on how to use the parser and walker API to instrument some code - -var jsp = require("uglify-js").parser; -var pro = require("uglify-js").uglify; - -function instrument(code) { - var ast = jsp.parse(code, false, true); // true for the third arg specifies that we want - // to have start/end tokens embedded in the - // statements - var w = pro.ast_walker(); - - // we're gonna need this to push elements that we're currently looking at, to avoid - // endless recursion. - var analyzing = []; - function do_stat() { - var ret; - if (this[0].start && analyzing.indexOf(this) < 0) { - // without the `analyzing' hack, w.walk(this) would re-enter here leading - // to infinite recursion - analyzing.push(this); - ret = [ "splice", // XXX: "block" is safer - [ [ "stat", - [ "call", [ "name", "trace" ], - [ [ "string", this[0].toString() ], - [ "num", this[0].start.line ], - [ "num", this[0].start.col ], - [ "num", this[0].end.line ], - [ "num", this[0].end.col ]]]], - w.walk(this) ]]; - analyzing.pop(this); - } - return ret; - }; - var new_ast = w.with_walkers({ - "stat" : do_stat, - "label" : do_stat, - "break" : do_stat, - "continue" : do_stat, - "debugger" : do_stat, - "var" : do_stat, - "const" : do_stat, - "return" : do_stat, - "throw" : do_stat, - "try" : do_stat, - "defun" : do_stat, - "if" : do_stat, - "while" : do_stat, - "do" : do_stat, - "for" : do_stat, - "for-in" : do_stat, - "switch" : do_stat, - "with" : do_stat - }, function(){ - return w.walk(ast); - }); - return pro.gen_code(new_ast, { beautify: true }); -} - - - - -////// test code follows. - -var code = instrument(test.toString()); -console.log(code); - -function test() { - // simple stats - a = 5; - c += a + b; - "foo"; - - // var - var foo = 5; - const bar = 6, baz = 7; - - // switch block. note we can't track case lines the same way. - switch ("foo") { - case "foo": - return 1; - case "bar": - return 2; - } - - // for/for in - for (var i = 0; i < 5; ++i) { - console.log("Hello " + i); - } - for (var i in [ 1, 2, 3]) { - console.log(i); - } - - // note however that the following is broken. I guess we - // should add the block brackets in this case... - for (var i = 0; i < 5; ++i) - console.log("foo"); -} diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/tmp/instrument2.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/tmp/instrument2.js deleted file mode 100644 index 6aee5f3..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/tmp/instrument2.js +++ /dev/null @@ -1,138 +0,0 @@ -// sample on how to use the parser and walker API to instrument some code - -var jsp = require("uglify-js").parser; -var pro = require("uglify-js").uglify; - -function instrument(code) { - var ast = jsp.parse(code, false, true); // true for the third arg specifies that we want - // to have start/end tokens embedded in the - // statements - var w = pro.ast_walker(); - - function trace (line, comment) { - var code = pro.gen_code(line, { beautify: true }); - var data = line[0] - - var args = [] - if (!comment) comment = "" - if (typeof data === "object") { - code = code.split(/\n/).shift() - args = [ [ "string", data.toString() ], - [ "string", code ], - [ "num", data.start.line ], - [ "num", data.start.col ], - [ "num", data.end.line ], - [ "num", data.end.col ]] - } else { - args = [ [ "string", data ], - [ "string", code ]] - - } - return [ "call", [ "name", "trace" ], args ]; - } - - // we're gonna need this to push elements that we're currently looking at, to avoid - // endless recursion. - var analyzing = []; - function do_stat() { - var ret; - if (this[0].start && analyzing.indexOf(this) < 0) { - // without the `analyzing' hack, w.walk(this) would re-enter here leading - // to infinite recursion - analyzing.push(this); - ret = [ "splice", - [ [ "stat", trace(this) ], - w.walk(this) ]]; - analyzing.pop(this); - } - return ret; - } - - function do_cond(c, t, f) { - return [ this[0], w.walk(c), - ["seq", trace(t), w.walk(t) ], - ["seq", trace(f), w.walk(f) ]]; - } - - function do_binary(c, l, r) { - if (c !== "&&" && c !== "||") { - return [this[0], c, w.walk(l), w.walk(r)]; - } - return [ this[0], c, - ["seq", trace(l), w.walk(l) ], - ["seq", trace(r), w.walk(r) ]]; - } - - var new_ast = w.with_walkers({ - "stat" : do_stat, - "label" : do_stat, - "break" : do_stat, - "continue" : do_stat, - "debugger" : do_stat, - "var" : do_stat, - "const" : do_stat, - "return" : do_stat, - "throw" : do_stat, - "try" : do_stat, - "defun" : do_stat, - "if" : do_stat, - "while" : do_stat, - "do" : do_stat, - "for" : do_stat, - "for-in" : do_stat, - "switch" : do_stat, - "with" : do_stat, - "conditional" : do_cond, - "binary" : do_binary - }, function(){ - return w.walk(ast); - }); - return pro.gen_code(new_ast, { beautify: true }); -} - - -////// test code follows. - -var code = instrument(test.toString()); -console.log(code); - -function test() { - // simple stats - a = 5; - c += a + b; - "foo"; - - // var - var foo = 5; - const bar = 6, baz = 7; - - // switch block. note we can't track case lines the same way. - switch ("foo") { - case "foo": - return 1; - case "bar": - return 2; - } - - // for/for in - for (var i = 0; i < 5; ++i) { - console.log("Hello " + i); - } - for (var i in [ 1, 2, 3]) { - console.log(i); - } - - for (var i = 0; i < 5; ++i) - console.log("foo"); - - for (var i = 0; i < 5; ++i) { - console.log("foo"); - } - - var k = plurp() ? 1 : 0; - var x = a ? doX(y) && goZoo("zoo") - : b ? blerg({ x: y }) - : null; - - var x = X || Y; -} diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/tmp/test.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/tmp/test.js deleted file mode 100644 index f295fba..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/tmp/test.js +++ /dev/null @@ -1,30 +0,0 @@ -#! /usr/bin/env node - -global.sys = require(/^v0\.[012]/.test(process.version) ? "sys" : "util"); -var fs = require("fs"); -var uglify = require("uglify-js"), // symlink ~/.node_libraries/uglify-js.js to ../uglify-js.js - jsp = uglify.parser, - pro = uglify.uglify; - -var code = fs.readFileSync("hoist.js", "utf8"); -var ast = jsp.parse(code); - -ast = pro.ast_lift_variables(ast); - -var w = pro.ast_walker(); -ast = w.with_walkers({ - "function": function() { - var node = w.dive(this); // walk depth first - console.log(pro.gen_code(node, { beautify: true })); - return node; - }, - "name": function(name) { - return [ this[0], "X" ]; - } -}, function(){ - return w.walk(ast); -}); - -console.log(pro.gen_code(ast, { - beautify: true -})); diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/uglify-js.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/uglify-js.js deleted file mode 100644 index 4305e23..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/node_modules/uglify-js/uglify-js.js +++ /dev/null @@ -1,17 +0,0 @@ -//convienence function(src, [options]); -function uglify(orig_code, options){ - options || (options = {}); - var jsp = uglify.parser; - var pro = uglify.uglify; - - var ast = jsp.parse(orig_code, options.strict_semicolons); // parse code and get the initial AST - ast = pro.ast_mangle(ast, options.mangle_options); // get a new AST with mangled names - ast = pro.ast_squeeze(ast, options.squeeze_options); // get an AST with compression optimizations - var final_code = pro.gen_code(ast, options.gen_options); // compressed code here - return final_code; -}; - -uglify.parser = require("./lib/parse-js"); -uglify.uglify = require("./lib/process"); - -module.exports = uglify \ No newline at end of file diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/package.json b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/package.json deleted file mode 100644 index 48510d5..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/package.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "name": "burrito", - "description": "Wrap up expressions with a trace function while walking the AST with rice and beans on the side", - "version": "0.2.12", - "repository": { - "type": "git", - "url": "git://github.com/substack/node-burrito.git" - }, - "main": "./index.js", - "keywords": [ - "trace", - "ast", - "walk", - "syntax", - "source", - "tree", - "uglify" - ], - "directories": { - "lib": ".", - "example": "example", - "test": "test" - }, - "scripts": { - "test": "tap test/*.js" - }, - "dependencies": { - "traverse": "~0.5.1", - "uglify-js": "~1.1.1" - }, - "devDependencies": { - "tap": "~0.2.5" - }, - "engines": { - "node": ">=0.4.0" - }, - "license": "BSD", - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "readme": "burrito\n=======\n\nBurrito makes it easy to do crazy stuff with the javascript AST.\n\nThis is super useful if you want to roll your own stack traces or build a code\ncoverage tool.\n\n[![build status](https://secure.travis-ci.org/substack/node-burrito.png)](http://travis-ci.org/substack/node-burrito)\n\n![node.wrap(\"burrito\")](http://substack.net/images/burrito.png)\n\nexamples\n========\n\nmicrowave\n---------\n\nexamples/microwave.js\n\n````javascript\nvar burrito = require('burrito');\n\nvar res = burrito.microwave('Math.sin(2)', function (node) {\n if (node.name === 'num') node.wrap('Math.PI / %s');\n});\n\nconsole.log(res); // sin(pi / 2) == 1\n````\n\noutput:\n\n 1\n\nwrap\n----\n\nexamples/wrap.js\n\n````javascript\nvar burrito = require('burrito');\n\nvar src = burrito('f() && g(h())\\nfoo()', function (node) {\n if (node.name === 'call') node.wrap('qqq(%s)');\n});\n\nconsole.log(src);\n````\n\noutput:\n\n qqq(f()) && qqq(g(qqq(h())));\n\n qqq(foo());\n\nmethods\n=======\n\n var burrito = require('burrito');\n\nburrito(code, cb)\n-----------------\n\nGiven some source `code` and a function `trace`, walk the ast by expression.\n\nThe `cb` gets called with a node object described below.\n\nIf `code` is an Array then it is assumbed to be an AST which you can generate\nyourself with `burrito.parse()`. The AST must be annotated, so make sure to\n`burrito.parse(src, false, true)`.\n\nburrito.microwave(code, context={}, cb)\n---------------------------------------\n\nLike `burrito()` except the result is run using\n`vm.runInNewContext(res, context)`.\n\nnode object\n===========\n\nnode.name\n---------\n\nName is a string that contains the type of the expression as named by uglify.\n\nnode.wrap(s)\n------------\n\nWrap the current expression in `s`.\n\nIf `s` is a string, `\"%s\"` will be replaced with the stringified current\nexpression.\n\nIf `s` is a function, it is called with the stringified current expression and\nshould return a new stringified expression.\n\nIf the `node.name === \"binary\"`, you get the subterms \"%a\" and \"%b\" to play with\ntoo. These subterms are applied if `s` is a function too: `s(expr, a, b)`.\n\nProtip: to insert multiple statements you can use javascript's lesser-known block\nsyntax that it gets from C:\n\n````javascript\nif (node.name === 'stat') node.wrap('{ foo(); %s }')\n````\n\nnode.node\n---------\n\nraw ast data generated by uglify\n\nnode.value\n----------\n\n`node.node.slice(1)` to skip the annotations\n\nnode.start\n----------\n\nThe start location of the expression, like this:\n\n````javascript\n{ type: 'name',\n value: 'b',\n line: 0,\n col: 3,\n pos: 3,\n nlb: false,\n comments_before: [] }\n````\n\nnode.end\n--------\n\nThe end location of the expression, formatted the same as `node.start`.\n\nnode.state\n----------\n\nThe state of the traversal using traverse.\n\nnode.source()\n-------------\n\nReturns a stringified version of the expression.\n\nnode.parent()\n-------------\n\nReturns the parent `node` or `null` if the node is the root element.\n\nnode.label()\n------------\n\nReturn the label of the present node or `null` if there is no label.\n\nLabels are returned for \"call\", \"var\", \"defun\", and \"function\" nodes.\n\nReturns an array for \"var\" nodes since `var` statements can\ncontain multiple labels in assignment.\n\ninstall\n=======\n\nWith [npm](http://npmjs.org) you can just:\n\n npm install burrito\n\nin the browser\n==============\n\nBurrito works in browser with\n[browserify](https://github.com/substack/node-browserify).\n\nIt has been tested against:\n\n* Internet Explorer 5.5, 6.0, 7.0, 8.0, 9.0\n* Firefox 3.5\n* Chrome 6.0\n* Opera 10.6\n* Safari 5.0\n\nkudos\n=====\n\nHeavily inspired by (and previously mostly lifted outright from) isaacs's nifty\ntmp/instrument.js thingy from uglify-js.\n", - "readmeFilename": "README.markdown", - "_id": "burrito@0.2.12", - "_from": "burrito@>=0.2.5 <0.3" -} diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/test/ast.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/test/ast.js deleted file mode 100644 index 503b5ab..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/test/ast.js +++ /dev/null @@ -1,31 +0,0 @@ -var test = require('tap').test; -var burrito = require('../'); -var vm = require('vm'); - -test('ast', function (t) { - t.plan(2); - - var ast = burrito.parse('f(g(h(5)))', false, true); - var src = burrito(ast, function (node) { - if (node.name === 'call') { - node.wrap(function (s) { - return 'z(' + s + ')'; - }); - } - }); - - var times = 0; - t.equal( - vm.runInNewContext(src, { - f : function (x) { return x + 1 }, - g : function (x) { return x + 2 }, - h : function (x) { return x + 3 }, - z : function (x) { - times ++; - return x * 10; - }, - }), - (((((5 + 3) * 10) + 2) * 10) + 1) * 10 - ); - t.equal(times, 3); -}); diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/test/err.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/test/err.js deleted file mode 100644 index af1611d..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/test/err.js +++ /dev/null @@ -1,52 +0,0 @@ -var test = require('tap').test; -var burrito = require('../'); - -test('wrap error', function (t) { - t.plan(6); - - try { - var src = burrito('f() && g()', function (node) { - if (node.name === 'binary') node.wrap('h(%a, %b') - }); - t.fail('should have blown up'); - } - catch (err) { - t.ok(err.message.match(/unexpected/i)); - t.ok(err instanceof SyntaxError); - t.ok(!err.stack.match(/uglify-js/)); - t.equal(err.line, 0); - t.equal(err.col, 10); - t.equal(err.pos, 10); - } -}); - -test('non string', function (t) { - t.plan(3); - - t.throws(function () { - burrito.parse(new Buffer('[]')); - }); - - t.throws(function () { - burrito.parse(new String('[]')); - }); - - t.throws(function () { - burrito.parse(); - }); -}); - -test('syntax error', function (t) { - t.plan(3); - try { - var src = burrito('f() && g())', function (node) { - if (node.name === 'binary') node.wrap('h(%a, %b)') - }); - assert.fail('should have blown up'); - } - catch (err) { - t.ok(err.message.match(/unexpected/i)); - t.ok(err instanceof SyntaxError); - t.ok(!err.stack.match(/uglify-js/)); - } -}); diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/test/fail.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/test/fail.js deleted file mode 100644 index 70d453f..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/test/fail.js +++ /dev/null @@ -1,9 +0,0 @@ -var burrito = require('../'); -var test = require('tap').test; -var fs = require('fs'); -var src = fs.readFileSync(__dirname + '/fail/src.js', 'utf8'); - -test('fail', function (t) { - burrito(src, function (node) {}); - t.end(); -}); diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/test/fail/src.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/test/fail/src.js deleted file mode 100644 index eb02736..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/test/fail/src.js +++ /dev/null @@ -1,60 +0,0 @@ -var path = require('path') - -module.exports = function(fs, ready) { - var global_files = {} - - var recurse = function(dir, okay) { - fs.readdir(dir, function(err, dir_files) { - var countdown = 0 - , files = [] - , dirs = [] - , checked = 0 - dir_files.forEach(function(file, idx, all) { - fs.stat(path.join(dir, file), function(err, stat) { - if(stat.isDirectory() && !/node_modules/g.test(dir)) { - dirs.push(file) - } else if(/\.js$/g.test(file)) { - files.push(file) - } - - if(++checked >= dir_files.length) - recurse_dirs() - }) - }) - - function recurse_dirs() { - var total = 0 - dirs.forEach(function(this_dir) { - recurse(path.join(dir, this_dir), function(err, data) { - if(++total >= dirs.length) - recurse_files() - }) - }) - - if(!dirs.length) - recurse_files() - } - - function recurse_files() { - var total = 0 - files.forEach(function(file) { - fs.readFile(path.join(dir, file), 'utf8', function(err, src) { - global_files[path.join(dir, file)] = src - ++total >= files.length && - okay(null, global_files) - }) - }) - - if(!files.length) - okay(null, global_files) - } - - if(!dir_files.length) - okay(null, global_files) - }) - } - - recurse('.', ready) -} - - diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/test/label.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/test/label.js deleted file mode 100644 index 368d7c4..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/test/label.js +++ /dev/null @@ -1,92 +0,0 @@ -var test = require('tap').test; -var burrito = require('../'); - -test('call label', function (t) { - t.plan(1); - - burrito('foo(10)', function (node) { - if (node.name === 'call') { - t.equal(node.label(), 'foo'); - } - }); -}); - -test('var label', function (t) { - t.plan(1); - - burrito('var x = 2', function (node) { - if (node.name === 'var') { - t.same(node.label(), [ 'x' ]); - } - }); -}); - -test('vars label', function (t) { - t.plan(1); - - burrito('var x = 2, y = 3', function (node) { - if (node.name === 'var') { - t.same(node.label(), [ 'x', 'y' ]); - } - }); -}); - -test('defun label', function (t) { - t.plan(1); - - burrito('function moo () {}', function (node) { - if (node.name === 'defun') { - t.same(node.label(), 'moo'); - } - }); -}); - -test('function label', function (t) { - t.plan(1); - - burrito('(function zzz () {})()', function (node) { - if (node.name === 'function') { - t.same(node.label(), 'zzz'); - } - }); -}); - -test('anon function label', function (t) { - t.plan(1); - - burrito('(function () {})()', function (node) { - if (node.name === 'function') { - t.equal(node.label(), null); - } - }); -}); - -test('dot call label', function (t) { - t.plan(1); - - burrito('process.nextTick(fn)', function (node) { - if (node.name === 'call') { - t.equal(node.label(), 'nextTick'); - } - }); -}); - -test('triple dot label', function (t) { - t.plan(1); - - burrito('a.b.c(fn)', function (node) { - if (node.name === 'call') { - t.equal(node.label(), 'c'); - } - }); -}); - -test('expr label', function (t) { - t.plan(1); - - burrito('a.b[x+1](fn)', function (node) { - if (node.name === 'call') { - t.ok(node.label() === null); - } - }); -}); diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/test/microwave.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/test/microwave.js deleted file mode 100644 index 43f80a7..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/test/microwave.js +++ /dev/null @@ -1,34 +0,0 @@ -var test = require('tap').test; -var burrito = require('../'); - -test('microwave', function (t) { - t.plan(4); - - var context = { - f : function (x) { return x + 1 }, - g : function (x) { return x + 2 }, - h : function (x) { return x + 3 }, - z : function (x) { - t.ok(true); // 3 times - return x * 10; - }, - }; - - var res = burrito.microwave('f(g(h(5)))', context, function (node) { - if (node.name === 'call') { - node.wrap(function (s) { - return 'z(' + s + ')'; - }); - } - }); - - t.equal(res, (((((5 + 3) * 10) + 2) * 10) + 1) * 10); -}); - -test('empty context', function (t) { - var res = burrito.microwave('Math.sin(2)', function (node) { - if (node.name === 'num') node.wrap('Math.PI / %s'); - }); - t.equal(res, 1); - t.end(); -}); diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/test/parent.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/test/parent.js deleted file mode 100644 index 2d613af..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/test/parent.js +++ /dev/null @@ -1,27 +0,0 @@ -var test = require('tap').test; -var burrito = require('../'); - -test('check parent', function (t) { - t.plan(5); - var src = 'Math.tan(0) + Math.sin(0)'; - - var res = burrito.microwave(src, function (node) { - if (node.name === 'binary') { - node.wrap('%a - %b'); - } - else if (node.name === 'num') { - t.equal(node.parent().value[0][0], 'dot'); - - var fn = node.parent().value[0][2]; - if (fn === 'sin') { - node.wrap('Math.PI / 2'); - } - else if (fn === 'tan') { - node.wrap('Math.PI / 4'); - } - else t.fail('Unknown fn'); - } - }); - - t.equal(res, Math.tan(Math.PI / 4) - Math.sin(Math.PI / 2)); // ~ 0 -}); diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/test/wrap.js b/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/test/wrap.js deleted file mode 100644 index b9eda49..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/node_modules/burrito/test/wrap.js +++ /dev/null @@ -1,159 +0,0 @@ -var test = require('tap').test; -var burrito = require('../'); -var vm = require('vm'); - -test('preserve ternary parentheses', function (t) { - var originalSource = '"anything" + (x ? y : z) + "anything"'; - var burritoSource = burrito(originalSource, function (node) { - // do nothing. we just want to check that ternary parens are persisted - }); - - var ctxt = { - x : false, - y : 'y_'+~~(Math.random()*10), - z : 'z_'+~~(Math.random()*10) - }; - - var expectedOutput = vm.runInNewContext(originalSource, ctxt); - var burritoOutput = vm.runInNewContext(burritoSource, ctxt); - - t.equal(burritoOutput, expectedOutput); - - ctxt.x = true; - - expectedOutput = vm.runInNewContext(originalSource, ctxt); - burritoOutput = vm.runInNewContext(burritoSource, ctxt); - - t.equal(burritoOutput, expectedOutput); - t.end(); -}); - -test('wrap calls', function (t) { - t.plan(20); - var src = burrito('f() && g(h())\nfoo()', function (node) { - if (node.name === 'call') node.wrap('qqq(%s)'); - if (node.name === 'binary') node.wrap('bbb(%s)'); - t.ok(node.state); - t.equal(this, node.state); - }); - - var times = { bbb : 0, qqq : 0 }; - - var res = []; - vm.runInNewContext(src, { - bbb : function (x) { - times.bbb ++; - res.push(x); - return x; - }, - qqq : function (x) { - times.qqq ++; - res.push(x); - return x; - }, - f : function () { return true }, - g : function (h) { - t.equal(h, 7); - return h !== 7 - }, - h : function () { return 7 }, - foo : function () { return 'foo!' }, - }); - - t.same(res, [ - true, // f() - 7, // h() - false, // g(h()) - false, // f() && g(h()) - 'foo!', // foo() - ]); - t.equal(times.bbb, 1); - t.equal(times.qqq, 4); - t.end(); -}); - -test('wrap fn', function (t) { - var src = burrito('f(g(h(5)))', function (node) { - if (node.name === 'call') { - node.wrap(function (s) { - return 'z(' + s + ')'; - }); - } - }); - - var times = 0; - t.equal( - vm.runInNewContext(src, { - f : function (x) { return x + 1 }, - g : function (x) { return x + 2 }, - h : function (x) { return x + 3 }, - z : function (x) { - times ++; - return x * 10; - }, - }), - (((((5 + 3) * 10) + 2) * 10) + 1) * 10 - ); - t.equal(times, 3); - t.end(); -}); - -test('binary string', function (t) { - var src = 'z(x + y)'; - var context = { - x : 3, - y : 4, - z : function (n) { return n * 10 }, - }; - - var res = burrito.microwave(src, context, function (node) { - if (node.name === 'binary') { - node.wrap('%a*2 - %b*2'); - } - }); - - t.equal(res, 10 * (3*2 - 4*2)); - t.end(); -}); - -test('binary fn', function (t) { - var src = 'z(x + y)'; - var context = { - x : 3, - y : 4, - z : function (n) { return n * 10 }, - }; - - var res = burrito.microwave(src, context, function (node) { - if (node.name === 'binary') { - node.wrap(function (expr, a, b) { - return '(' + a + ')*2 - ' + '(' + b + ')*2'; - }); - } - }); - - t.equal(res, 10 * (3*2 - 4*2)); - t.end(); -}); - -test('intersperse', function (t) { - var src = '(' + (function () { - f(); - g(); - }).toString() + ')()'; - - var times = { f : 0, g : 0, zzz : 0 }; - - var context = { - f : function () { times.f ++ }, - g : function () { times.g ++ }, - zzz : function () { times.zzz ++ }, - }; - - burrito.microwave(src, context, function (node) { - if (node.name === 'stat') node.wrap('{ zzz(); %s }'); - }); - - t.same(times, { f : 1, g : 1, zzz : 3 }); - t.end(); -}); diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/package.json b/tests/qunit/node_modules/qunit/node_modules/bunker/package.json deleted file mode 100644 index 5edbd79..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "bunker", - "version": "0.1.2", - "description": "code coverage in native javascript", - "main": "index.js", - "directories": { - "lib": ".", - "example": "example", - "test": "test" - }, - "dependencies": { - "burrito": ">=0.2.5 <0.3" - }, - "devDependencies": { - "tap": "~0.2.4" - }, - "scripts": { - "test": "tap test/*.js" - }, - "repository": { - "type": "git", - "url": "http://github.com/substack/node-bunker.git" - }, - "keywords": [ - "code", - "coverage" - ], - "author": { - "name": "James Halliday", - "email": "mail@substack.net", - "url": "http://substack.net" - }, - "license": "MIT/X11", - "engine": { - "node": ">=0.4" - }, - "readme": "bunker\n======\n\nBunker is a module to calculate code coverage using native javascript\n[burrito](https://github.com/substack/node-burrito) AST trickery.\n\n[![build status](https://secure.travis-ci.org/substack/node-bunker.png)](http://travis-ci.org/substack/node-bunker)\n\n![code coverage](http://substack.net/images/code_coverage.png)\n\nexamples\n========\n\ntiny\n----\n\n````javascript\nvar bunker = require('bunker');\nvar b = bunker('var x = 0; for (var i = 0; i < 30; i++) { x++ }');\n\nvar counts = {};\n\nb.on('node', function (node) {\n if (!counts[node.id]) {\n counts[node.id] = { times : 0, node : node };\n }\n counts[node.id].times ++;\n});\n\nb.run();\n\nObject.keys(counts).forEach(function (key) {\n var count = counts[key];\n console.log(count.times + ' : ' + count.node.source());\n});\n````\n\noutput:\n\n $ node example/tiny.js \n 1 : var x=0;\n 31 : i<30\n 30 : i++\n 30 : x++;\n 30 : x++\n\nmethods\n=======\n\nvar bunker = require('bunker');\n\nvar b = bunker(src)\n-------------------\n\nCreate a new bunker code coverageifier with some source `src`.\n\nThe bunker object `b` is an `EventEmitter` that emits `'node'` events with two\nparameters:\n\n* `node` - the [burrito](https://github.com/substack/node-burrito) node object\n* `stack` - the stack, [stackedy](https://github.com/substack/node-stackedy) style\n\nb.include(src)\n--------------\n\nInclude some source into the bunker.\n\nb.compile()\n-----------\n\nReturn the source wrapped with burrito.\n\nb.assign(context={})\n--------------------\n\nAssign the statement-tracking functions into `context`.\n\nb.run(context={})\n-----------------\n\nRun the source using `vm.runInNewContext()` with some `context`.\nThe statement-tracking functions will be added to `context` by `assign()`.\n", - "readmeFilename": "README.markdown", - "_id": "bunker@0.1.2", - "_from": "bunker@0.1.2" -} diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/test/cover.js b/tests/qunit/node_modules/qunit/node_modules/bunker/test/cover.js deleted file mode 100644 index b04795d..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/test/cover.js +++ /dev/null @@ -1,36 +0,0 @@ -var test = require('tap').test; -var bunker = require('../'); -var fs = require('fs'); - -var src = fs.readdirSync(__dirname + '/src').reduce(function (acc, file) { - acc[file] = fs.readFileSync(__dirname + '/src/' + file, 'utf8'); - return acc; -}, {}); - -test('cover', function (t) { - t.plan(1); - - var b = bunker(src['cover.js']); - var counts = {}; - - b.on('node', function (node) { - counts[node.name] = (counts[node.name] || 0) + 1; - }); - - b.run({ - setInterval : setInterval, - clearInterval : function () { - process.nextTick(function () { - t.same(counts, { - binary : 11, - 'unary-postfix' : 11, - 'var' : 2, - call : 2, // setInterval and clearInterval - stat : 1, // clearInterval - }); - }); - - return clearInterval.apply(this, arguments); - }, - }); -}); diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/test/return.js b/tests/qunit/node_modules/qunit/node_modules/bunker/test/return.js deleted file mode 100644 index 9be1700..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/test/return.js +++ /dev/null @@ -1,29 +0,0 @@ -var test = require('tap').test; -var bunker = require('../'); - -test('cover', function (t) { - t.plan(1); - - var b = bunker('(' + function () { - function foo () {} - function bar () {} - - (function () { - return foo(); - })(); - } + ')()'); - var counts = {}; - - b.on('node', function (node) { - counts[node.name] = (counts[node.name] || 0) + 1; - }); - b.run(); - - process.nextTick(function () { - t.same(counts, { - stat : 2, - call : 2, - return : 1, - }); - }); -}); diff --git a/tests/qunit/node_modules/qunit/node_modules/bunker/test/src/cover.js b/tests/qunit/node_modules/qunit/node_modules/bunker/test/src/cover.js deleted file mode 100644 index e640151..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/bunker/test/src/cover.js +++ /dev/null @@ -1,6 +0,0 @@ -var i = 0; -var iv = setInterval(function () { - if (i++ === 10) { - clearInterval(iv); - } -}, 10); diff --git a/tests/qunit/node_modules/qunit/node_modules/cli-table/.npmignore b/tests/qunit/node_modules/qunit/node_modules/cli-table/.npmignore deleted file mode 100644 index 8ec3d50..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/cli-table/.npmignore +++ /dev/null @@ -1 +0,0 @@ -lib-cov diff --git a/tests/qunit/node_modules/qunit/node_modules/cli-table/History.md b/tests/qunit/node_modules/qunit/node_modules/cli-table/History.md deleted file mode 100644 index 4f02434..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/cli-table/History.md +++ /dev/null @@ -1,5 +0,0 @@ - -0.0.1 / 2011-01-03 -================== - -Initial release diff --git a/tests/qunit/node_modules/qunit/node_modules/cli-table/Makefile b/tests/qunit/node_modules/qunit/node_modules/cli-table/Makefile deleted file mode 100644 index 479a783..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/cli-table/Makefile +++ /dev/null @@ -1,14 +0,0 @@ - -test: - @NODE_ENV=test ./support/expresso/bin/expresso \ - -I lib \ - -I support \ - -I support/should.js/lib \ - -I support/colors.js \ - $(TESTFLAGS) \ - test/*.test.js - -test-cov: - @TESTFLAGS=--cov $(MAKE) test - -.PHONY: test test-cov diff --git a/tests/qunit/node_modules/qunit/node_modules/cli-table/README.md b/tests/qunit/node_modules/qunit/node_modules/cli-table/README.md deleted file mode 100644 index 4ecf190..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/cli-table/README.md +++ /dev/null @@ -1,82 +0,0 @@ -CLI Table -========= - -This utility allows you to render unicode-aided tables on the command line from -your node.js scripts. - -![Screenshot](http://i.imgur.com/sYq4T.png) - -## Features - -- Customizable characters that constitute the table. -- Color/background styling in the header through - [colors.js](http://github.com/marak/colors.js) -- Column width customization -- Text truncation based on predefined widths -- Text alignment (left, right, center) -- Padding (left, right) -- Easy-to-use API - -## Installation - -```bash -npm install cli-table -``` - -## How to use - -```javascript -var Table = require('cli-table'); - -// instantiate -var table = new Table({ - head: ['TH 1 label', 'TH 2 label'] - , colWidths: [100, 200] -}); - -// table is an Array, so you can `push`, `unshift`, `splice` and friends -table.push( - ['First value', 'Second value'] - , ['First value', 'Second value'] -); - -// render -console.log(table.toString()); -``` - -## Running tests - -Clone the repository with all its submodules and run: - -```bash -$ make test -``` - -## Credits - -- Guillermo Rauch <guillermo@learnboost.com> ([Guille](http://github.com/guille)) - -## License - -(The MIT License) - -Copyright (c) 2010 LearnBoost <dev@learnboost.com> - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/tests/qunit/node_modules/qunit/node_modules/cli-table/examples/revs.js b/tests/qunit/node_modules/qunit/node_modules/cli-table/examples/revs.js deleted file mode 100644 index ba1d91c..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/cli-table/examples/revs.js +++ /dev/null @@ -1,41 +0,0 @@ - -/** - * Module requirements. - */ - -// this line is only needed if you refuse to use npm -require.paths.unshift(__dirname + '/../support/colors'); - -var Table = require('../lib/cli-table'); - -/** - * Example. - */ - -var table = new Table({ - head: ['Rel', 'Change', 'By', 'When'] - , colWidths: [6, 21, 25, 17] -}); - -table.push( - ['v0.1', 'Testing something cool', 'rauchg@gmail.com', '7 minutes ago'] - , ['v0.1', 'Testing something cool', 'rauchg@gmail.com', '8 minutes ago'] -); - -console.log(table.toString()); - - -var table = new Table({ - head: ['Rel', 'Change', 'By', 'When'] - , colWidths: [6, 21, 25, 17] - , style : {compact : true, 'padding-left' : 1} -}); - -table.push( - ['v0.1', 'Testing something cool', 'rauchg@gmail.com', '7 minutes ago'] - , ['v0.1', 'Testing something cool', 'rauchg@gmail.com', '8 minutes ago'] - , [] - , ['v0.1', 'Testing something cool', 'rauchg@gmail.com', '8 minutes ago'] -); - -console.log(table.toString()); \ No newline at end of file diff --git a/tests/qunit/node_modules/qunit/node_modules/cli-table/examples/table.js b/tests/qunit/node_modules/qunit/node_modules/cli-table/examples/table.js deleted file mode 100644 index 2172dde..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/cli-table/examples/table.js +++ /dev/null @@ -1,40 +0,0 @@ - -/** - * Module requirements. - */ - -// this line is only needed if you refuse to use npm -require.paths.unshift(__dirname + '/../support/colors'); - -var Table = require('../lib/cli-table'); - -/** - * Example. - */ - -var table = new Table({ - head: ['First', 'Last', 'Email', 'Twitter'] - , chars: { - 'top': '-' - , 'top-mid': '-' - , 'top-left': '-' - , 'top-right': '-' - , 'bottom': '-' - , 'bottom-mid': '-' - , 'bottom-left': '-' - , 'bottom-right': '-' - , 'left': '|' - , 'left-mid': '|' - , 'mid': '-' - , 'mid-mid': '-' - , 'right': '|' - , 'right-mid': '-' - } - , colWidths: [14, 10, 25, 17] -}); - -table.push( - ['Guillermo', 'Rauch', 'rauchg@gmail.com', 'rauchg'] -); - -console.log(table.toString()); diff --git a/tests/qunit/node_modules/qunit/node_modules/cli-table/index.js b/tests/qunit/node_modules/qunit/node_modules/cli-table/index.js deleted file mode 100644 index 1c01669..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/cli-table/index.js +++ /dev/null @@ -1,2 +0,0 @@ - -module.exports = require('./lib/cli-table'); diff --git a/tests/qunit/node_modules/qunit/node_modules/cli-table/lib/cli-table/index.js b/tests/qunit/node_modules/qunit/node_modules/cli-table/lib/cli-table/index.js deleted file mode 100644 index e395531..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/cli-table/lib/cli-table/index.js +++ /dev/null @@ -1,212 +0,0 @@ - -/** - * Module dependencies. - */ - -var utils = require('./utils') - , repeat = utils.repeat - , truncate = utils.truncate - , pad = utils.pad; - -require('colors'); - -/** - * Table constructor - * - * @param {Object} options - * @api public - */ - -function Table (options){ - this.options = utils.options({ - chars: { - 'top': '━' - , 'top-mid': '┳' - , 'top-left': '┏' - , 'top-right': '┓' - , 'bottom': '━' - , 'bottom-mid': '┻' - , 'bottom-left': '┗' - , 'bottom-right': '┛' - , 'left': '┃' - , 'left-mid': '┣' - , 'mid': '━' - , 'mid-mid': '╋' - , 'right': '┃' - , 'right-mid': '┫' - } - , truncate: '…' - , colWidths: [] - , colAligns: [] - , style: { - 'padding-left': 1 - , 'padding-right': 1 - , head: ['cyan'] - , compact : false - } - , head: [] - }, options); -}; - -/** - * Inherit from Array. - */ - -Table.prototype.__proto__ = Array.prototype; - -/** - * Width getter - * - * @return {Number} width - * @api public - */ - -Table.prototype.__defineGetter__('width', function (){ - var str = this.toString().split("\n"); - if (str.length) return str[0].length; - return 0; -}); - -/** - * Render to a string. - * - * @return {String} table representation - * @api public - */ - -Table.prototype.render -Table.prototype.toString = function (){ - var ret = '' - , options = this.options - , style = options.style - , head = options.head - , chars = options.chars - , truncater = options.truncate - , colWidths = options.colWidths || new Array(this.head.length) - , totalWidth = 0; - - if (!head.length && !this.length) return ''; - - if (!colWidths.length){ - this.slice(0).concat([head]).forEach(function(cells){ - cells.forEach(function(cell, i){ - var width = typeof cell == 'object' && cell.width != undefined - ? cell.width - : ((typeof cell == 'object' ? utils.strlen(cell.text) : utils.strlen(cell)) + (style['padding-left'] || 0) + (style['padding-right'] || 0)) - colWidths[i] = Math.max(colWidths[i] || 0, width || 0); - }); - }); - }; - - totalWidth = (colWidths.length == 1 ? colWidths[0] : colWidths.reduce( - function (a, b){ - return a + b - })) + colWidths.length + 1; - - // draws a line - function line (line, left, right, intersection){ - var width = 0 - , line = - left - + repeat(line, totalWidth - 2) - + right; - - colWidths.forEach(function (w, i){ - if (i == colWidths.length - 1) return; - width += w + 1; - line = line.substr(0, width) + intersection + line.substr(width + 1); - }); - - ret += line; - }; - - // draws the top line - function lineTop (){ - line(chars.top - , chars['top-left'] || chars.top - , chars['top-right'] || chars.top - , chars['top-mid']); - ret += "\n"; - }; - - // renders a string, by padding it or truncating it - function string (str, index){ - var str = String(typeof str == 'object' && str.text ? str.text : str) - , length = utils.strlen(str) - , width = colWidths[index] - - (style['padding-left'] || 0) - - (style['padding-right'] || 0) - , align = options.colAligns[index] || 'left'; - - return repeat(' ', style['padding-left'] || 0) - + (length == width ? str : - (length < width - ? pad(str, ( width + (str.length - length) ), ' ', align == 'left' ? 'right' : - (align == 'middle' ? 'both' : 'left')) - : (truncater ? truncate(str, width, truncater) : str)) - ) - + repeat(' ', style['padding-right'] || 0); - }; - - if (head.length){ - lineTop(); - - ret += chars.left; - - head.forEach(function (th, index){ - var text = string(th, index); - if (style.head){ - style.head.forEach(function(style){ - text = text[style]; - }); - } - - ret += text; - ret += chars.right; - }); - - ret += "\n"; - } - - if (this.length) - this.forEach(function (cells, i){ - if (!head.length && i == 0) - lineTop(); - else { - if (!style.compact || i<(!!head.length) ?1:0 || cells.length == 0){ - line(chars.mid - , chars['left-mid'] - , chars['right-mid'] - , chars['mid-mid']); - - ret += "\n" - } - if (!cells.length) - return; - - ret += chars.left; - - cells.forEach(function(cell, i){ - ret += string(cell, i); - ret += chars.right; - }); - - ret += "\n"; - } - }); - - line(chars.bottom - , chars['bottom-left'] || chars.bottom - , chars['bottom-right'] || chars.bottom - , chars['bottom-mid']); - - return ret; -}; - -/** - * Module exports. - */ - -module.exports = Table; - -module.exports.version = '0.0.1'; diff --git a/tests/qunit/node_modules/qunit/node_modules/cli-table/lib/cli-table/utils.js b/tests/qunit/node_modules/qunit/node_modules/cli-table/lib/cli-table/utils.js deleted file mode 100644 index 2990c84..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/cli-table/lib/cli-table/utils.js +++ /dev/null @@ -1,95 +0,0 @@ - -/** - * Repeats a string. - * - * @param {String} char(s) - * @param {Number} number of times - * @return {String} repeated string - */ - -exports.repeat = function (str, times){ - return Array(times + 1).join(str); -}; - -/** - * Pads a string - * - * @api public - */ - -exports.pad = function (str, len, pad, dir) { - if (len + 1 >= str.length) - switch (dir){ - case 'left': - str = Array(len + 1 - str.length).join(pad) + str; - break; - - case 'both': - var right = Math.ceil((padlen = len - str.length) / 2); - var left = padlen - right; - str = Array(left + 1).join(pad) + str + Array(right + 1).join(pad); - break; - - default: - str = str + Array(len + 1 - str.length).join(pad); - }; - - return str; -}; - -/** - * Truncates a string - * - * @api public - */ - -exports.truncate = function (str, length, chr){ - chr = chr || '…'; - return str.length >= length ? str.substr(0, length - chr.length) + chr : str; -}; - -/** - * Copies and merges options with defaults. - * - * @param {Object} defaults - * @param {Object} supplied options - * @return {Object} new (merged) object - */ - -function clone(a){ - var b; - if (Array.isArray(a)){ - b = []; - for (var i = 0, l = a.length; i < l; i++) - b.push(typeof a[i] == 'object' ? clone(a[i]) : a[i]); - return b; - } else if (typeof a == 'object'){ - b = {}; - for (var i in a) - b[i] = typeof a[i] == 'object' ? clone(a[i]) : a[i]; - return b; - } - return a; -}; - -exports.options = function (defaults, opts){ - var c = clone(opts); - for (var i in defaults) - if (!(i in opts)) - c[i] = defaults[i]; - return c; -}; - - -// -// For consideration of terminal "color" programs like colors.js, -// which can add ANSI escape color codes to strings, -// we destyle the ANSI color escape codes for padding calculations. -// -// see: http://en.wikipedia.org/wiki/ANSI_escape_code -// -exports.strlen = function(str){ - var code = /\u001b\[\d+m/g; - var stripped = ("" + str).replace(code,''); - return stripped.length; -} diff --git a/tests/qunit/node_modules/qunit/node_modules/cli-table/node_modules/colors/MIT-LICENSE.txt b/tests/qunit/node_modules/qunit/node_modules/cli-table/node_modules/colors/MIT-LICENSE.txt deleted file mode 100644 index 94a870b..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/cli-table/node_modules/colors/MIT-LICENSE.txt +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2010 Marak Squires http://github.com/marak/say.js/ - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tests/qunit/node_modules/qunit/node_modules/cli-table/node_modules/colors/ReadMe.md b/tests/qunit/node_modules/qunit/node_modules/cli-table/node_modules/colors/ReadMe.md deleted file mode 100644 index 4d965e3..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/cli-table/node_modules/colors/ReadMe.md +++ /dev/null @@ -1,30 +0,0 @@ -

colors.js - get color and style in your node.js console like what

- - - - var sys = require('sys'); - var colors = require('./colors'); - - sys.puts('hello'.green); // outputs green text - sys.puts('i like cake and pies'.underline.red) // outputs red underlined text - sys.puts('inverse the color'.inverse); // inverses the color - sys.puts('OMG Rainbows!'.rainbow); // rainbow (ignores spaces) - -

colors and styles!

-- bold -- italic -- underline -- inverse -- yellow -- cyan -- white -- magenta -- green -- red -- grey -- blue - - -### Authors - -#### Alexis Sellier (cloudhead) , Marak Squires , Justin Campbell diff --git a/tests/qunit/node_modules/qunit/node_modules/cli-table/node_modules/colors/colors.js b/tests/qunit/node_modules/qunit/node_modules/cli-table/node_modules/colors/colors.js deleted file mode 100644 index c56ff20..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/cli-table/node_modules/colors/colors.js +++ /dev/null @@ -1,75 +0,0 @@ -/* -colors.js - -Copyright (c) 2010 Alexis Sellier (cloudhead) , Marak Squires - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -*/ - -// prototypes the string object to have additional method calls that add terminal colors -['bold', 'underline', 'italic', 'inverse', 'grey', 'yellow', 'red', 'green', 'blue', 'white', 'cyan', 'magenta'].forEach(function (style) { - Object.defineProperty(String.prototype, style, { - get: function () { - return stylize(this, style); - } - }); -}); - -// prototypes string with method "rainbow" -// rainbow will apply a the color spectrum to a string, changing colors every letter -Object.defineProperty(String.prototype, 'rainbow', { - get: function () { - var rainbowcolors = ['red','yellow','green','blue','magenta']; //RoY G BiV - var exploded = this.split(""); - var i=0; - exploded = exploded.map(function(letter) { - if (letter==" ") { - return letter; - } - else { - return stylize(letter,rainbowcolors[i++ % rainbowcolors.length]); - } - }); - return exploded.join(""); - } -}); - -function stylize(str, style) { - var styles = { - //styles - 'bold' : [1, 22], - 'italic' : [3, 23], - 'underline' : [4, 24], - 'inverse' : [7, 27], - //grayscale - 'white' : [37, 39], - 'grey' : [90, 39], - 'black' : [90, 39], - //colors - 'blue' : [34, 39], - 'cyan' : [36, 39], - 'green' : [32, 39], - 'magenta' : [35, 39], - 'red' : [31, 39], - 'yellow' : [33, 39] - }; - return '\033[' + styles[style][0] + 'm' + str + - '\033[' + styles[style][1] + 'm'; -}; \ No newline at end of file diff --git a/tests/qunit/node_modules/qunit/node_modules/cli-table/node_modules/colors/example.js b/tests/qunit/node_modules/qunit/node_modules/cli-table/node_modules/colors/example.js deleted file mode 100644 index 5c08c9c..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/cli-table/node_modules/colors/example.js +++ /dev/null @@ -1,6 +0,0 @@ -var sys = require('sys'); -var colors = require('./colors'); - -sys.puts('Rainbows are fun!'.rainbow); -sys.puts('So '.italic + 'are'.underline + ' styles! '.bold + 'inverse'.inverse); // styles not widely supported -sys.puts('Chains are also cool.'.bold.italic.underline.red); // styles not widely supported \ No newline at end of file diff --git a/tests/qunit/node_modules/qunit/node_modules/cli-table/node_modules/colors/package.json b/tests/qunit/node_modules/qunit/node_modules/cli-table/node_modules/colors/package.json deleted file mode 100644 index 8239635..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/cli-table/node_modules/colors/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "colors", - "description": "get colors in your node.js console like what", - "version": "0.3.0", - "author": { - "name": "Marak Squires" - }, - "repository": { - "type": "git", - "url": "http://github.com/Marak/colors.js.git" - }, - "engine": [ - "node >=0.1.90" - ], - "main": "colors", - "readme": "

colors.js - get color and style in your node.js console like what

\n\n\n\n var sys = require('sys');\n var colors = require('./colors');\n\n sys.puts('hello'.green); // outputs green text\n sys.puts('i like cake and pies'.underline.red) // outputs red underlined text\n sys.puts('inverse the color'.inverse); // inverses the color\n sys.puts('OMG Rainbows!'.rainbow); // rainbow (ignores spaces)\n \n

colors and styles!

\n- bold\n- italic\n- underline\n- inverse\n- yellow\n- cyan\n- white\n- magenta\n- green\n- red\n- grey\n- blue\n\n\n### Authors \n\n#### Alexis Sellier (cloudhead) , Marak Squires , Justin Campbell\n", - "readmeFilename": "ReadMe.md", - "_id": "colors@0.3.0", - "_from": "colors@0.3.0" -} diff --git a/tests/qunit/node_modules/qunit/node_modules/cli-table/package.json b/tests/qunit/node_modules/qunit/node_modules/cli-table/package.json deleted file mode 100644 index 68def1d..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/cli-table/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "cli-table", - "description": "Pretty unicode tables for the CLI", - "version": "0.0.2", - "author": { - "name": "Guillermo Rauch", - "email": "guillermo@learnboost.com" - }, - "keywords": [ - "cli", - "colors", - "table" - ], - "dependencies": { - "colors": "0.3.0" - }, - "main": "./index.js", - "engines": { - "node": ">= 0.2.0" - }, - "readme": "CLI Table\n=========\n\nThis utility allows you to render unicode-aided tables on the command line from\nyour node.js scripts.\n\n![Screenshot](http://i.imgur.com/sYq4T.png)\n\n## Features\n\n- Customizable characters that constitute the table.\n- Color/background styling in the header through\n [colors.js](http://github.com/marak/colors.js)\n- Column width customization\n- Text truncation based on predefined widths\n- Text alignment (left, right, center)\n- Padding (left, right)\n- Easy-to-use API\n\n## Installation\n\n```bash \nnpm install cli-table\n```\n\n## How to use\n\n```javascript\nvar Table = require('cli-table');\n\n// instantiate\nvar table = new Table({\n head: ['TH 1 label', 'TH 2 label']\n , colWidths: [100, 200]\n});\n\n// table is an Array, so you can `push`, `unshift`, `splice` and friends\ntable.push(\n ['First value', 'Second value']\n , ['First value', 'Second value']\n);\n\n// render\nconsole.log(table.toString());\n```\n\n## Running tests\n\nClone the repository with all its submodules and run:\n\n```bash\n$ make test\n```\n\n## Credits\n\n- Guillermo Rauch <guillermo@learnboost.com> ([Guille](http://github.com/guille))\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2010 LearnBoost <dev@learnboost.com>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.", - "readmeFilename": "README.md", - "_id": "cli-table@0.0.2", - "_from": "cli-table@0.0.2" -} diff --git a/tests/qunit/node_modules/qunit/node_modules/cli-table/test/common.js b/tests/qunit/node_modules/qunit/node_modules/cli-table/test/common.js deleted file mode 100644 index 9b65e08..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/cli-table/test/common.js +++ /dev/null @@ -1,6 +0,0 @@ - -/** - * Module dependencies. - */ - -require('should'); diff --git a/tests/qunit/node_modules/qunit/node_modules/cli-table/test/index.test.js b/tests/qunit/node_modules/qunit/node_modules/cli-table/test/index.test.js deleted file mode 100644 index 2711e11..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/cli-table/test/index.test.js +++ /dev/null @@ -1,52 +0,0 @@ - -/** - * Module requirements. - */ - -require('./common'); - -var Table = require('cli-table'); - -/** - * Tests. - */ - -module.exports = { - - 'test complete table': function (){ - var table = new Table({ - head: ['Rel', 'Change', 'By', 'When'] - , style: { - 'padding-left': 1 - , 'padding-right': 1 - } - , colWidths: [6, 21, 25, 17] - }); - - table.push( - ['v0.1', 'Testing something cool', 'rauchg@gmail.com', '7 minutes ago'] - , ['v0.1', 'Testing something cool', 'rauchg@gmail.com', '8 minutes ago'] - ); - - var expected = [ - '┏━━━━━━┳━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓' - , '┃ Rel ┃ Change ┃ By ┃ When ┃' - , '┣━━━━━━╋━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━┫' - , '┃ v0.1 ┃ Testing something … ┃ rauchg@gmail.com ┃ 7 minutes ago ┃' - , '┣━━━━━━╋━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━┫' - , '┃ v0.1 ┃ Testing something … ┃ rauchg@gmail.com ┃ 8 minutes ago ┃' - , '┗━━━━━━┻━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━┛' - ]; - - table.toString().should.eql(expected.join("\n")); - }, - - 'test width property': function (){ - var table = new Table({ - head: ['Cool'] - }); - - table.width.should.eql(8); - } - -}; diff --git a/tests/qunit/node_modules/qunit/node_modules/tracejs/README.md b/tests/qunit/node_modules/qunit/node_modules/tracejs/README.md deleted file mode 100644 index ad98caf..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/tracejs/README.md +++ /dev/null @@ -1,102 +0,0 @@ -Trace.js -======== - -Providing better stack traces for V8 by giving you full-fledged objects for each frame in the trace. - -Examples -======== - -Creating a nice color trace with context, reversed so that the latest call is printed last: - -````javascript -var trace = require('tracejs').trace; - -try { - somethingThatThrowsAnError(); -} catch(err) { - var stacktrace = trace(err); - console.error(stacktrace.toString()); -} -```` - -Iterating through frames and grabbing the constituent files: - -````javascript -var trace = require('tracejs').trace; - -try { - somethingThatThrowsAnError(); -} catch(err) { - var stacktrace = trace(err); - for(var i = 0, len = stacktrace.frames.length; i < len; ++i) { - console.error(stacktrace.frames[i].filename, stacktrace.frames[i].filedata()); - } -} -```` - -API -=== - -trace(err) ------ - -Creates and returns a `Trace` object by parsing an `Error` object. - -object Trace ------------- - -Holds the original error, the first line of the trace (the message), and the frames that make up the stack trace. Returned by `trace`. - -Members: - -* `frames`: an `Array` of `Frame` objects. -* `first_line`: the first line of the original stack trace -- usually contains the error message, if any. -* `original_error`: the original `Error` object that the `Trace` was generated from. - -The default output of `Trace#toString` looks like the following: - -![trace](http://neversaw.us/media/traces.png) - -Trace.defaults --------------- - -The default printing mode for the trace; an array of `[context_lines:int, `print_cursor:boolean`, `highlight_character_color:string`]. -Defaults to two lines of context with a cursor, with the character that caused the error appearing red. - -Trace#toString(reversed[, contextLines, showCursor, highlightErrorCharacterColor]) --------------- - -Returns the prettified stack trace as a string, using `Trace.defaults`. `reversed` defaults to `true`, meaning the most recent call is displayed last. The remaining arguments are passed to `Frame#toString` for each frame in `Trace#frames`. - -object Frame ------------- - -Contains information about a specific stack frame. - -Members: - -* `named_location`: The name of the scope where the frame originated; e.g., `'ReadStream.emit'`. -* `filename`: The filename of the frame. -* `line`: The integer line number of the frame. -* `character`: The character at which the error occurred in the line of the frame. - -Frame#filedata() --------------- - -Returns a string containing the text of the file the frame originated from. Works on both native modules as well as userland modules. Cached and synchronous. - -Frame#toString([contextLines, showCursor, highlightErrorCharacterColor]) ---------------- - -Wraps the output from `Frame#get_lines()` with information about the file, line number, character, and scope if available. - -Frame#get_lines(context, ascii_cursor, highlight_error_start) ---------------- - -Returns a string containing `context` lines surrounding the error line from the file of this frame. If `ascii_cursor` is `true`, it will -insert a `>` at the line where the error occurred, and a space before all other lines. `highlight_error_start` can be any value that [ansi-colors](https://github.com/loopj/commonjs-ansi-color) will accept, or false to avoid highlighting the character. - -License -======= - -new BSD. diff --git a/tests/qunit/node_modules/qunit/node_modules/tracejs/package.json b/tests/qunit/node_modules/qunit/node_modules/tracejs/package.json deleted file mode 100644 index 687aff1..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/tracejs/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "author": { - "name": "Chris Dickinson", - "email": "chris@neversaw.us", - "url": "http://neversaw.us/" - }, - "name": "tracejs", - "description": "Expand Error.stack traces into usable objects providing context and highlighting", - "version": "0.1.4", - "homepage": "http://github.com/chrisdickinson/tracejs/", - "repository": { - "type": "git", - "url": "git://github.com/chrisdickinson/tracejs.git" - }, - "scripts": { - "test": "node test/test.js" - }, - "main": "trace.js", - "engines": { - "node": ">=0.4.0" - }, - "dependencies": {}, - "devDependencies": {}, - "readme": "Trace.js\n========\n\nProviding better stack traces for V8 by giving you full-fledged objects for each frame in the trace.\n\nExamples\n========\n\nCreating a nice color trace with context, reversed so that the latest call is printed last:\n\n````javascript\nvar trace = require('tracejs').trace;\n\ntry {\n somethingThatThrowsAnError();\n} catch(err) {\n var stacktrace = trace(err);\n console.error(stacktrace.toString());\n}\n````\n\nIterating through frames and grabbing the constituent files:\n\n````javascript\nvar trace = require('tracejs').trace;\n\ntry {\n somethingThatThrowsAnError();\n} catch(err) {\n var stacktrace = trace(err);\n for(var i = 0, len = stacktrace.frames.length; i < len; ++i) {\n console.error(stacktrace.frames[i].filename, stacktrace.frames[i].filedata());\n }\n}\n````\n\nAPI\n===\n\ntrace(err)\n-----\n\nCreates and returns a `Trace` object by parsing an `Error` object.\n\nobject Trace\n------------\n\nHolds the original error, the first line of the trace (the message), and the frames that make up the stack trace. Returned by `trace`.\n\nMembers:\n\n* `frames`: an `Array` of `Frame` objects.\n* `first_line`: the first line of the original stack trace -- usually contains the error message, if any.\n* `original_error`: the original `Error` object that the `Trace` was generated from.\n\nThe default output of `Trace#toString` looks like the following:\n\n![trace](http://neversaw.us/media/traces.png)\n\nTrace.defaults\n--------------\n\nThe default printing mode for the trace; an array of `[context_lines:int, `print_cursor:boolean`, `highlight_character_color:string`].\nDefaults to two lines of context with a cursor, with the character that caused the error appearing red.\n\nTrace#toString(reversed[, contextLines, showCursor, highlightErrorCharacterColor])\n--------------\n\nReturns the prettified stack trace as a string, using `Trace.defaults`. `reversed` defaults to `true`, meaning the most recent call is displayed last. The remaining arguments are passed to `Frame#toString` for each frame in `Trace#frames`. \n\nobject Frame\n------------ \n\nContains information about a specific stack frame.\n\nMembers:\n\n* `named_location`: The name of the scope where the frame originated; e.g., `'ReadStream.emit'`.\n* `filename`: The filename of the frame.\n* `line`: The integer line number of the frame.\n* `character`: The character at which the error occurred in the line of the frame.\n\nFrame#filedata()\n--------------\n\nReturns a string containing the text of the file the frame originated from. Works on both native modules as well as userland modules. Cached and synchronous.\n\nFrame#toString([contextLines, showCursor, highlightErrorCharacterColor])\n---------------\n\nWraps the output from `Frame#get_lines()` with information about the file, line number, character, and scope if available.\n\nFrame#get_lines(context, ascii_cursor, highlight_error_start)\n---------------\n\nReturns a string containing `context` lines surrounding the error line from the file of this frame. If `ascii_cursor` is `true`, it will\ninsert a `>` at the line where the error occurred, and a space before all other lines. `highlight_error_start` can be any value that [ansi-colors](https://github.com/loopj/commonjs-ansi-color) will accept, or false to avoid highlighting the character.\n\nLicense\n=======\n\nnew BSD.\n", - "readmeFilename": "README.md", - "_id": "tracejs@0.1.4", - "_from": "tracejs@0.1.4" -} diff --git a/tests/qunit/node_modules/qunit/node_modules/tracejs/test/fixture/example.js b/tests/qunit/node_modules/qunit/node_modules/tracejs/test/fixture/example.js deleted file mode 100644 index bec73d5..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/tracejs/test/fixture/example.js +++ /dev/null @@ -1,7 +0,0 @@ -exports.unnamed = function(text) { - throw new Error(text); -}; - -exports.named = function named(text) { - throw new Error(text); -}; diff --git a/tests/qunit/node_modules/qunit/node_modules/tracejs/test/test.js b/tests/qunit/node_modules/qunit/node_modules/tracejs/test/test.js deleted file mode 100644 index 652caad..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/tracejs/test/test.js +++ /dev/null @@ -1,66 +0,0 @@ -var assert = require('assert'); - -var fixture = require('./fixture/example'); - -var unnamed = fixture.unnamed, - named = fixture.named; - - -var trace = require('../trace').trace; - -var expected = 'random_'+~~(Math.random()*100) - -var local_unnamed = function(text) { - throw new Error(text); -}; - -try { - local_unnamed(expected); -} catch(err) { - var traced = trace(err); - assert.equal(traced.frames.length, err.stack.split('\n').length - 1); - assert.equal(traced.frames[0].named_location, ''); - - assert.equal(traced.first_line, err.stack.split('\n')[0]); - assert.strictEqual(traced.original_error, err); - - var lines = err.stack.split('\n').slice(1); - for(var i = 0, len = lines.length; i < len; ++i) { - assert.notStrictEqual(lines[i].indexOf(traced.frames[i].line + ':' + traced.frames[i].character), -1); - assert.notStrictEqual(lines[i].indexOf(traced.frames[i].filename), -1); - } -} - -try { - unnamed(expected); -} catch(err) { - var traced = trace(err); - assert.equal(traced.frames.length, err.stack.split('\n').length - 1); - - assert.equal(traced.first_line, err.stack.split('\n')[0]); - assert.strictEqual(traced.original_error, err); - - var lines = err.stack.split('\n').slice(1); - for(var i = 0, len = lines.length; i < len; ++i) { - assert.notStrictEqual(lines[i].indexOf(traced.frames[i].line + ':' + traced.frames[i].character), -1); - assert.notStrictEqual(lines[i].indexOf(traced.frames[i].filename), -1); - } -} - -try { - named(expected); -} catch(err) { - var traced = trace(err); - assert.equal(traced.frames.length, err.stack.split('\n').length - 1); - - assert.equal(traced.first_line, err.stack.split('\n')[0]); - assert.strictEqual(traced.original_error, err); - - var lines = err.stack.split('\n').slice(1); - for(var i = 0, len = lines.length; i < len; ++i) { - assert.notStrictEqual(lines[i].indexOf(traced.frames[i].line + ':' + traced.frames[i].character), -1); - assert.notStrictEqual(lines[i].indexOf(traced.frames[i].filename), -1); - } -} - -console.error('Tests passed'); diff --git a/tests/qunit/node_modules/qunit/node_modules/tracejs/trace.js b/tests/qunit/node_modules/qunit/node_modules/tracejs/trace.js deleted file mode 100644 index 8701c41..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/tracejs/trace.js +++ /dev/null @@ -1,234 +0,0 @@ -var fs = require('fs'), - tty = require('tty'), - natives = process.binding('natives'); - -var is_tty = function() { - return tty.isatty(process.stdout.fd) && tty.isatty(process.stderr.fd); -}; - -var Color = function(code) { - this.code = code; -}; - -Color.prototype.start = function() { - Color.stack.push(this); - return '\033['+this.code+'m'; -}; - -Color.prototype.end = function() { - Color.stack.pop(); - return '\033['+Color.stack[Color.stack.length-1].code+'m'; -}; - -Color.prototype.wrap = function(text) { - return this.start() + text + this.end(); -}; - -var color = is_tty() ? - function(code) { - return new Color(code); - } : - function(code) { - return { - start:function(){return ''}, - end:function(){return ''}, - wrap:function(text){ return text; } - } - }; - -var colors = { - off:color(0), - bold:color(1), - italic:color(3), - underline:color(4), - blink:color(5), - inverse:color(7), - hidden:color(8), - black:color(30), - red:color(31), - green:color(32), - yellow:color(33), - blue:color(34), - magenta:color(35), - cyan:color(36), - white:color(37), - black_bg:color(40), - red_bg:color(41), - green_bg:color(42), - yellow_bg:color(43), - blue_bg:color(44), - magenta_bg:color(45), - cyan_bg:color(46), - white_bg:color(47) -}; - -Color.stack = [colors.off]; - - -var err_re1 = / at (.*?) \(([\w\d\._\-\/]+):(\d+):(\d+)\)/, - err_re2 = / at ([^:]+):(\d+):(\d+)/; - -var Trace = function(first_line, frames, original_error) { - this.first_line = first_line; - this.frames = frames; - this.original_error = original_error; -}; - -Trace.defaults = [2, true, 'red']; - -Trace.prototype.toString = function(reversed) { - reversed === undefined && (reversed = true); - var args = [].slice.call(arguments, 1); - args.length === 0 && (args = Trace.defaults.slice()); - - var frame_data = [this.first_line, '======\n'].concat(this.frames.map(function(frame) { - return frame.toString.apply(frame, args); - })); - - if(reversed) - frame_data = frame_data.reverse(); - - return frame_data.join(''); -}; - -var Frame = function(named_location, filename, line, character) { - this.named_location = named_location; - this.filename = filename; - this.line = line; - this.character = character; - this._filedata = null; -}; - -Frame.prototype.load_file_native = function() { - var base_name = this.filename.replace(/\.js$/g, ''), - data = natives[base_name] || ''; - - return data; -}; - -Frame.prototype.load_file_path = function() { - try { - return fs.readFileSync(this.filename, 'utf8').toString(); - } catch(err) { - return ''; - } -}; - -Frame.prototype.filedata = function() { - if(this._filedata) - return this._filedata; - - if(this.filename.indexOf('/') === -1) { - this._filedata = this.load_file_native(); - } else { - this._filedata = this.load_file_path(); - } - return this._filedata; -}; - -Frame.prototype.toString = function() { - var args = [].slice.call(arguments); - return [ - 'file ', - colors.cyan.wrap('"'+this.filename.replace(process.cwd(), '.')+'"'), - ' line ', - colors.red.wrap( - colors.bold.wrap( - this.line - ) - ), - ', char ', - colors.red.wrap( - colors.bold.wrap( - this.character - ) - ), - ', in ', - colors.cyan.wrap(this.named_location), - ':\n', - colors.yellow.wrap(this.get_lines.apply(this, args)), - '\n' - ].join(''); -}; - -Frame.prototype.get_lines = function(context, ascii_cursor, highlight_error_start) { - context = context || 0; - filedata = this.filedata().split('\n'); - - var start_line = this.line - context - 1, - end_line = this.line + context, - character = this.character; - - start_line < 0 && (start_line = 0); - var lines = filedata.slice(start_line, end_line); - - if(this.line - context < 0) { - context += (this.line - context) - 1; - } - - if(highlight_error_start) { - colors.yellow.start(); - lines = lines.map(function(line, idx) { - if(idx === context) { - line = line.split(/\b/g); - var start = 0; - line = line.map(function(word) { - var next = start + word.length; - if(character <= next && character >= start) { - word = colors[highlight_error_start].wrap(word); - } - start = next; - return word; - }).join(''); - } - return line; - }); - colors.yellow.end(); - } - if(ascii_cursor) { - lines = lines.map(function(line, idx) { - return (idx === context ? '>' : ' ') + line; - }); - } - - return lines.join('\n'); -}; - -var trace = function(err) { - if(!err) { - err = {}; - Error.captureStackTrace(err); - } - - var lines = err.stack.split('\n'), - first = lines[0], - stack = lines.slice(1); - - var frames, - match1, match2; - - frames = stack.map(function(line) { - match1 = err_re1.exec(line); - match2 = err_re2.exec(line); - - if(match1) { - return new Frame(match1[1], match1[2], parseInt(match1[3], 10), parseInt(match1[4], 10)) - } else if(match2) { - return new Frame('', match2[1], parseInt(match2[2], 10), parseInt(match2[3], 10)) - } - }); - - return new Trace(first, frames, err); -}; - -exports.trace = trace; -exports.Frame = Frame; -exports.Trace = Trace; - -exports.set_context = function(context) { - Trace.defaults[0] = context; -}; - -exports.set_add_cursor = function(tf) { - Trace.defaults[1] = tf; -}; diff --git a/tests/qunit/node_modules/qunit/node_modules/underscore/.npmignore b/tests/qunit/node_modules/qunit/node_modules/underscore/.npmignore deleted file mode 100644 index 2ce2684..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/underscore/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -test/ -Rakefile -docs/ \ No newline at end of file diff --git a/tests/qunit/node_modules/qunit/node_modules/underscore/CNAME b/tests/qunit/node_modules/qunit/node_modules/underscore/CNAME deleted file mode 100644 index a007e65..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/underscore/CNAME +++ /dev/null @@ -1 +0,0 @@ -underscorejs.org diff --git a/tests/qunit/node_modules/qunit/node_modules/underscore/LICENSE b/tests/qunit/node_modules/qunit/node_modules/underscore/LICENSE deleted file mode 100644 index 61d28c0..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/underscore/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) 2009-2012 Jeremy Ashkenas, DocumentCloud - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/tests/qunit/node_modules/qunit/node_modules/underscore/README.md b/tests/qunit/node_modules/qunit/node_modules/underscore/README.md deleted file mode 100644 index a6564a2..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/underscore/README.md +++ /dev/null @@ -1,19 +0,0 @@ - __ - /\ \ __ - __ __ ___ \_\ \ __ _ __ ____ ___ ___ _ __ __ /\_\ ____ - /\ \/\ \ /' _ `\ /'_ \ /'__`\/\ __\/ ,__\ / ___\ / __`\/\ __\/'__`\ \/\ \ /',__\ - \ \ \_\ \/\ \/\ \/\ \ \ \/\ __/\ \ \//\__, `\/\ \__//\ \ \ \ \ \//\ __/ __ \ \ \/\__, `\ - \ \____/\ \_\ \_\ \___,_\ \____\\ \_\\/\____/\ \____\ \____/\ \_\\ \____\/\_\ _\ \ \/\____/ - \/___/ \/_/\/_/\/__,_ /\/____/ \/_/ \/___/ \/____/\/___/ \/_/ \/____/\/_//\ \_\ \/___/ - \ \____/ - \/___/ - -Underscore.js is a utility-belt library for JavaScript that provides -support for the usual functional suspects (each, map, reduce, filter...) -without extending any core JavaScript objects. - -For Docs, License, Tests, and pre-packed downloads, see: -http://documentcloud.github.com/underscore/ - -Many thanks to our contributors: -https://github.com/documentcloud/underscore/contributors diff --git a/tests/qunit/node_modules/qunit/node_modules/underscore/favicon.ico b/tests/qunit/node_modules/qunit/node_modules/underscore/favicon.ico deleted file mode 100644 index 03049683875ee7207b4ee62241fc6977956723c7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1406 zcmZQzU<5(|0R|w+!H~hqz#zuJz@P!dKp_SNAO?x!16vCj7#y|msTh?T4S~@R7;Yi( a|NnmmMkru{0(Aax^D{300E2>o91H*{%ptM> diff --git a/tests/qunit/node_modules/qunit/node_modules/underscore/index.html b/tests/qunit/node_modules/qunit/node_modules/underscore/index.html deleted file mode 100644 index 01c18ac..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/underscore/index.html +++ /dev/null @@ -1,2109 +0,0 @@ - - - - - - - Underscore.js - - - - - - -
- -

- Underscore.js -

- -

- Underscore is a - utility-belt library for JavaScript that provides a lot of the - functional programming support that you would expect in - Prototype.js - (or Ruby), - but without extending any of the built-in JavaScript objects. It's the - tie to go along with jQuery's tux, - and Backbone.js's suspenders. -

- -

- Underscore provides 60-odd functions that support both the usual - functional suspects: map, select, invoke — - as well as more specialized helpers: function binding, javascript - templating, deep equality testing, and so on. It delegates to built-in - functions, if present, so modern browsers will use the - native implementations of forEach, map, reduce, - filter, every, some and indexOf. -

- -

- A complete Test & Benchmark Suite - is included for your perusal. -

- -

- You may also read through the annotated source code. -

- -

- The project is - hosted on GitHub. - You can report bugs and discuss features on the - issues page, - on Freenode in the #documentcloud channel, - or send tweets to @documentcloud. -

- -

- Underscore is an open-source component of DocumentCloud. -

- -

Downloads (Right-click, and use "Save As")

- - - - - - - - - - -
Development Version (1.3.3)37kb, Uncompressed with Plentiful Comments
Production Version (1.3.3)4kb, Minified and Gzipped
- -
Upgrade warning: versions 1.3.0 and higher remove AMD (RequireJS) support.
- -
- -

Collection Functions (Arrays or Objects)

- -

- each_.each(list, iterator, [context]) - Alias: forEach -
- Iterates over a list of elements, yielding each in turn to an iterator - function. The iterator is bound to the context object, if one is - passed. Each invocation of iterator is called with three arguments: - (element, index, list). If list is a JavaScript object, iterator's - arguments will be (value, key, list). Delegates to the native - forEach function if it exists. -

-
-_.each([1, 2, 3], function(num){ alert(num); });
-=> alerts each number in turn...
-_.each({one : 1, two : 2, three : 3}, function(num, key){ alert(num); });
-=> alerts each number in turn...
- -

- map_.map(list, iterator, [context]) - Alias: collect -
- Produces a new array of values by mapping each value in list - through a transformation function (iterator). If the native map method - exists, it will be used instead. If list is a JavaScript object, - iterator's arguments will be (value, key, list). -

-
-_.map([1, 2, 3], function(num){ return num * 3; });
-=> [3, 6, 9]
-_.map({one : 1, two : 2, three : 3}, function(num, key){ return num * 3; });
-=> [3, 6, 9]
- -

- reduce_.reduce(list, iterator, memo, [context]) - Aliases: inject, foldl -
- Also known as inject and foldl, reduce boils down a - list of values into a single value. Memo is the initial state - of the reduction, and each successive step of it should be returned by - iterator. -

-
-var sum = _.reduce([1, 2, 3], function(memo, num){ return memo + num; }, 0);
-=> 6
-
- -

- reduceRight_.reduceRight(list, iterator, memo, [context]) - Alias: foldr -
- The right-associative version of reduce. Delegates to the - JavaScript 1.8 version of reduceRight, if it exists. Foldr - is not as useful in JavaScript as it would be in a language with lazy - evaluation. -

-
-var list = [[0, 1], [2, 3], [4, 5]];
-var flat = _.reduceRight(list, function(a, b) { return a.concat(b); }, []);
-=> [4, 5, 2, 3, 0, 1]
-
- -

- find_.find(list, iterator, [context]) - Alias: detect -
- Looks through each value in the list, returning the first one that - passes a truth test (iterator). The function returns as - soon as it finds an acceptable element, and doesn't traverse the - entire list. -

-
-var even = _.find([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; });
-=> 2
-
- -

- filter_.filter(list, iterator, [context]) - Alias: select -
- Looks through each value in the list, returning an array of all - the values that pass a truth test (iterator). Delegates to the - native filter method, if it exists. -

-
-var evens = _.filter([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; });
-=> [2, 4, 6]
-
- -

- reject_.reject(list, iterator, [context]) -
- Returns the values in list without the elements that the truth - test (iterator) passes. The opposite of filter. -

-
-var odds = _.reject([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; });
-=> [1, 3, 5]
-
- -

- all_.all(list, iterator, [context]) - Alias: every -
- Returns true if all of the values in the list pass the iterator - truth test. Delegates to the native method every, if present. -

-
-_.all([true, 1, null, 'yes'], _.identity);
-=> false
-
- -

- any_.any(list, [iterator], [context]) - Alias: some -
- Returns true if any of the values in the list pass the - iterator truth test. Short-circuits and stops traversing the list - if a true element is found. Delegates to the native method some, - if present. -

-
-_.any([null, 0, 'yes', false]);
-=> true
-
- -

- include_.include(list, value) - Alias: contains -
- Returns true if the value is present in the list, using - === to test equality. Uses indexOf internally, if list - is an Array. -

-
-_.include([1, 2, 3], 3);
-=> true
-
- -

- invoke_.invoke(list, methodName, [*arguments]) -
- Calls the method named by methodName on each value in the list. - Any extra arguments passed to invoke will be forwarded on to the - method invocation. -

-
-_.invoke([[5, 1, 7], [3, 2, 1]], 'sort');
-=> [[1, 5, 7], [1, 2, 3]]
-
- -

- pluck_.pluck(list, propertyName) -
- A convenient version of what is perhaps the most common use-case for - map: extracting a list of property values. -

-
-var stooges = [{name : 'moe', age : 40}, {name : 'larry', age : 50}, {name : 'curly', age : 60}];
-_.pluck(stooges, 'name');
-=> ["moe", "larry", "curly"]
-
- -

- max_.max(list, [iterator], [context]) -
- Returns the maximum value in list. If iterator is passed, - it will be used on each value to generate the criterion by which the - value is ranked. -

-
-var stooges = [{name : 'moe', age : 40}, {name : 'larry', age : 50}, {name : 'curly', age : 60}];
-_.max(stooges, function(stooge){ return stooge.age; });
-=> {name : 'curly', age : 60};
-
- -

- min_.min(list, [iterator], [context]) -
- Returns the minimum value in list. If iterator is passed, - it will be used on each value to generate the criterion by which the - value is ranked. -

-
-var numbers = [10, 5, 100, 2, 1000];
-_.min(numbers);
-=> 2
-
- -

- sortBy_.sortBy(list, iterator, [context]) -
- Returns a sorted copy of list, ranked in ascending order by the - results of running each value through iterator. Iterator may - also be the string name of the property to sort by (eg. length). -

-
-_.sortBy([1, 2, 3, 4, 5, 6], function(num){ return Math.sin(num); });
-=> [5, 4, 6, 3, 1, 2]
-
- -

- groupBy_.groupBy(list, iterator) -
- Splits a collection into sets, grouped by the result of running each - value through iterator. If iterator is a string instead of - a function, groups by the property named by iterator on each of - the values. -

-
-_.groupBy([1.3, 2.1, 2.4], function(num){ return Math.floor(num); });
-=> {1: [1.3], 2: [2.1, 2.4]}
-
-_.groupBy(['one', 'two', 'three'], 'length');
-=> {3: ["one", "two"], 5: ["three"]}
-
- -

- sortedIndex_.sortedIndex(list, value, [iterator]) -
- Uses a binary search to determine the index at which the value - should be inserted into the list in order to maintain the list's - sorted order. If an iterator is passed, it will be used to compute - the sort ranking of each value. -

-
-_.sortedIndex([10, 20, 30, 40, 50], 35);
-=> 3
-
- -

- shuffle_.shuffle(list) -
- Returns a shuffled copy of the list, using a version of the - Fisher-Yates shuffle. -

-
-_.shuffle([1, 2, 3, 4, 5, 6]);
-=> [4, 1, 6, 3, 5, 2]
-
- -

- toArray_.toArray(list) -
- Converts the list (anything that can be iterated over), into a - real Array. Useful for transmuting the arguments object. -

-
-(function(){ return _.toArray(arguments).slice(1); })(1, 2, 3, 4);
-=> [2, 3, 4]
-
- -

- size_.size(list) -
- Return the number of values in the list. -

-
-_.size({one : 1, two : 2, three : 3});
-=> 3
-
- -

Array Functions

- -

- Note: All array functions will also work on the arguments object. -

- -

- first_.first(array, [n]) - Alias: head -
- Returns the first element of an array. Passing n will - return the first n elements of the array. -

-
-_.first([5, 4, 3, 2, 1]);
-=> 5
-
- -

- initial_.initial(array, [n]) -
- Returns everything but the last entry of the array. Especially useful on - the arguments object. Pass n to exclude the last n elements - from the result. -

-
-_.initial([5, 4, 3, 2, 1]);
-=> [5, 4, 3, 2]
-
- -

- last_.last(array, [n]) -
- Returns the last element of an array. Passing n will return - the last n elements of the array. -

-
-_.last([5, 4, 3, 2, 1]);
-=> 1
-
- -

- rest_.rest(array, [index]) - Alias: tail -
- Returns the rest of the elements in an array. Pass an index - to return the values of the array from that index onward. -

-
-_.rest([5, 4, 3, 2, 1]);
-=> [4, 3, 2, 1]
-
- -

- compact_.compact(array) -
- Returns a copy of the array with all falsy values removed. - In JavaScript, false, null, 0, "", - undefined and NaN are all falsy. -

-
-_.compact([0, 1, false, 2, '', 3]);
-=> [1, 2, 3]
-
- -

- flatten_.flatten(array, [shallow]) -
- Flattens a nested array (the nesting can be to any depth). If you - pass shallow, the array will only be flattened a single level. -

-
-_.flatten([1, [2], [3, [[4]]]]);
-=> [1, 2, 3, 4];
-
-_.flatten([1, [2], [3, [[4]]]], true);
-=> [1, 2, 3, [[4]]];
-
- -

- without_.without(array, [*values]) -
- Returns a copy of the array with all instances of the values - removed. === is used for the equality test. -

-
-_.without([1, 2, 1, 0, 3, 1, 4], 0, 1);
-=> [2, 3, 4]
-
- -

- union_.union(*arrays) -
- Computes the union of the passed-in arrays: the list of unique items, - in order, that are present in one or more of the arrays. -

-
-_.union([1, 2, 3], [101, 2, 1, 10], [2, 1]);
-=> [1, 2, 3, 101, 10]
-
- -

- intersection_.intersection(*arrays) -
- Computes the list of values that are the intersection of all the arrays. - Each value in the result is present in each of the arrays. -

-
-_.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]);
-=> [1, 2]
-
- -

- difference_.difference(array, *others) -
- Similar to without, but returns the values from array that - are not present in the other arrays. -

-
-_.difference([1, 2, 3, 4, 5], [5, 2, 10]);
-=> [1, 3, 4]
-
- -

- uniq_.uniq(array, [isSorted], [iterator]) - Alias: unique -
- Produces a duplicate-free version of the array, using === to test - object equality. If you know in advance that the array is sorted, - passing true for isSorted will run a much faster algorithm. - If you want to compute unique items based on a transformation, pass an - iterator function. -

-
-_.uniq([1, 2, 1, 3, 1, 4]);
-=> [1, 2, 3, 4]
-
- -

- zip_.zip(*arrays) -
- Merges together the values of each of the arrays with the - values at the corresponding position. Useful when you have separate - data sources that are coordinated through matching array indexes. - If you're working with a matrix of nested arrays, zip.apply - can transpose the matrix in a similar fashion. -

-
-_.zip(['moe', 'larry', 'curly'], [30, 40, 50], [true, false, false]);
-=> [["moe", 30, true], ["larry", 40, false], ["curly", 50, false]]
-
- -

- indexOf_.indexOf(array, value, [isSorted]) -
- Returns the index at which value can be found in the array, - or -1 if value is not present in the array. Uses the native - indexOf function unless it's missing. If you're working with a - large array, and you know that the array is already sorted, pass true - for isSorted to use a faster binary search. -

-
-_.indexOf([1, 2, 3], 2);
-=> 1
-
- -

- lastIndexOf_.lastIndexOf(array, value) -
- Returns the index of the last occurrence of value in the array, - or -1 if value is not present. Uses the native lastIndexOf - function if possible. -

-
-_.lastIndexOf([1, 2, 3, 1, 2, 3], 2);
-=> 4
-
- -

- range_.range([start], stop, [step]) -
- A function to create flexibly-numbered lists of integers, handy for - each and map loops. start, if omitted, defaults - to 0; step defaults to 1. Returns a list of integers - from start to stop, incremented (or decremented) by step, - exclusive. -

-
-_.range(10);
-=> [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
-_.range(1, 11);
-=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
-_.range(0, 30, 5);
-=> [0, 5, 10, 15, 20, 25]
-_.range(0, -10, -1);
-=> [0, -1, -2, -3, -4, -5, -6, -7, -8, -9]
-_.range(0);
-=> []
-
- -

Function (uh, ahem) Functions

- -

- bind_.bind(function, object, [*arguments]) -
- Bind a function to an object, meaning that whenever - the function is called, the value of this will be the object. - Optionally, bind arguments to the function to pre-fill them, - also known as partial application. -

-
-var func = function(greeting){ return greeting + ': ' + this.name };
-func = _.bind(func, {name : 'moe'}, 'hi');
-func();
-=> 'hi: moe'
-
- -

- bindAll_.bindAll(object, [*methodNames]) -
- Binds a number of methods on the object, specified by - methodNames, to be run in the context of that object whenever they - are invoked. Very handy for binding functions that are going to be used - as event handlers, which would otherwise be invoked with a fairly useless - this. If no methodNames are provided, all of the object's - function properties will be bound to it. -

-
-var buttonView = {
-  label   : 'underscore',
-  onClick : function(){ alert('clicked: ' + this.label); },
-  onHover : function(){ console.log('hovering: ' + this.label); }
-};
-_.bindAll(buttonView);
-jQuery('#underscore_button').bind('click', buttonView.onClick);
-=> When the button is clicked, this.label will have the correct value...
-
- -

- memoize_.memoize(function, [hashFunction]) -
- Memoizes a given function by caching the computed result. Useful - for speeding up slow-running computations. If passed an optional - hashFunction, it will be used to compute the hash key for storing - the result, based on the arguments to the original function. The default - hashFunction just uses the first argument to the memoized function - as the key. -

-
-var fibonacci = _.memoize(function(n) {
-  return n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2);
-});
-
- -

- delay_.delay(function, wait, [*arguments]) -
- Much like setTimeout, invokes function after wait - milliseconds. If you pass the optional arguments, they will be - forwarded on to the function when it is invoked. -

-
-var log = _.bind(console.log, console);
-_.delay(log, 1000, 'logged later');
-=> 'logged later' // Appears after one second.
-
- -

- defer_.defer(function) -
- Defers invoking the function until the current call stack has cleared, - similar to using setTimeout with a delay of 0. Useful for performing - expensive computations or HTML rendering in chunks without blocking the UI thread - from updating. -

-
-_.defer(function(){ alert('deferred'); });
-// Returns from the function before the alert runs.
-
- -

- throttle_.throttle(function, wait) -
- Creates and returns a new, throttled version of the passed function, - that, when invoked repeatedly, will only actually call the original function - at most once per every wait - milliseconds. Useful for rate-limiting events that occur faster than you - can keep up with. -

-
-var throttled = _.throttle(updatePosition, 100);
-$(window).scroll(throttled);
-
- -

- debounce_.debounce(function, wait, [immediate]) -
- Creates and returns a new debounced version of the passed function that - will postpone its execution until after - wait milliseconds have elapsed since the last time it - was invoked. Useful for implementing behavior that should only happen - after the input has stopped arriving. For example: rendering a - preview of a Markdown comment, recalculating a layout after the window - has stopped being resized, and so on. -

- -

- Pass true for the immediate parameter to cause - debounce to trigger the function on the leading intead of the - trailing edge of the wait interval. Useful in circumstances like - preventing accidental double-clicks on a "submit" button from firing a - second time. -

- -
-var lazyLayout = _.debounce(calculateLayout, 300);
-$(window).resize(lazyLayout);
-
- -

- once_.once(function) -
- Creates a version of the function that can only be called one time. - Repeated calls to the modified function will have no effect, returning - the value from the original call. Useful for initialization functions, - instead of having to set a boolean flag and then check it later. -

-
-var initialize = _.once(createApplication);
-initialize();
-initialize();
-// Application is only created once.
-
- -

- after_.after(count, function) -
- Creates a version of the function that will only be run after first - being called count times. Useful for grouping asynchronous responses, - where you want to be sure that all the async calls have finished, before - proceeding. -

-
-var renderNotes = _.after(notes.length, render);
-_.each(notes, function(note) {
-  note.asyncSave({success: renderNotes});
-});
-// renderNotes is run once, after all notes have saved.
-
- -

- wrap_.wrap(function, wrapper) -
- Wraps the first function inside of the wrapper function, - passing it as the first argument. This allows the wrapper to - execute code before and after the function runs, adjust the arguments, - and execute it conditionally. -

-
-var hello = function(name) { return "hello: " + name; };
-hello = _.wrap(hello, function(func) {
-  return "before, " + func("moe") + ", after";
-});
-hello();
-=> 'before, hello: moe, after'
-
- -

- compose_.compose(*functions) -
- Returns the composition of a list of functions, where each function - consumes the return value of the function that follows. In math terms, - composing the functions f(), g(), and h() produces - f(g(h())). -

-
-var greet    = function(name){ return "hi: " + name; };
-var exclaim  = function(statement){ return statement + "!"; };
-var welcome = _.compose(exclaim, greet);
-welcome('moe');
-=> 'hi: moe!'
-
- -

Object Functions

- -

- keys_.keys(object) -
- Retrieve all the names of the object's properties. -

-
-_.keys({one : 1, two : 2, three : 3});
-=> ["one", "two", "three"]
-
- -

- values_.values(object) -
- Return all of the values of the object's properties. -

-
-_.values({one : 1, two : 2, three : 3});
-=> [1, 2, 3]
-
- -

- functions_.functions(object) - Alias: methods -
- Returns a sorted list of the names of every method in an object — - that is to say, the name of every function property of the object. -

-
-_.functions(_);
-=> ["all", "any", "bind", "bindAll", "clone", "compact", "compose" ...
-
- -

- extend_.extend(destination, *sources) -
- Copy all of the properties in the source objects over to the - destination object, and return the destination object. - It's in-order, so the last source will override properties of the same - name in previous arguments. -

-
-_.extend({name : 'moe'}, {age : 50});
-=> {name : 'moe', age : 50}
-
- -

- pick_.pick(object, *keys) -
- Return a copy of the object, filtered to only have values for - the whitelisted keys (or array of valid keys). -

-
-_.pick({name : 'moe', age: 50, userid : 'moe1'}, 'name', 'age');
-=> {name : 'moe', age : 50}
-
- -

- defaults_.defaults(object, *defaults) -
- Fill in missing properties in object with default values from the - defaults objects, and return the object. As soon as the - property is filled, further defaults will have no effect. -

-
-var iceCream = {flavor : "chocolate"};
-_.defaults(iceCream, {flavor : "vanilla", sprinkles : "lots"});
-=> {flavor : "chocolate", sprinkles : "lots"}
-
- -

- clone_.clone(object) -
- Create a shallow-copied clone of the object. Any nested objects - or arrays will be copied by reference, not duplicated. -

-
-_.clone({name : 'moe'});
-=> {name : 'moe'};
-
- -

- tap_.tap(object, interceptor) -
- Invokes interceptor with the object, and then returns object. - The primary purpose of this method is to "tap into" a method chain, in order to perform operations on intermediate results within the chain. -

-
-_.chain([1,2,3,200])
-  .filter(function(num) { return num % 2 == 0; })
-  .tap(alert)
-  .map(function(num) { return num * num })
-  .value();
-=> // [2, 200] (alerted)
-=> [4, 40000]
-
- -

- has_.has(object, key) -
- Does the object contain the given key? Identical to - object.hasOwnProperty(key), but uses a safe reference to the - hasOwnProperty function, in case it's been - overridden accidentally. -

-
-_.has({a: 1, b: 2, c: 3}, "b");
-=> true
-
- -

- isEqual_.isEqual(object, other) -
- Performs an optimized deep comparison between the two objects, to determine - if they should be considered equal. -

-
-var moe   = {name : 'moe', luckyNumbers : [13, 27, 34]};
-var clone = {name : 'moe', luckyNumbers : [13, 27, 34]};
-moe == clone;
-=> false
-_.isEqual(moe, clone);
-=> true
-
- -

- isEmpty_.isEmpty(object) -
- Returns true if object contains no values. -

-
-_.isEmpty([1, 2, 3]);
-=> false
-_.isEmpty({});
-=> true
-
- -

- isElement_.isElement(object) -
- Returns true if object is a DOM element. -

-
-_.isElement(jQuery('body')[0]);
-=> true
-
- -

- isArray_.isArray(object) -
- Returns true if object is an Array. -

-
-(function(){ return _.isArray(arguments); })();
-=> false
-_.isArray([1,2,3]);
-=> true
-
- -

- isObject_.isObject(value) -
- Returns true if value is an Object. -

-
-_.isObject({});
-=> true
-_.isObject(1);
-=> false
-
- -

- isArguments_.isArguments(object) -
- Returns true if object is an Arguments object. -

-
-(function(){ return _.isArguments(arguments); })(1, 2, 3);
-=> true
-_.isArguments([1,2,3]);
-=> false
-
- -

- isFunction_.isFunction(object) -
- Returns true if object is a Function. -

-
-_.isFunction(alert);
-=> true
-
- -

- isString_.isString(object) -
- Returns true if object is a String. -

-
-_.isString("moe");
-=> true
-
- -

- isNumber_.isNumber(object) -
- Returns true if object is a Number (including NaN). -

-
-_.isNumber(8.4 * 5);
-=> true
-
- -

- isFinite_.isFinite(object) -
- Returns true if object is a finite Number. -

-
-_.isFinite(-101);
-=> true
-
-_.isFinite(-Infinity);
-=> false
-
- -

- isBoolean_.isBoolean(object) -
- Returns true if object is either true or false. -

-
-_.isBoolean(null);
-=> false
-
- -

- isDate_.isDate(object) -
- Returns true if object is a Date. -

-
-_.isDate(new Date());
-=> true
-
- -

- isRegExp_.isRegExp(object) -
- Returns true if object is a RegExp. -

-
-_.isRegExp(/moe/);
-=> true
-
- -

- isNaN_.isNaN(object) -
- Returns true if object is NaN.
Note: this is not - the same as the native isNaN function, which will also return - true if the variable is undefined. -

-
-_.isNaN(NaN);
-=> true
-isNaN(undefined);
-=> true
-_.isNaN(undefined);
-=> false
-
- -

- isNull_.isNull(object) -
- Returns true if the value of object is null. -

-
-_.isNull(null);
-=> true
-_.isNull(undefined);
-=> false
-
- -

- isUndefined_.isUndefined(variable) -
- Returns true if variable is undefined. -

-
-_.isUndefined(window.missingVariable);
-=> true
-
- -

Utility Functions

- -

- noConflict_.noConflict() -
- Give control of the "_" variable back to its previous owner. Returns - a reference to the Underscore object. -

-
-var underscore = _.noConflict();
- -

- identity_.identity(value) -
- Returns the same value that is used as the argument. In math: - f(x) = x
- This function looks useless, but is used throughout Underscore as - a default iterator. -

-
-var moe = {name : 'moe'};
-moe === _.identity(moe);
-=> true
- -

- times_.times(n, iterator) -
- Invokes the given iterator function n times. -

-
-_(3).times(function(){ genie.grantWish(); });
- -

- mixin_.mixin(object) -
- Allows you to extend Underscore with your own utility functions. Pass - a hash of {name: function} definitions to have your functions - added to the Underscore object, as well as the OOP wrapper. -

-
-_.mixin({
-  capitalize : function(string) {
-    return string.charAt(0).toUpperCase() + string.substring(1).toLowerCase();
-  }
-});
-_("fabio").capitalize();
-=> "Fabio"
-
- -

- uniqueId_.uniqueId([prefix]) -
- Generate a globally-unique id for client-side models or DOM elements - that need one. If prefix is passed, the id will be appended to it. - Without prefix, returns an integer. -

-
-_.uniqueId('contact_');
-=> 'contact_104'
- -

- escape_.escape(string) -
- Escapes a string for insertion into HTML, replacing - &, <, >, ", ', and / characters. -

-
-_.escape('Curly, Larry & Moe');
-=> "Curly, Larry &amp; Moe"
- -

- result_.result(object, property) -
- If the value of the named property is a function then invoke it; otherwise, return it. -

-
-var object = {cheese: 'crumpets', stuff: function(){ return 'nonsense'; }};
-_.result(object, 'cheese');
-=> "crumpets"
-_.result(object, 'stuff');
-=> "nonsense"
- -

- template_.template(templateString, [data], [settings]) -
- Compiles JavaScript templates into functions that can be evaluated - for rendering. Useful for rendering complicated bits of HTML from JSON - data sources. Template functions can both interpolate variables, using - <%= … %>, as well as execute arbitrary JavaScript code, with - <% … %>. If you wish to interpolate a value, and have - it be HTML-escaped, use <%- … %> When you evaluate a template function, pass in a - data object that has properties corresponding to the template's free - variables. If you're writing a one-off, you can pass the data - object as the second parameter to template in order to render - immediately instead of returning a template function. The settings argument - should be a hash containing any _.templateSettings that should be overriden. -

- -
-var compiled = _.template("hello: <%= name %>");
-compiled({name : 'moe'});
-=> "hello: moe"
-
-var list = "<% _.each(people, function(name) { %> <li><%= name %></li> <% }); %>";
-_.template(list, {people : ['moe', 'curly', 'larry']});
-=> "<li>moe</li><li>curly</li><li>larry</li>"
-
-var template = _.template("<b><%- value %></b>");
-template({value : '<script>'});
-=> "<b>&lt;script&gt;</b>"
- -

- You can also use print from within JavaScript code. This is - sometimes more convenient than using <%= ... %>. -

- -
-var compiled = _.template("<% print('Hello ' + epithet); %>");
-compiled({epithet: "stooge"});
-=> "Hello stooge."
- -

- If ERB-style delimiters aren't your cup of tea, you can change Underscore's - template settings to use different symbols to set off interpolated code. - Define an interpolate regex to match expressions that should be - interpolated verbatim, an escape regex to match expressions that should - be inserted after being HTML escaped, and an evaluate regex to match - expressions that should be evaluated without insertion into the resulting - string. You may define or omit any combination of the three. - For example, to perform - Mustache.js - style templating: -

- -
-_.templateSettings = {
-  interpolate : /\{\{(.+?)\}\}/g
-};
-
-var template = _.template("Hello {{ name }}!");
-template({name : "Mustache"});
-=> "Hello Mustache!"
- -

- By default, template places the values from your data in the local scope - via the with statement. However, you can specify a single variable name - with the variable setting. This can significantly improve the speed - at which a template is able to render. -

- -
-_.template("<%= data.hasWith %>", {hasWith: 'no'}, {variable: 'data'});
-=> "no"
- -

- Precompiling your templates can be a big help when debugging errors you can't - reproduce. This is because precompiled templates can provide line numbers and - a stack trace, something that is not possible when compiling templates on the client. - The source property is available on the compiled template - function for easy precompilation. -

- -
<script>
-  JST.project = <%= _.template(jstText).source %>;
-</script>
- - -

Chaining

- -

- You can use Underscore in either an object-oriented or a functional style, - depending on your preference. The following two lines of code are - identical ways to double a list of numbers. -

- -
-_.map([1, 2, 3], function(n){ return n * 2; });
-_([1, 2, 3]).map(function(n){ return n * 2; });
- -

- Calling chain on a wrapped object will cause all future method calls to - return wrapped objects as well. When you've finished the computation, - use value to retrieve the final value. Here's an example of chaining - together a map/flatten/reduce, in order to get the word count of - every word in a song. -

- -
-var lyrics = [
-  {line : 1, words : "I'm a lumberjack and I'm okay"},
-  {line : 2, words : "I sleep all night and I work all day"},
-  {line : 3, words : "He's a lumberjack and he's okay"},
-  {line : 4, words : "He sleeps all night and he works all day"}
-];
-
-_.chain(lyrics)
-  .map(function(line) { return line.words.split(' '); })
-  .flatten()
-  .reduce(function(counts, word) {
-    counts[word] = (counts[word] || 0) + 1;
-    return counts;
-}, {}).value();
-
-=> {lumberjack : 2, all : 4, night : 2 ... }
- -

- In addition, the - Array prototype's methods - are proxied through the chained Underscore object, so you can slip a - reverse or a push into your chain, and continue to - modify the array. -

- -

- chain_.chain(obj) -
- Returns a wrapped object. Calling methods on this object will continue - to return wrapped objects until value is used. -

-
-var stooges = [{name : 'curly', age : 25}, {name : 'moe', age : 21}, {name : 'larry', age : 23}];
-var youngest = _.chain(stooges)
-  .sortBy(function(stooge){ return stooge.age; })
-  .map(function(stooge){ return stooge.name + ' is ' + stooge.age; })
-  .first()
-  .value();
-=> "moe is 21"
-
- -

- value_(obj).value() -
- Extracts the value of a wrapped object. -

-
-_([1, 2, 3]).value();
-=> [1, 2, 3]
-
- - - -

- Underscore.lua, - a Lua port of the functions that are applicable in both languages. - Includes OOP-wrapping and chaining. - The source is - available on GitHub. -

- -

- Underscore.php, - a PHP port of the functions that are applicable in both languages. - Includes OOP-wrapping and chaining. - The source is - available on GitHub. -

- -

- Underscore-perl, - a Perl port of many of the Underscore.js functions, - aimed at on Perl hashes and arrays, also - available on GitHub. -

- -

- Underscore.string, - an Underscore extension that adds functions for string-manipulation: - trim, startsWith, contains, capitalize, - reverse, sprintf, and more. -

- -

- Ruby's Enumerable module. -

- -

- Prototype.js, which provides - JavaScript with collection functions in the manner closest to Ruby's Enumerable. -

- -

- Oliver Steele's - Functional JavaScript, - which includes comprehensive higher-order function support as well as string lambdas. -

- -

- Michael Aufreiter's Data.js, - a data manipulation + persistence library for JavaScript. -

- -

- Python's itertools. -

- -

Change Log

- -

- 1.3.3April 10, 2012
-

    -
  • - Many improvements to _.template, which now provides the - source of the template function as a property, for potentially - even more efficient pre-compilation on the server-side. You may now - also set the variable option when creating a template, - which will cause your passed-in data to be made available under the - variable you named, instead of using a with statement — - significantly improving the speed of rendering the template. -
  • -
  • - Added the pick function, which allows you to filter an - object literal with a whitelist of allowed property names. -
  • -
  • - Added the result function, for convenience when working - with APIs that allow either functions or raw properties. -
  • -
  • - Added the isFinite function, because sometimes knowing that - a value is a number just ain't quite enough. -
  • -
  • - The sortBy function may now also be passed the string name - of a property to use as the sort order on each object. -
  • -
  • - Fixed uniq to work with sparse arrays. -
  • -
  • - The difference function now performs a shallow flatten - instead of a deep one when computing array differences. -
  • -
  • - The debounce function now takes an immediate - parameter, which will cause the callback to fire on the leading - instead of the trailing edge. -
  • -
-

- -

- 1.3.1Jan. 23, 2012
-

    -
  • - Added an _.has function, as a safer way to use hasOwnProperty. -
  • -
  • - Added _.collect as an alias for _.map. Smalltalkers, rejoice. -
  • -
  • - Reverted an old change so that _.extend will correctly copy - over keys with undefined values again. -
  • -
  • - Bugfix to stop escaping slashes within interpolations in _.template. -
  • -
-

- -

- 1.3.0Jan. 11, 2012
-

    -
  • - Removed AMD (RequireJS) support from Underscore. If you'd like to use - Underscore with RequireJS, you can load it as a normal script, wrap - or patch your copy, or download a forked version. -
  • -
-

- -

- 1.2.4Jan. 4, 2012
-

    -
  • - You now can (and probably should, as it's simpler) - write _.chain(list) - instead of _(list).chain(). -
  • -
  • - Fix for escaped characters in Underscore templates, and for supporting - customizations of _.templateSettings that only define one or - two of the required regexes. -
  • -
  • - Fix for passing an array as the first argument to an _.wrap'd function. -
  • -
  • - Improved compatibility with ClojureScript, which adds a call - function to String.prototype. -
  • -
-

- -

- 1.2.3Dec. 7, 2011
-

    -
  • - Dynamic scope is now preserved for compiled _.template functions, - so you can use the value of this if you like. -
  • -
  • - Sparse array support of _.indexOf, _.lastIndexOf. -
  • -
  • - Both _.reduce and _.reduceRight can now be passed an - explicitly undefined value. (There's no reason why you'd - want to do this.) -
  • -
-

- -

- 1.2.2Nov. 14, 2011
-

    -
  • - Continued tweaks to _.isEqual semantics. Now JS primitives are - considered equivalent to their wrapped versions, and arrays are compared - by their numeric properties only (#351). -
  • -
  • - _.escape no longer tries to be smart about not double-escaping - already-escaped HTML entities. Now it just escapes regardless (#350). -
  • -
  • - In _.template, you may now leave semicolons out of evaluated - statements if you wish: <% }) %> (#369). -
  • -
  • - _.after(callback, 0) will now trigger the callback immediately, - making "after" easier to use with asynchronous APIs (#366). -
  • -
-

- -

- 1.2.1Oct. 24, 2011
-

    -
  • - Several important bug fixes for _.isEqual, which should now - do better on mutated Arrays, and on non-Array objects with - length properties. (#329) -
  • -
  • - jrburke contributed Underscore exporting for AMD module loaders, - and tonylukasavage for Appcelerator Titanium. - (#335, #338) -
  • -
  • - You can now _.groupBy(list, 'property') as a shortcut for - grouping values by a particular common property. -
  • -
  • - _.throttle'd functions now fire immediately upon invocation, - and are rate-limited thereafter (#170, #266). -
  • -
  • - Most of the _.is[Type] checks no longer ducktype. -
  • -
  • - The _.bind function now also works on constructors, a-la - ES5 ... but you would never want to use _.bind on a - constructor function. -
  • -
  • - _.clone no longer wraps non-object types in Objects. -
  • -
  • - _.find and _.filter are now the preferred names for - _.detect and _.select. -
  • -
-

- -

- 1.2.0Oct. 5, 2011
-

    -
  • - The _.isEqual function now - supports true deep equality comparisons, with checks for cyclic structures, - thanks to Kit Cambridge. -
  • -
  • - Underscore templates now support HTML escaping interpolations, using - <%- ... %> syntax. -
  • -
  • - Ryan Tenney contributed _.shuffle, which uses a modified - Fisher-Yates to give you a shuffled copy of an array. -
  • -
  • - _.uniq can now be passed an optional iterator, to determine by - what criteria an object should be considered unique. -
  • -
  • - _.last now takes an optional argument which will return the last - N elements of the list. -
  • -
  • - A new _.initial function was added, as a mirror of _.rest, - which returns all the initial values of a list (except the last N). -
  • -
-

- -

- 1.1.7July 13, 2011
- Added _.groupBy, which aggregates a collection into groups of like items. - Added _.union and _.difference, to complement the - (re-named) _.intersection. - Various improvements for support of sparse arrays. - _.toArray now returns a clone, if directly passed an array. - _.functions now also returns the names of functions that are present - in the prototype chain. -

- -

- 1.1.6April 18, 2011
- Added _.after, which will return a function that only runs after - first being called a specified number of times. - _.invoke can now take a direct function reference. - _.every now requires an iterator function to be passed, which - mirrors the ECMA5 API. - _.extend no longer copies keys when the value is undefined. - _.bind now errors when trying to bind an undefined value. -

- -

- 1.1.5Mar 20, 2011
- Added an _.defaults function, for use merging together JS objects - representing default options. - Added an _.once function, for manufacturing functions that should - only ever execute a single time. - _.bind now delegates to the native ECMAScript 5 version, - where available. - _.keys now throws an error when used on non-Object values, as in - ECMAScript 5. - Fixed a bug with _.keys when used over sparse arrays. -

- -

- 1.1.4Jan 9, 2011
- Improved compliance with ES5's Array methods when passing null - as a value. _.wrap now correctly sets this for the - wrapped function. _.indexOf now takes an optional flag for - finding the insertion index in an array that is guaranteed to already - be sorted. Avoiding the use of .callee, to allow _.isArray - to work properly in ES5's strict mode. -

- -

- 1.1.3Dec 1, 2010
- In CommonJS, Underscore may now be required with just:
- var _ = require("underscore"). - Added _.throttle and _.debounce functions. - Removed _.breakLoop, in favor of an ECMA5-style un-break-able - each implementation — this removes the try/catch, and you'll now have - better stack traces for exceptions that are thrown within an Underscore iterator. - Improved the isType family of functions for better interoperability - with Internet Explorer host objects. - _.template now correctly escapes backslashes in templates. - Improved _.reduce compatibility with the ECMA5 version: - if you don't pass an initial value, the first item in the collection is used. - _.each no longer returns the iterated collection, for improved - consistency with ES5's forEach. -

- -

- 1.1.2
- Fixed _.contains, which was mistakenly pointing at - _.intersect instead of _.include, like it should - have been. Added _.unique as an alias for _.uniq. -

- -

- 1.1.1
- Improved the speed of _.template, and its handling of multiline - interpolations. Ryan Tenney contributed optimizations to many Underscore - functions. An annotated version of the source code is now available. -

- -

- 1.1.0
- The method signature of _.reduce has been changed to match - the ECMAScript 5 signature, instead of the Ruby/Prototype.js version. - This is a backwards-incompatible change. _.template may now be - called with no arguments, and preserves whitespace. _.contains - is a new alias for _.include. -

- -

- 1.0.4
- Andri Möll contributed the _.memoize - function, which can be used to speed up expensive repeated computations - by caching the results. -

- -

- 1.0.3
- Patch that makes _.isEqual return false if any property - of the compared object has a NaN value. Technically the correct - thing to do, but of questionable semantics. Watch out for NaN comparisons. -

- -

- 1.0.2
- Fixes _.isArguments in recent versions of Opera, which have - arguments objects as real Arrays. -

- -

- 1.0.1
- Bugfix for _.isEqual, when comparing two objects with the same - number of undefined keys, but with different names. -

- -

- 1.0.0
- Things have been stable for many months now, so Underscore is now - considered to be out of beta, at 1.0. Improvements since 0.6 - include _.isBoolean, and the ability to have _.extend - take multiple source objects. -

- -

- 0.6.0
- Major release. Incorporates a number of - Mile Frawley's refactors for - safer duck-typing on collection functions, and cleaner internals. A new - _.mixin method that allows you to extend Underscore with utility - functions of your own. Added _.times, which works the same as in - Ruby or Prototype.js. Native support for ECMAScript 5's Array.isArray, - and Object.keys. -

- -

- 0.5.8
- Fixed Underscore's collection functions to work on - NodeLists and - HTMLCollections - once more, thanks to - Justin Tulloss. -

- -

- 0.5.7
- A safer implementation of _.isArguments, and a - faster _.isNumber,
thanks to - Jed Schmidt. -

- -

- 0.5.6
- Customizable delimiters for _.template, contributed by - Noah Sloan. -

- -

- 0.5.5
- Fix for a bug in MobileSafari's OOP-wrapper, with the arguments object. -

- -

- 0.5.4
- Fix for multiple single quotes within a template string for - _.template. See: - Rick Strahl's blog post. -

- -

- 0.5.2
- New implementations of isArray, isDate, isFunction, - isNumber, isRegExp, and isString, thanks to - a suggestion from - Robert Kieffer. - Instead of doing Object#toString - comparisons, they now check for expected properties, which is less safe, - but more than an order of magnitude faster. Most other Underscore - functions saw minor speed improvements as a result. - Evgeniy Dolzhenko - contributed _.tap, - similar to Ruby 1.9's, - which is handy for injecting side effects (like logging) into chained calls. -

- -

- 0.5.1
- Added an _.isArguments function. Lots of little safety checks - and optimizations contributed by - Noah Sloan and - Andri Möll. -

- -

- 0.5.0
- [API Changes] _.bindAll now takes the context object as - its first parameter. If no method names are passed, all of the context - object's methods are bound to it, enabling chaining and easier binding. - _.functions now takes a single argument and returns the names - of its Function properties. Calling _.functions(_) will get you - the previous behavior. - Added _.isRegExp so that isEqual can now test for RegExp equality. - All of the "is" functions have been shrunk down into a single definition. - Karl Guertin contributed patches. -

- -

- 0.4.7
- Added isDate, isNaN, and isNull, for completeness. - Optimizations for isEqual when checking equality between Arrays - or Dates. _.keys is now 25%–2X faster (depending on your - browser) which speeds up the functions that rely on it, such as _.each. -

- -

- 0.4.6
- Added the range function, a port of the - Python - function of the same name, for generating flexibly-numbered lists - of integers. Original patch contributed by - Kirill Ishanov. -

- -

- 0.4.5
- Added rest for Arrays and arguments objects, and aliased - first as head, and rest as tail, - thanks to Luke Sutton's patches. - Added tests ensuring that all Underscore Array functions also work on - arguments objects. -

- -

- 0.4.4
- Added isString, and isNumber, for consistency. Fixed - _.isEqual(NaN, NaN) to return true (which is debatable). -

- -

- 0.4.3
- Started using the native StopIteration object in browsers that support it. - Fixed Underscore setup for CommonJS environments. -

- -

- 0.4.2
- Renamed the unwrapping function to value, for clarity. -

- -

- 0.4.1
- Chained Underscore objects now support the Array prototype methods, so - that you can perform the full range of operations on a wrapped array - without having to break your chain. Added a breakLoop method - to break in the middle of any Underscore iteration. Added an - isEmpty function that works on arrays and objects. -

- -

- 0.4.0
- All Underscore functions can now be called in an object-oriented style, - like so: _([1, 2, 3]).map(...);. Original patch provided by - Marc-André Cournoyer. - Wrapped objects can be chained through multiple - method invocations. A functions method - was added, providing a sorted list of all the functions in Underscore. -

- -

- 0.3.3
- Added the JavaScript 1.8 function reduceRight. Aliased it - as foldr, and aliased reduce as foldl. -

- -

- 0.3.2
- Now runs on stock Rhino - interpreters with: load("underscore.js"). - Added identity as a utility function. -

- -

- 0.3.1
- All iterators are now passed in the original collection as their third - argument, the same as JavaScript 1.6's forEach. Iterating over - objects is now called with (value, key, collection), for details - see _.each. -

- -

- 0.3.0
- Added Dmitry Baranovskiy's - comprehensive optimizations, merged in - Kris Kowal's patches to make Underscore - CommonJS and - Narwhal compliant. -

- -

- 0.2.0
- Added compose and lastIndexOf, renamed inject to - reduce, added aliases for inject, filter, - every, some, and forEach. -

- -

- 0.1.1
- Added noConflict, so that the "Underscore" object can be assigned to - other variables. -

- -

- 0.1.0
- Initial release of Underscore.js. -

- -

- - A DocumentCloud Project - -

- -
- -
- - - - - - diff --git a/tests/qunit/node_modules/qunit/node_modules/underscore/index.js b/tests/qunit/node_modules/qunit/node_modules/underscore/index.js deleted file mode 100644 index 2cf0ca5..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/underscore/index.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('./underscore'); diff --git a/tests/qunit/node_modules/qunit/node_modules/underscore/package.json b/tests/qunit/node_modules/qunit/node_modules/underscore/package.json deleted file mode 100644 index bc69677..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/underscore/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "underscore", - "description": "JavaScript's functional programming helper library.", - "homepage": "http://documentcloud.github.com/underscore/", - "keywords": [ - "util", - "functional", - "server", - "client", - "browser" - ], - "author": { - "name": "Jeremy Ashkenas", - "email": "jeremy@documentcloud.org" - }, - "repository": { - "type": "git", - "url": "git://github.com/documentcloud/underscore.git" - }, - "main": "underscore.js", - "version": "1.3.3", - "readme": " __ \n /\\ \\ __ \n __ __ ___ \\_\\ \\ __ _ __ ____ ___ ___ _ __ __ /\\_\\ ____ \n /\\ \\/\\ \\ /' _ `\\ /'_ \\ /'__`\\/\\ __\\/ ,__\\ / ___\\ / __`\\/\\ __\\/'__`\\ \\/\\ \\ /',__\\ \n \\ \\ \\_\\ \\/\\ \\/\\ \\/\\ \\ \\ \\/\\ __/\\ \\ \\//\\__, `\\/\\ \\__//\\ \\ \\ \\ \\ \\//\\ __/ __ \\ \\ \\/\\__, `\\\n \\ \\____/\\ \\_\\ \\_\\ \\___,_\\ \\____\\\\ \\_\\\\/\\____/\\ \\____\\ \\____/\\ \\_\\\\ \\____\\/\\_\\ _\\ \\ \\/\\____/\n \\/___/ \\/_/\\/_/\\/__,_ /\\/____/ \\/_/ \\/___/ \\/____/\\/___/ \\/_/ \\/____/\\/_//\\ \\_\\ \\/___/ \n \\ \\____/ \n \\/___/\n \nUnderscore.js is a utility-belt library for JavaScript that provides \nsupport for the usual functional suspects (each, map, reduce, filter...) \nwithout extending any core JavaScript objects.\n\nFor Docs, License, Tests, and pre-packed downloads, see:\nhttp://documentcloud.github.com/underscore/\n\nMany thanks to our contributors:\nhttps://github.com/documentcloud/underscore/contributors\n", - "readmeFilename": "README.md", - "_id": "underscore@1.3.3", - "_from": "underscore@1.3.3" -} diff --git a/tests/qunit/node_modules/qunit/node_modules/underscore/raw/underscore.psd b/tests/qunit/node_modules/qunit/node_modules/underscore/raw/underscore.psd deleted file mode 100644 index 73ad2d7c8eebce69b4f46f31c0a1a8c2d523bc0d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 215540 zcmeEv2Vfk<)&EFxuQDY-0^vdu0*UQgow{+6EV+SY3(H`@6rZKFbog|4xjVVQ-v~lN zk}nBP`4W;)6d<%vOec^Kk@AIn3E(fGLx@tS24kAst^NPrY@NN`y=GIAm3_CjGxKKN zym{}TM~>t?sMu@a{KmEkgnv664HQH*}$uj9zN*$Y~ReU{&p^KZ)+&-)A|%>Lf= zS?dzv_SJGauu|@f#AY0`?HB#W1R@gL zs-}jfhNiSjHI;$t%Bhvrp_)+DVi^juu_^*Q8!Jho>o;6(Eg5@IR?L`Cp%V6 zThcsNYY=xcj_FFL6VrmhwQJW-U0XRdp6m=()YsPsrBE;wnt~EjQtM;s@VY6n)Th-- z^m>}*RC_X#NJrwa0M#2_8ShEYIOZ5?$oSKG)}1gKilwIVUQTU~cL&#n6Tyn9QqZUw zfYU*hX-!EvoQ@}##^ceMYTsMC;^}y*E1n26wN(XL!tIe5-A@nNi<|A6HObB4v^+B; zRfMKU6;q_Dr4_Z)K%!9n6i`W$ES0DwZFRI@G&;iRu)UU03UNF-+NZ6G zC%ePxnc+kt8fg#HkO$YqI<$dI=p!>dXcpbySYwo1S`5S;nW(!v=)`=f^qe)|OO4MR zAyZ4&C*d?tR9jP1Db;h%5H)PT zg5e`LE!<9gH?y5IgWNGaD5RQb*})D#J7Sg6v=9s_)p+tpY=4YcR!gD?t!Ot? zKjI^%&TgW8p<7xudt|?v&FRQ0bG0N`k(86UilNkLFrYA@bAx$i#q?lCnmGwf=Xs}* zAr$T5h7K%B`~@rMTLZOb+d)tF2DN6}K~2b0Vv+RBkk*^#cV5(~- zhpKDwsl%s!G8UwhL$y`-Ag!)ya&@JIPX&G>y{>X{sJ>=$rBpGwvZ4;3`pMNHd@4go zLp`+;J}6sD_tnV9r?RRtbV5yIZH-h@U0Yi}x4Jqsx30daR%#AaG}q6muWqiag0;=5 zC}5_cz2EpiUKerU1Io$d14^CN8d)btPiv0A%ukUKTUlQ-J?NNYp|Y8Ox(Qi>PC91T z0h{8{c(M(C33+Bsb#-O624+dNLkMK6tf{N1np`E-*GT*uLseT5QolnyMg6WsdUb_b zrfM=l)$(r)D~1dy_(n=qUA4r&F{Jp70mV01ptceWLfFi}-S6>{kt*y3AFspY@x=(`?x;+vPLug34%5T)0G;qVQ%tg5I-o%Btx z^>qYWUq@x?>!?h9Jug#V!GBY2^}M$FdTOzr*I7@Pz`am28LT@Q>^`|>a_!{0$@P;# znu?0a6`{!$m6I!~CWDnxsG@c<_&$WPkOl|?e{)rbF{$}Mr?mGy0NTxUOOAvnJjN)P2=3w67P^_R!$E(C3_;R z$}Id0`_F$z>ym_pMJZZ~EABeRA0d;(hCr%bPy7T%TMvf_UHhyyiyKDJz+TsDGu-}>b8rjISxCzp*N z-nTxvyy;`h^~q%;i1)2eE^qqSa(!~y2;zO~lgpbvwp^cFHiCHH`sDJak1f|HmyICa zw?4VN>0`_F$z>ym_pK+n#+c_%$T1u`u@&WPx4yd<@clcH@-?Z)aTR_GR7DuYLxJ@gS^yy7F@Lo zIZ=F%;3*|q%GE#mv5^wum7Rfay-YPvnPR5!I(Oopu>@m^<6qgUlD}&(wO>0{iO3pCh?M^cnVPwX{8P7M;nnEq%w9RK3YEA z#(JVrTsYjR$y6*Fk9FdnpJ*b-!Yfze>nC|d8F_p%R&5p)ev{EB^e<~@pl(;Ap=P{IL!+G?oWVl;y zOUsGHE6;65zIHT=)=eTc^+Zn6xgc6ghahomha8IoQ!}~rG%CxhTS7+##CujY%tVs< zH!O{(uySvLfLxjw)zJfF@Hkh_wH=mluWiiQcyjfE*wX!l-B_w`aZft03cV0y3!7qT z3%gA0jK)`nqf3)G`eq>xfjBj~Fr|{1jqVDkTH-_+&V-yFs(9X9d}s0lmm?cL9Fppi zWsZF`5|bD6b7oR{8@$F(@*0W5RGIoX{VLs#FOrGOR_I)xQ7gkKc@Y?G>73J+;(j`cac5<=35I6vY;hFAb*+?+P5T|Kh{ z_v6Do>G(W3MiL`;Ac4_Y8(QHpYGF#DoCV#T0bCAr|I2XRj7E5ibc-o1sZM=x)G{N& z(e%=Ar%-A_yBv)!mDi;gq~-zFpVgU%%CoU_ z&K1${C-@wRpMPhp>O!QCW{0y9ZB$Tae96y@roTe65s=Uc2 z@H^H4C_p^VzRbpr8Z~P4sBxo5kDD}h%-BhXP8>IG;-QBheDI+MAAI@d4j~NSdNz5!^rDb|%IV%}fQdT;wboj^-qlTA_t3>9c zvSFV(sA72I$>D>K`Qk;P5r=%|>N{qC`ZI?v`Sr@ms^pjc+%)pD-)(#AA8)s(sy}wk zofjY5{Jo_ebAEGey5_LIobpfkox8sL+sAwU_3qry{r6A5a`*Rt_r#0uU3bs_Jo(b# zsjJpp@`LN|{ryufZ?B!VtaI&GFT3Hsho63B$0Sx-3T%gQoJNiqUd>VXRK-EVfWa4! zIe2*JqVF6+82oz4pWmwd%*uZxzx3UvwnN)fRd0WG1R*f;*y`W>1xQ?bSjU`GYSQvQ z4HVol_?(G?@*Epi#@n34X0bPab$$I~yYKtjD|Pq(?)lID?t6Q;_FwVhll24dK7ah> zm;U+jimydqJ9h8Dnt|`$I(Ys~@BMA#m(HtQ`o|k4R*w18MYrv^_nO_`y7$?Q-(UQ* zQuPLl*V|x6>mkpk9opJgP7EL_$7oSM?`(Gcr?ZuY|1~=Zg?1>}pI^p242Os^J zjn}sSD0cp{mn|Ist4q(SS@xZ~h92MZ_AUE9d;C#uc<_x<~({b|95 zC-3;pmiYgySupcfg{^w<`=@X0?!V={^`HFy51xJXy1};B4{P}KtKAPjvSr;5cRc-_ zAD+{4-%}6Yo4oVv7oME4XWt{qOIDxt#M`@HdFt4wcHc2^!Cez?xV-F#dycsGjVr#{ zKl}HgKmP2VH?R3+yltTK>eqX#yXOxsn|oC4(Ra~T>t5(T@6TI)e)xuYudn&!)Si|*p+a z_HpU?HN6YFZ@K0tZ@qrUuP2O)&)oLt;wN{<7jNlX{?;82d}Z7puY2%>V}JkjifSI#^5sV((CKjP3OV{g9utkduK^7%J>?74Hc|9I2( zJr_K>JAKGyKihZped&RlADpqh{mK9S)A(Ie&cCvI-OnGr=?9_9-$>oMXVIMd>z>$f z!$5b>?j61J-@9c_{K=zlj*hGT`yH2^`uFWG-hTi6pSb9S`*%H>c;v2K7hI>XpY9#} z#>Ta$J@ncOV>b<+_~u=2^qjNti65SJ&bJ>q^Wx<W+P9-~Z&DSKaj0_S+J-U4PdxHyrlh!>d={Qa!Ze{(&Dp@!kL1^M&(v zoW6O}^iNFdT-dYj$?%&qzklDf2kzSRhev)oV)xMHp^8_p`No51%<8-E@xd9h=AYGh z!#_5h^_#nHeJ{G^A6JC_6nguPhi^FLnXPHL=8Opvwwaj@xYFg zUt3o*^RXYzt^U~V_}$OH+VRZm&+R?;%Jy3xxc>BwryOzgs)0KJO@0{0W zEPws%-mR0*xO3mQ$-$GJjBWkJty`9FSJ?9QlV{%c^f~kI`rMYMe*aWO;~yS6|BR=` zela>@d))(nz2Xb~r~K(24A6ap3vcdS@ZaA(a?w}L+4;-6ev*Er^M%JRcxvy7iTtykT5>jRJe?S`9v@x)($@v~?C_yXVwxd++R{&OZCo|9I)qr(<&$ov`oBzMbdZdCPrI zC~U%IO^^NNq1Wo`k9hj&Z!~O~(RlsyS3UR4=tuwf-1r}S?5@Awwfk4|p4{>BzvTD6 za7W+Zm)`jC;ZKKuKJ8DD4fkxgZ|m0Iy|CpU_f5F@>^;f;d5dq@{kh#k-#xKc`M>uj zUv=GJZ0D*|Pd)TkKl<~%&$iwB^Yt_S_Vh6qyzpv!;}aFVTem3eoz;&dXTALNb5mc~ zzV&a{zC3gD!T101=TdT0`XPx%dx^73hy9C!5F zPb%!izwEpJ|6cCxTKT`*USFoL@11>?!rG7C(W@}|FABS3u! z<$GUL*#9g$ta>PR^uK0azNc-=vkJRs-8tJ|I%n5s7C(RGgwE}kOy0ShuzLEk-e(@( zH=wX*(?(Ti9(muc|5ez3-8Oag-oMWJ{f5RD*8ZgA!F}_}N1T7(CvJZH-fh?4JmH?f zx^uRFr|aDd~f&ak6*HE!<1;>i+B8EUH`s|dtZKDVI83L?eV?O z_rCGtQzpE0_OE^oG#(v1w{!b#hg_wwuA3Eh;;{<5qW{zd6J{(MG55lK*WC2y1w+tY%=(v6mV3+_?7m!R-_8{^Wy$^WS~qy!BW0wk#fMS+?cq)6Q$ZIsDp&&g1{PZq`{qUE)Mo)U5sU7O>-`?{1uO>I1vtsv-`CEEV zePHdP*ijG0Crr?*l;EvXTCC~qD?-iHNIChpC-SG73cW!#CXK3T!ZuwWwrk^c6 z=#hm(eJ9`j_3mX$UU+QgQ?EXJ{uRG$*K6;3ruW@XZ~ft(S?6vWT>bnn-uTW5&)>IZ z;HA&DzIn>)Zyc>WtJ>3_;^yKh_~uKLiL8-zusBsGbxl_j4rexF-%oK^-VdPxPm zRE*IYIaw0ozsc_Z_E#f(B};h!6rcZNWA`VY4&0a6YA z$EShM1OJ&kU{M|=q|8kpWfhI^86A0mrCEI-T4TCXXFy zFL>4iy3dhosCmhlaKEHO%wL*}rF4hbm{pOeJeMEdtULbZ8Y!rIc0~&T!pXgItbKiRB;6$^8>5}@L#DfMwi)+BPP8Rc zA2i?B;SSKunY^O04xO$7E%ox4 zY1qMLS>B)7(H?y}got{GEqh)Pj#AC}O8E!b@|VaRmRvh@8&3SwYp40f()fbzaHrfF zPIn0&%0o^`$vmeqWj3Ufd>nPvvxBq&b!cOBZFqgEv7@6gnr=*|laZA@X<6rk@kUA$ z{NEbt#9iZ>qVbg62xn@zlXDHy*r++NcAP&RgM*)MDN))%#5Zl>HAwZug|>DkG{qC^ z#f}gej%e;tj}MorE^@-pmb*}+v7JMOJ~lty9o6%j;@t^&O>ru@=J+3>VN|MJ56^NX z${fTg+t#ykRXo}uCoRtZku1WxS(tUgZd11|CQ&Z6ihZ4xktlY)965?8H{L9Y!|3(F znqa1$vS`6+I{hv6E{nuE;%g0B9}Mqqq9@$~-*Y4ZSp{W`yu(#`yHaDc*839edWd$_ zsdKP)uT#y9T12J8_~wCYQ+gFlt5UD}NbNqOYE(H%=W2uY204(k5WF>KU0OX5(dcsd zy!b+#Dya`alyflZV&!}kTf&KjarFRttzj~9$LV?GgV)jtX5xZad$gy6YU4-S>&+je zrJo@uq2iJ_C7riV>^EXT4Eu>(A8Cf(*oD}BniC^&NNIJ`@Q+o;?KFM+f!aIh}p&Fakr-)Yhi+FKMEM7#Zr8F*-WkKBm9h zK<&Gy9vFq@#zGr4_278;?gdNq21X)n&S?wg>h~jXkJno0w+E}YZTuj9;>J^!EYS1D za?RZu$1az?A&o}Z1Rbl4oQcaYFUc*DSfo1~wKVcEo{og2@wP~Z+#XH}VmA_`rc*i% zit<_M8fuG;>P}Uy#kG``{`7Z@ed9(pmZz&f=v=N=T;K z5kN8ZTuc*G-_rGMU5w3rh?VI3Y+9|xMNfZ-dX2w^X7$Q|t%VY7>AHnPN3v1yI~~yM zf(h7{j=`xwJJTuF4rf9Vzo)WuwTWt68k?W5g=mvF2CDjF~=t z%;=z&5ou448BGaD>4+d!1Hbs~=pfY>IBrPs=-c??QGDi1f^H2b!=1@+qH9S{%&enX z-KRwwp@4L)a!dI(3LKyuJ!^DOgW~#>T7QNe}gL5OvRGOwXb;2VYRkTM3VZJ8QnaP*~GZXpbq(&DBRnWP^Jif@9 z+K7OJ`RfySVFv8uKswnY>rEP|9n0d$j<(2oa-dGnYfZ{(cA(Noil@@{w5E70CAZ_~ z>@`~PR3N06KLbW&pt8p7B5#F4n_`_9qp5X#+$yG4R_cQ{I=B!^HJKlvtQOJ-(i}|i z=)5SpLo`s!(CF(QjSEHxsn-kTFbOI$4V<(jGFi+~nU9x6P`Op%Xv!eYY=jx5!kyt{ zL`**kc1wJ9&*CK1lUW7cUXxr;14}j(Z2P1YNaa6`0fE~7=W5<iAbn;nxz`S1 zg3)G<0NrsGuC6vYZf>||-E1sCtfK)yq%MHH7ikyMtvq9u6P=H0LuSpU)z}8}5M(v8 zbel0Fg9mL9qZvX^EuJJNW0YuZQBN}p&ZY$<*sHB8vI?Cx8>4PFg%cLBqZGZk*%F^l zsRpsjZCJA66>42r&v$l-Sqmeb;dD<@P6?Pbo5`ZMXb3h(k}`i~5N9-+4uVTl2q3iL ztTP@D_aW_W>WqaD#U3oyO~e<)XXD*Nt3}*kIYzl%s_7b?AE`AGZDMl%7d$l#pM!O- zm@3s)RfhsoaXPsaG8B&{qJRfQ;;SLXILAG|%5@b)S6vO6)e^>YqhWEF)wX!DKulhk zrV6pwr<;SQcQA-W0gWnOc@Ps;*Hl$&cn6!hFqyYQpPGYWFx31A7FUaUx>v%;5?eVb zoa%~ngbf-7n#sc z&&}i&^yg;F+Uk8Xw5L?~b8}QCmj?yn`*X8DH~Vw5x-RtB%|r)(ZuaNq56THPrP809 z{ka)RNOQUQbMr@fZuU)W+6wVaZC{*CtIBtSk$U${ZQs=Px2QhI{pKkZ#-5GW5;e9+5B}l=!3u3F{NKk#7YD#Kx z%nWh~wspnVQb9`+-SX(MiaIs6io@xFUm-2j5O*9w;c$vabq4X+!CZWU|{$SETS zi&^TS6+bGDSV|sZml0`9Qc1CQT0KTLxwK~1glIK-un(sMcJn$VOH8vKLWUZ}LKRx8 z23OJQ!d@ukgqltTJu*|jYU#X1{+qt&gYi%CXF{4S@#R_oES^K*W2w?ANKat#DD%t* z@lV17Uok|`$JuJugXa{&h^p_Pi1X3GMR6YXOn_2}RH}?qCP;gfk1L;0j#f&fy@5jm zM+A;iMoWh(GnBKW(b8CHyfjgoB<+)iq${PXq~TJd)FjQ3=1B{rcIjg2E7Dh`OQox& zYo+U?8>E}0-%9_IUXoss-joKV?b7Aa6*x8NQ|!#+*;#A@n~cc*Y3zhgm3?Y7yG9uv zkaV07b4?fp4i6lujFJvfPEeLhqogs?IB9}Z&dxlJEobK|FDb*=wMu~9ARVNXsgNhh za)JXM8u+Z5qDK~M{X>J3DT5O^U&6J4fU8(qN793E*@&iB;n`2MP<~w^4hpu!&yAea z(;cxf$O3xQ6>7$VQEFHV`gktbjlH?D1X{36XN>@+K)uF!t0t8zcqRb|x0iMX^& zUPKQNN6lzTt__1mhVh_=`DBIdDF)jB7=&NMpKGB@+)H)ekQ}B3d1kc!a=@vs9V)zr<^D>+f&1FllZG8-9N+80Y z&oPeHNedozO`^sy9*=CruQ*y*f)+b5Q%A|9Q>PH;Rye!o(u#Sa(*pEj4cbewxo9iq z-3!L_A;)dp%c z^SL?Rjz?c&Y2A#*8iosnu7}+Q)3>1&nEt*E?c30JY&laH+|~)c4Xw^Zz71{qMg+4^ ze-K!=3Vj<|df6v{Ul(sf&z#ARsxc3- z8MZdekEWrcSVz-uzFyVNQZW;dJBo7k*FVs2{wO#db%RX(Zz5&1VtJ6Dr`Ff-lW_Dr zTo18jFQ%jSY*mb*GE3rg`ka2G3myGJwdlvaSZbu7be4^Fl28D*<2_DhQOjzl3Ss-C zgTtDq3Js_G5B;e^Gp32B3Vl&Mp68*nE=2bo{`gr=bdC`IN;w1I!QA|%Q6xZ*mM>Y&UNbKOWhtUu4i(}>*qVAE^_5d4RpzZma##65T0yJK<1t+BH3X$GZMgX`?^$E~LizUr%SW)93|u#-qGYW302`Y`qA2mrBP};C0akGnqB5?$#<@ z$I;ibRz`c0M)^bZR5}7ICF@9-sp_#``nh@xC&spkG-&He5DmEAThtxUPbH(1=4c01 zCO4Z}T~l&RKs%hXRIH;Z*-9hM>!9h!PM=eg>2_;ccIbxq-_=I(twUSV#`9C;uyN8Z zreU3+(|jeb*QU=S+Ok?Nph{h$VbFwN-nM+f4ms-NGgCF3|> zsicImEQt{}aJ?#CmKy5ri3V6nzYeU`*%_tQ>8N+Jb$&eguO3uOzy%m%fTBYw^|Xiz z^@VIu=%N*DrM!k%XAuXZeh`lM5O&mzfhC6$Pem{7@8^>s)hFg~==dr+lkga-neJ(R zRL?a;ih3|Q&N)>7DBtxALud=0ug`IrXBhJLFMjB?apOCpHa_>JSI+vz|C{{Kyqg~G z3jOF0IxUQA4%(Pra#u1=gUDGM4@=>kO8{A@PIU}}Q#(SZ4Dxi-mK)3ORSSa3@zG3# zQza@k1=tR;4KA9E-pXUpo%Nv@N*EJmZdFwPUHMBMaFGM1>y{0?0 z8b2Sxhua0}d7Ze+{2P^-WTXs(^5mErDe8|>_V{^m77yH!aaD5^c?!?5UQ5}|$G^ZR z#eP+Ds5Z*6UU^?MtxM;ij>9Hh7v^%>u%nY>1N@}X1Y6I!QPaLDM2qozQ$I|g`wzYL zZBpOXVw@mblQ`thp)Zem==5W2&S;mvWg7!%Lq4Oa6TZt@k8|^vHOQQ~d8Ee8M70CT z#b-8r`a%sk-6CyR^^?&JNTasj7cOQ$Zsojcy{cUN#iPE)bF5dDS1E;f)p}KPs20kx zUaeeArtU}^7pwX1+&lgw!M)Aj;{7nVcjXhur4QeIjD>sawV{TkuAe&1F6C*fxR$w; z8?TpAZ&gnP7?uqu{Yig0b8oq>i;u(0mpkQ-;{i-{Mn8nBx|V2~_pk7ofYV0%(q+h+ zCami8Go4W&?^T_CKr~gJ)2hybg}yV!r?2E_$sE^jCF6 zg;Zgyy3c@+zy zp?`z?+rRpBaN`F|Hy;v?Wux41^wWJ=w(2mSXMKJ4QPT-N&-y(35#-tb$1Y;uX1`)r zvv0BgVwbS5u&=T&u`lCu3I2Tz|NaY~Z?W&O3$P{m4W54qyBPm2L8(jF*Lm*cY!iDD zd6%&TYyz98{hP!NW0TmSN&}O&u(I-ohQJOs)Ubt7!VWCZ-fLjxuQMiXZ`g^HT}T;3 z%B!rjp|@{ee_3B|Yv46jDkXaN_Lpt!Z7AQ$$^t9;`q{R9N?CtjBCw6aGU-jm0&g_D z!RvjS05$@8Q|}6C4|Wk*KiY0klwP!rDC*aF5?XI~M=9Ifx1#(l#`?D_J5de@G`y>n z_HS(6#!Ab3w{2HS2m0uDL*KSRrF3&|;2l=d(7z9bOE#}~8*uL_WdoZMfp;0}eM3R} zsN`K%vSMJjvQHVlZPN;D71$6c*;cNWBMjbDN;WmTBeegPQo60T9F-){Np!S-x55T^ zvwIY_ncr?4WF-=?DB0G}HV*ZcZtO?VlFbsZ=zmKo>2Dacpo6jv1ACQyAle>OEs6M` ziA_2>M5Df)4P`5OHvyoeKkyza?N^kY+Sq8>rM(+BqqPAEjr0wHSStd1*og9m-pz{A z{~jwT-?$Hn328SQfuY)_D6QMss1>+w>ysGUjltQt4a1PoE2rkDryIAkvR*|=Y@=ZW z8MiaG0@V*Bq`la?9odlBgeuBK?Dt|gxALSN>IkFKKw@ABlvy#TBG0y|IfFo_m#_fe z4cmxoE0yhS1$hFS0nmprELowoTC%BpAKOWN0j7OwP3T%{Ki#4!;Mwq;)-G#BV(%`t zmkldl(Q6xSMH$A?e$$HN+h~YLumW$0Bl_wnzRQM}Z&s9n@?C6L17Z3S8y+B(8(!kH zU@P{p?Z`q>LInlqfJQ8_(~8ngAc7(*cCsD3RfG8zhyW01^z9Y_cISjD{W^Debqg2(Umit-t~hD_&A*0Fuyv2MCK{XoLoVpir17W=Ep| zQtp5TG>JOYZ!-%q-ry|_WTJugdsQ?VURDR_U;F~`c!!ns8K`fA&UL_`*9n9EA+QwT z|Bi?P?_L8`2Rda)3wmeb&%P zKmZLqfUBq`FfX9m&C)I>YM^t-#B5=a4YYusLKsWYg29)-164y4(8N$Ou;O))?4KMu zz>xq^wPA$H3=o9{YV5!~wGFAgpt1u!c59=u-G)dn7e@gRXz&$O{SH>rfawM^X*uRX zYW|-(M*lY~c;O#FQq+(rp_9`_XTbeXMmSZ_+ZoQh!yUQM0rO1tl!Q z)4QveVQ%K#-`QKTiHxbu64{%H&17}KDsUvtPR-6^y@R~IzPEZ+`d|iMu?h51Fu*o* zS0f2p-{gT2><`xPHZ{G4tg`{K?iw@z zg3i$B>~b8P(tcHL$P#Cm&0t``5bOhIHGl`irr(7X45l#~rey=`BjS}0Ikl?}#BN)| zeOz7Y4O2VB^(!D0|ALtGqZ^w+MA9UX5>g=LTxiP`GC&9nV~W&P%yGR24L~*)0I!t6 zx@H+9P={-i9TU`LS7E3dsfm9=aJON|cB`6$3fj~cR8<2o!YV<)Vu+291}Hrf35*$4 zt@4M-muLpvrG6Ru3w1+BY%BjK=u0vSYM@TiqkW(qM`Q&i8I>9s-c4M-1w8h#;oNp4 zG&Za3pvfnUHE6eO0hLoUJTSMRMUB1&9;kXF+W80X;wE5$hG zXs6m|XnOz^sF-N-xrG6RUW`#$A5cXTo46@V%|h+-!BE9V8w?nH4QRk-@M-LWW(f(@ zh<0c&HlkvV1n9C+M?&RIj31iKzybvmud~ttvV8~%$TX5*`B?}79MDW}1`aA?qFD_I z0>oVa1mH*jDa_ub$koho7aRbvS?y<^io{!N6o3*8Na%yH)mYC^ea2{@V)S_vTE$RF zWO!{;DM9dj8L$F%sLKGd#*r(5vb`cDP(@-GLk$gBY;3~CK!Xnma&$DXCL$@sTw_B+ zzQJpqKfPyrf0p$U*4H|&DYT;~SBZ;`I-#}!W zy727FSSAv84ge3-j7f%@P*|MN5_@y`ZmiCTP*?#H`WWj0PzwsziiR$x3Ln?Lx6lV* z4qJgZ;!QRJfC&?iw-`%sEp0;tb)#VKE1K5YsV<#qov5O;2kX_cJ}$N@DqJ^+w$~PB zYA!aMu;_z|<>>UP7AVl65gIVa0z0A=RuUWrw#7V*y9OGH*Hn1eNxZ@VtmV~}G<4t& zAPMSh)?i_wqYDrtP9Cf$TKoITbt411ooqDd_93k%=;D&{UNA?Wx>DE*%3%7`IR{>g z2AazmP^TUnER1GA2WZriK6s3H6`1tM+<}$I(`eEwDW`7rVs71qmdSHMWvC*IKme^m z?QuL`Wt>Ab17jDAHF#Fwuvq~Rnh*D>6_*WcY?ZLKYJg7&&>PkD)fM>p+S!YVupzOr zpSY-`9L7=UrbGiYIHU!BBoyC-WewF2rtei~Q9zfzZN0lyLv@=<^<8Wv%JlcHXh4l6 zQfmo$uHg9^Vz@2udk4)nsH^2SR8dDiSOXk*0~-V69MqkP+{{2z5UGK^Y#W(M+ZddL zZ((``+T@!3I9+#ZUwio5-sPyZQ}Q+S&(iCw!SJ%87HyZ?~IQ{1(UQ zP1WB~zE{JEE4Ga~mCDLj^bG)7frFG*Ev12m#J=8=2I;@qBSi9s#NOVL72y1mK*OG1 z_<4_xy5h= z^xG>{V!Woo_F>3KS{n3(>se{<=1oJrC7XyLSG=l~yB=NKg&|t;ijhz%^+6aoab89u zdtdg`srMIYDEL=({69!KyicQk@J0BygMa(i51tP1)2JVN5&rGq-~RQ3rvoeWuLRGu zWd57@B_5-IH^i#|X2`SEZtj1T&7u3rwFLP!9pc z;nMWmI5-c-SzGV<4GzVW!`(~6odG)5J4%N+@xw%e3p#M-USw4SQMm+U9DM6_Mq)ra zSTZnkruM)1_OhRusI@BX&sM$8P|R%aENa>~v$-kWAuo+LMe)!nolR&ZLCR?ebkZJ= zD&+2!I7fxU@CsVOi3H9~HQ?xE?4jzRYLsolGlpoESI?7chiaXY>xb%{l1~^q!6|vh z&-DY;xKcS=4)I>aG)sAi~!Cx^t*sT-k%Zu}-DOOXHoA zCrT5Yk|#-%oRSZf4s}RYCMs$rmBQ#KXDes((qb|W##i~_oRYsPebp)XQt48sztBrkZy2FzDc^tDfze3Z=I6=CH>1O`6cNkr{q_pSDcdHl-_ho#;XpTlJ`nO zPRYZi;SR}4iBiIot3+lyS~=P&8EX^*tWAvsVUP?eHcTA84zDy&AVq*N;9 zm59lBRfMVsYsJzfl8U#OjMHRQk*X6)2R<7(me(yNE5npwJh@&d&8}rCpNPqL6NEZw zw&dZ8O4tfMyBl*IyM|rEE4QcL&Te-~58#w+$MjI3$|+sK{-ByJ&au*LNmZ#8qB@kC zB~_=|)8|Ta)p~5@=S%Y)(@&IEI;M9>Uv^BtM7qQ={cF;<9Md;S-*ZY=$`w^_SJ+hA zHIhbWk%gt7N=j_KQ^cb(Eh zfl!lU`h_8lf5d);{x77;eTA4_$tssQ)l>P!$~BJZ7goODl)i}dUFVbzHq?waQOxoF zl?&AJqCg`MS8+-Y92q#$G5x5(QI>RW$EvpbSy)*_QVE<(v@nvwOKJo&7UG0bqSd=J zyfP~1W$)&7D6!2pHcf2c!cSaPPv9pF!GGBd=h-se44q2m`0qvL# ztJEtS)~QD}S*c#x7!HqYGG@K9VbpqML#caZV}|g`#=PQ{4Wn1fR$nF}(iC={NA3*I z+_SuL$*^>{Ov?ykI0NP|MA4pL`@_{UPY;3ZTPn)7(n2=K| z^yx^OH2CsERDs|`Q8aP`w@qeMj$B?<1eaG8#jI6DF)Q%SPEwGTGrI##0iT_w4)8Xj z!jN(>KB{d*&2PS}cC`_7vxTm_V-B-zwN3Tp+qS3r*Lc;vZE;L&ZJYYv5pQukOxWCd zEo#1ep+(JSLg%7&s{^9?%NN?F1M>#=vNUwsxsRB)rIB^O;Z8!`hMAo=^2M>6O$X%N zx*N;oHtZF-@tm94QRApPYP@xaDMJo+V~w}$Yp@1By3tV+@EiqqFi&Z(1spzZoL6I0 z|Kixu0C?FdH8xvCgw|ID4n6f0Rrj8H%cuvOr*L|}iPlZd-SZYlkM;`W0B-@*+QZ7% zVFm`Hdx~E+U{~SefSv|_t)t}C<|=s(wsUPxk_SRK!sbGJH&{;@%%Z+)i;}_GoMg}q z?_31Y4K^ofbOp{uv|NEbr#q8n9f#Srd~gqbUPfv=b*^} zTp%d{=|zxii(Y_>Q<{i1DRM7m4sg+3kO}U>uz)O3odXj8tt;((8nvzQ^8zh=hzezQ z>Z{lA(%5+DbOPTG4DYh7=)SMW(aK_QV^^ps&a22y8G~~jraLsBl{8N9wh0gH1qhWl;v9f|Wt2IAstjZb(7}D}zwM$^e8eR2cxYz?lzlg-(40THxGAprSG`mrc3s zoe;dJ4RV9Gv%K>jAqY~${8#WUA(|CwVw1FNTBx{vLbP7!{8w2p%Y)E`vOGWwWqE)W zI{yK*P?iU%IJ_pyl6K}34KLuhrXikm<9H8nJHtC~7otx^Fnm?PI=;BAMqpjkv|Cj$ z!&eo|@E~-d3=hyk86Kd8GCV*FWq5$PF?>!s9`J4)?*(sXdFRbspjHIS+qYv)O>JTZ zbgW$ zAYC@Y#fu$lvg&eg=t9{M16~w60^UtAn}eRo&USWm-ZaA=xEniy8tQ*ulPYHRN}cxy zD%>{+Tr1TZ3AQHX4tZ51CU?*?&o(yDpOoeyyZU3fc|4|2iDxN+yb)q|1m*{8Gb{207AJ2JSm?9E1`b?nqG2L}XX~_W zrI{zNXwu{fEE=JC0=q3WiCkIxEczjwTZZmZ|J$r3XCEZoJsulF-Ut=!fh^7eS)Bi| zVE1Fe-bau)+fveH#}AOAh-9u<+#w6}#Gp-4IPz&zlnfKnYo(yak)mNyHgW^Eak;bO z5iXvBxx6^%VR6304A+(uO*~fI8Lq7y;cY~P_2WOMz$bKi3bWd_ed4T!F@LKd!8~c`KWz}eSbB<>Hkb|rVzW_l9+8|Zc&GL}rO5+NPZltl)nOwA z#PJlOY{13X?arQ4yW`ZE>X?LVE=-!h{KpOK>vPLG$B|xQ++BXO_MZ4m&T(uwC)siv z<(ve}6*w0ua|O;()SUaAqo_Fp7b9xU`w8yb3E9`|{__SnUluAycLupES3%+em&kw= zO*?ailf6yRs>=sb6pnl#Majs7ger2|&PQKG(Z~tfX36=_8$f9-$7XD{&0H5&^`AG$ zB3J(N2Acm>U$Q{8c?rG$yn(*mMsf*a6{^q)v_OqcparUQ0`(eR%|>w3=>%T9QpeKG z$wP-^FVwPfp8vc7oxA3+cLf$Ll+*m@4T70wi_2UKG8e2209yDE6|4-hS}~VB z5bCg~4RV9G*?8!=qdLGAOTpV9sIyRd7PsAphQ&2qCi{?%b=z78c!8E4AjNfmX2WiL z3qlvTo2!{8cH^`mgLFhsm z9-sxT;AwaZWq5!VYVZNnjp1|B@ql;ZcrSQ6%R6t%0<|Jo-hbWz(}-~#Stk2?DKh_g z1BVy^aC#B!Xx}3=2gDQTwhg^vqxeI96hHK!5id<|&;rfuie{NcZBz<48oigHpr-EJT#Hnr+U<6GUd;s}uR z(8tY4w|mt@Xx(0Q2s`%_IL*v;0P~hK4>(T|^MLb|Ee|+Pq4I$9lqL^2PchQq5Pe~D z-cgKDLDBd&5%Qzz)mIAohxmIeS)C)ya}gBR!1!FG#T7V5k#R=bbKWuK%>rx_89zE6 z1G5~_B%tDz=e4LiT~CWOkSX( zeV-R-;X_oY7n1twHM~S751mfnqTQ0&Uk7lT;o?WfTc%4pZJaj_DG=F%MfGJe3?heZ z9RL@~X?}FPA04l{ZY(To=z2doKEuI;jisXIzk)a5&~TyiAGW3no&Nw@===xJLbVb= z#dUk;EaW!V1GJd=58&ebC%P+Lrcb+$cix6WpNi1&esp~9OaMX`%J2X!l;HtdD8mD^ zP=*Jn8^h^m z!x|lLU0d07ByF%9$nf~AO^e34`dZd_c%WrBO7F0SM9g)WL)Y^%9^+jd*a>4WXiZ`)F? zkVtu|-JxdPjPgU}b2^m|&Zh$17Jw8P-ZXRdfp>A30a9f4d>}69WL+H*PM)X2O4>bn^%LL=hu4zdWo1PpqFrY0(yy+C!iN67=Q@NaM(W25;pGw zZ4;+L;^wV2Tf&QV`^oz_`mDe?k+VKIZ2mW zuX7VISLmF?#T7aynQ?_KYP54+%Q}+WX65HJU^eL~B!u2701mzd|AhIR*0O#K{f9b+ zJ`0oA7aCAlUsP~$eNnMheh|Ip4t8<%{09cnXJK>9%i`>4dXfl|J}$Hbq-e^Bkl9Qb zfQz<_2(CBownzZDA4PBISN9=u-MiNb>;dXEyacXWiw=fAhR0^RWDc(bxXpI)qv$Q9 zwbQ1cD0=I#Iaqdn7`-JrCYyvHG+cDkWwN-NZ~;_Y(c}eMsKQ38;#wxJRz+=KE=6+L zuRw2Y>L53GJI_0B%whXRba-a=OV>3{JYVqE9NHC$BDR}#2K3|T;TqSEZ6j%O6PLnw z=!i86<#~XL!)x-at{QZd}8ZXS$6KbxEGNx zbXJYd=k<(@LK<;5g>DWSC#&Ob7{R-#W-oZIANf~iD81!)W*QskQ2NtZn5||#teeGI z44?V9k0FJp`oZ%UZ9jNkJx;%IRoV}pH(oB_Kn*{5-VdJ72MUlB-PPs-oZ;`WyV!DvD~61I@Vstv zID6qToN&1hi_KKY15mV7@&NSW1S{J*xH-{LFL`o-wuzG;JkM8t^!WUNJa^tY7><$L zUQ=3DV4GR*!hWs+?4oI(FSKah=L?;a;J9L*tMoXMJZI^#K-;9p51vD|!d|(IATUD0D6{Ih*{owhW0-F$yUZBGUkfK)4 zWE&TT1Ei?Y^MNdo$7dmKd_Qo!%d4L&isQVB;yAA&J7tJEd}qdqG=R@W z8Yg(WHt>Vz)%|{27hxtT^ii6S%~hAFnO$Zfv=JI`a|sZgE=XrVk0(87nP;299DiZh_QpPV3$^(G>c;W8>`D_?y0N?$yq)L$ z;Q7o+%KqByOa?Y=MvE^{cV=K%v)M-u>rV@Gw)w&vI;#Y6aHmeY3Xm5+S@3oh1uu9z zKRWN{fz^xA!S)?Jb3jeh{NQ=FAoODR5#yFkqr329#=f1?pm7cAhIiro$e9u%VmpUE zr{MW{Y&}BeyAdp(W+?>G`@!^B&!Ji@cU&I9#bhvJnIIQ{) zpX$Ic!a2C*v*byVlzPVY+GEz zVb8vzPvyxf0yZGoURzG|m z)`F82VSfXmO_gSu_^R>V8S6%k3GHQr=!0TEcEN<^1DdsMk;U_c7TMeeZ7On$?PTKZ z>WtHHcCx%oXmNAGY&kcYiT)-NIyahmnhRMeZqtGJHtu;Ow%&WY#cI;crbqK`T~wxd zgBQnc-iAYV%Db_g*Rb2vs-LHRn5WFv0#$t6 z_~$^z&U>KjDR3Hb9eV05X&!Lm9GUZgc*~YYd!9n&0p}@A9&ny4pur(#*kR)kjP5B! zj=(k%DkNlHXAZYW=3FS~2Ac~N-C#W_nMENT$awi|^vXq|-1?l8Sh)hb89O%n(_x>e z)^5r>3#Mz!#f-D}%wuxBGuk}ax3ZYR(J*_}YWhF3GV+;lpDi*`#UsT{<`X1Mq#%v+{QJ8hgd4xv)T^`}Vp zEXp8Murdf0rwr`-cOurrY@W)%kCD&eiJAY<82KzLU-0f5l(LtC%sT%SxBrIL3!VQ8 z-ho4#(CdZGe}(VCQLBZTC;%;V{sXAj@MfF;04~mdqPxKb+^*xDx8cyIB6PeTA)h(9 zxS5I|bfF9n&_WG9fELQ|04iuKs!2_OVMi%qPKbGDS)L@&pvy)C#t9gTqYBe`-n_6}D(%GGK zwyHf%A-j*x8P+gn^jX60n#&o?lZJj=eE?%A&XGA&)@GyR4kubDxx(ZlHSGIw*4lUB=#z z<2SahJ$T%Y<*N@|OI0OO|ymemiHg6sFew+@%L9*!L5viGl<^4E*kz6EaZo&dW7r5m|V^rXt zAAuIi@&GMxNkgr=vAn(-^04;^+>PTs!0in0yzPfR6~XX+9DnW%4?-8p@Bl58;Q?AG z!vnNXh6kt{!+Ysyeceh->BjM1@OGB>b&W_GI zgy8fdG_ZY-(5YwGJ$3V!q4DfJ^M)4%-E5zxrmVKQAIDz+JAz@d4_fA!b9UrkaGluB zxwq}fImhwa&$ajC_PM9kkK6a-_E)9t=lJ_^`}~L!^&ERra{jsYi02knl(<=epgUCPI5VRO~O0%n#PK+{zPJw8=zZq0f$E zWm~U_;MqEDTe0N{TnwAIuG(_pPuC?|PQaoY-R!eUEbbmLBHe6;wX-V^UXy|YnhSR1 z6?Yy-amR7^Vf)@O357fGGW>VuD#vU6r>`F~{CBy5+qm4>e+N%V!CdZ#?fYT-e%QVr zwqH!#y{EO2#ju21tr)u$;BHQ0ZgFI9-PPvMK*@cjJ4|4F*c7s}JJ0UTGcB3yW{};P z=L~C@LHhh+_u=IX=1F}&;NK7UH(v2(^AFNfqF{7S@iSMm&cLq1#{oSJem~ydkN4M) zzjao2u1DzS=zwv4Sip0#Gx^;a*i+eN1I|&>oLeqJ()@6LKipqGSA^^rmuMb8++SEn z`N#JA$M(ZY*X?rz?2F3Z^#71dY3l;FEqXuPKO>065BJA@S`KO%J0P~bgiOwJ(dYy! znmc)c7Qye-vS{vPw#-)t;-kd2#kqfMzh%{Br;UGXzoDD4QCHw$M}YLh{g)dLthwnC zKir?5$W;I91_6|^mx9b1HCNm|AzCk#}I8wUZj(CBA?iVOa{S}k<` zL#yKOiav@g_8yT+od0qHx9fQ4?LvyIE_lBXz=cw?xUEJsEc!4qhmnZt7J>rsLK(iQ zU>y%a`{Dk}1G(&v6H~fzycfKk<^6E~jETk%_oq46R2N?CWX#TfxWAh(0%9u8Y$j#- ztd?cV72rkbasSwUzHTvz?#0e_?dZH|hQol|41ydY?<$=42aue1r5s(D$+ia*EIS%t z%H~Ka5e=_j7)hnE14#mFJgFe*2cH-z{BeDu46jT`;lZ0i3STx0Db*P@*JPyBQVQ=v z@T5pA6<^)cCZ`1iQ+9-@jYZ*Ze&jt{#Nv1bf_%Is6k}1mEgep#=|p@aFN)8Jb!fj& zlI4WodHe}bKzmoMQFH{b)o4rJ}Ley!A@ckpprt$ zYSzQ%voK4t4j07Or`Vatv&n2Ko5oIHv)EZ|1G^@0NZ^RTQ32^wWuF=?l}M%1aA~wO zRvIr&lqN}sN{v#JG)I~zEs)x!i>0qfUzIMEE|;#5u9U8lu9mKqu9I$%Zjyd0{Y!dD zdPRCu8kDw6d!)V6K50lPQHCp{m2t`h<>SgHl%tgy%2`(0urrTi%h~ztT6RO=@W7GM zC~1r|PMRQFrv1B zxT{zil^bvIw2U@U&w*}4pFJ8CJZNC+_#x;rI$UUXE#fE0gup{Sj}*WoA4wi~A62lb zOxx1yqjFo9ET{9=r%BcgxahL-_r z$l%;?&$`+1Xh&dGIGU2x`vvK6G}5l8H1?$93*~SJ>D_d)2W9j-vVns0`r{pN~c3W3uRhqlhf=yjv6u@IeOXBHpIuehm z$<+8sax$i4-V{!xs0QkVUW4RVWd+dpxSRt$L&d(8VDybDeIXU<(hz!ye{1nj%H*vM$xfYI4x)7ERJ^Y zG1rMbmxzD{QhLJTBnXe8(eK;VhErYo&C*C39qH6>fk8~>;B({2ZW9Dd1q&k5ZlGag zEe2NIax85m%#Cz{V^owt=GJ695yw!X$I%uU6m2(3o)nIS^@df3F|wBQtX!{W>4Vf9 zNvf#fsi5G}R1XXRPGjEGlAc&&G}0L(R49KTrum+5CyE4uCx#Q@n4FRgPu?Li21zF&H38Qpr)9I%qn&WF@jUDGAk9QgPAbFv@D!nAq z*_9S^D7kTUBrt_bmRi8LJu%V@`J)akiqB5U;ng}7=0>8?rg$`-BsU!GfyP+Q<(NiD{}=`<>WZ%hX%9r*v!gQ1J{pD$jCmHG zI;4T1&drUYH>zB!81V#Mi&23{5@xenf&dn;k&~@S>b6!$1#EH1(mt<>as0QppIOGeynKkD`dc#0kA;r7$4%~8VX)cql*L*Pe4 zrVP;~vZvd-Ira`vE6 zTY&ihOrdEbEJ3UZScO<`@la>GtUUm&0#HIDe;k(IH$!3aISQg=oj5C|l3G(|Q7&r0 zfb!?BPjtyNGiZ!z+;=RCCp-8&jks&rTWSU=M+|@3yo1h9$?ZMq$QrE(XQ4CVF*#6K z!{=wc1)vq7iTyme!`2woJ6c#JC*@eXOfj%Q-Z;8OlM9@hSl^{AHGmdgZGIP zYPPN+=!)T<7e$L^t_n%eJhu%nP}%65I3nn!z8=xUlgI*cyQBv47pSE$Mqo~K%Q=~nv*q(5=q0J%R%kp}1m<3+b%3qERlzmZ zboxLL*%l`w5Gu`(gW3Zwi({?fbl1`)nA>Gk&Zjf}1)f4B! zR^65`Z3RM?D}7#P6ndP` z3sYfCo|2N=x-n&)+!F`CX{ymo0r%>DIIBs$I3dTH<2}%J9FDjva3m|<}w+V2#4q(qPUuS8w3F&ldld8_EO;oJ{AL!0^cGavb^{{Y%VxPVhf4=iyhOwxh62e?sZRdj$Gb=F1nI^hGSa}n9_0g%^4 z8y(mg%~>5CVDf$t`iS;C9Yp59Dx``JLL-G-G|~Z`N<%Ih>A*JXqLB`4qb?fBwbA`y zd4^mxQr?Zannw=iF2X|gkI3X>tAt!M(g9V2p$|eMg`72#yUFXuNO>(MoHdf8xO+aV~SRgav&@9s5gP=X!5$PYvAZM7LevtD=C&+oKR9jUY!qeMT^%5Pvpy@7E zQ5GHQEQUa8b@O;;t^q0LHf#;f=2?h^BlVd_sIwNKxW8kat82&`Ak3YiP<0*j69xMD zG0#REx;n5lXxf}-K7VQPK752HwJGFZ)Ppedcy`C1*3@UKgg|_MTJxXXIndAU_|qDn zqZ}XM@u#(XALY@fHS?f>e~)R+pVa6XVa-Z_Wl}kZ_VFV`}cqK zl)kUVUwW&aJVLJ$%zi?gY{u_eZPS@^473ay4JKQ$t+<&XaJ_w(ql=vX4B;yp>c zfr-DvhTe*Um!aXMOdZC_b+mcna;Tm9t|EHf9p6UO`)F)xq;V&DT(=uPCHy8%ggLj&>yQ+$*we|Hl`&H#K zFhXOholXgwQdK*(qOyVxz%{a(Wi_v&3P81VOl|%gVAe}-gfeP!U`WpqXp=kn`x%4! z%bVyJB11gXw@cDH54b{5Z^5w3mf$6d5&ey-B=7vxNCS?u(}I{@`GH_@&t7qC_0cSb zwpCIEMz3DNJJt2E0)=_?qzjKsMH&XB>cAP6hiN;Ig z%%!*X60UGMtZE4mkw`xquaKP^S%(+cO$p(JdTMHB-qdRS9p;&N6;o^UOlx&sAXDpb zpu5o)>E)i7dcp_wG6aQ7AM+n|2*si0Q+OGypdC%Vbf%rI@$&*&5L-k1roL=VeQTSg zolx!6>dHDC*J2%`wyrSVVakspN$C?ApJmk3QVoTtAE>3i23372sP-a1+Z*0=tze!T z28E(0TFwfg8CZW&+??)}atFN#bD_Kj$Gy_rfVb^MWs*6(VV4@$G0_H6y+zF*PQ-As z>W33C=+_S?V$kj%PQ)--eK--r!M-0(#BkvGhZ8XhL;H|ohI#tKgjw!$8{UhXS`cem zqQ7#GuO9NX>ss&h<%+sRx+AB%{H>{u&Y>_ zm9s-o|0wo(c067H)5k7l&$D;f%j{9S9A+&$&C=50>@fB%b|rh3ZD9lKUG@}9SaNg4 z>E9lcixm1d$iF}8*S*RO#9HiTbqf)W3T>swk6DVNg!g3nfb?0Nf?VVrmO zDMQTq+0EflD_WrRA*F=jLTs)U+lM40nX)K(r=`_>yau)PA*GB!?H9)O@Iqpyija=D z9mdSn8`yHt5*bvYB@VfGr@~QnIxAB9 ze^71!Y5(RxE`9V!qgY3L56bIW#v~`{n7tY=5TxEWb>Q}KKG55y{D=8;em5}KtUQPB zoA~|D@rxj>Y4@S@V|?PbPXFKJ`jwbz5anr}colfkZ~8pLXAkPa1FfrYI{(EV_9wVL%oqiHrKV9``ROR0p9? zSNhz>uN+;b4C4w;r={AQHmV-_O`EDjFtxuXc3L&6jwN9y)bO9vpIS1}qiIk@jWiF@ z+!ZfXf}9vnMV?qmtxU&mmx76k|0AX%1a{)XEf*^`WD4mZI=OdS=P^<>`Y7l{IUAx@ zU9L5iiHax(STYXuOI&xm_KPah`PsQ+TB_PAP2Gg3*)J7sUMNe~?A7n#Ln2hK>Qk|x zc1HuF;$Zey$BAgJ4zHf~V3tmM>Np1uBhFI0r;jg3%dy9Q&KPsSXj74U6(!yYTfwxye+uM9|BgE~WQGkz|1}8CAbRznILn(f%q; zr1n_Q?N&ZhFuvar6YmM?Y71&E5#{L6X45XqH!Ef}4l;9V{z;UxN5+)I+hGzKBjbRc zU5=~eyS4ae9(|rIX4si<$Z03LH&)0}&Mk<%YaO&$g&6bg7IEagENvzF zpiZe;R4L3w^(_gmTB^ptXBGiMk%}3Flco037W3Mgoo$`5SwNsmkO-DY+*wRNSA=!< zzAxHBX>V8m>9@DbZrtk~V{X?dv!f>Nmsod5M@p08xGgmCY|0f3F8}9doo)jup#Tdx zB)D5uFHT=Zbu2Y*XBoyPm&WY|sk#b$Z6No?&o^L=qxfoBeM+D^VCI_J_ovh8#wr2Q zhv3&wvR;N2t5l(Zgu zZe1a<^weF=WRVYHrG@yGYUT&!quGb$z5V6b_W0QH?=z^yjM}CaGujcQdGrZlnJxX0)lCl3vdiiy1|!_UOlLS`^CZxsz*G zF{4TaKs$)W$q+owc7(zi@TdQNTd&YTw zQi_nLsWG+Cy)zy|y0M`WsZ0JhM=NI3fYI4lr(K}&({C}OjR7rYv>7>uZdd>5x5bPa zDl5J)$gN^VO<736@xJoTfR%Uh-*Dn+Rp3_4s9_;&aK*)pj;bMKiW&VI3~Vu@W`4zt zc5gJK{CbU6%&5QRDrU4Phh9^5Jt1)U%iBHLt~Jw9qxXo8YuXN<4=G&VjDi;^3pf4h z1?L{b)X&%+LR`#fF{ApwjbcX4zBrTMb;h$wep~4;?RROWqz@TJFLCOdQBHVqz)RN9 z{g|J3bW#+{;C0uw569f$13s?484WFNzJFI`iy5`=uuwr)x$)ylsbn6F{5Zq jeKQ(9y?Gb6AAh4z%&7dzj8cCpX4DTS_08!2@XhEQ>0aBj diff --git a/tests/qunit/node_modules/qunit/node_modules/underscore/underscore-min.js b/tests/qunit/node_modules/qunit/node_modules/underscore/underscore-min.js deleted file mode 100644 index 5a0cb3b..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/underscore/underscore-min.js +++ /dev/null @@ -1,32 +0,0 @@ -// Underscore.js 1.3.3 -// (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc. -// Underscore is freely distributable under the MIT license. -// Portions of Underscore are inspired or borrowed from Prototype, -// Oliver Steele's Functional, and John Resig's Micro-Templating. -// For all details and documentation: -// http://documentcloud.github.com/underscore -(function(){function r(a,c,d){if(a===c)return 0!==a||1/a==1/c;if(null==a||null==c)return a===c;a._chain&&(a=a._wrapped);c._chain&&(c=c._wrapped);if(a.isEqual&&b.isFunction(a.isEqual))return a.isEqual(c);if(c.isEqual&&b.isFunction(c.isEqual))return c.isEqual(a);var e=l.call(a);if(e!=l.call(c))return!1;switch(e){case "[object String]":return a==""+c;case "[object Number]":return a!=+a?c!=+c:0==a?1/a==1/c:a==+c;case "[object Date]":case "[object Boolean]":return+a==+c;case "[object RegExp]":return a.source== -c.source&&a.global==c.global&&a.multiline==c.multiline&&a.ignoreCase==c.ignoreCase}if("object"!=typeof a||"object"!=typeof c)return!1;for(var f=d.length;f--;)if(d[f]==a)return!0;d.push(a);var f=0,g=!0;if("[object Array]"==e){if(f=a.length,g=f==c.length)for(;f--&&(g=f in a==f in c&&r(a[f],c[f],d)););}else{if("constructor"in a!="constructor"in c||a.constructor!=c.constructor)return!1;for(var h in a)if(b.has(a,h)&&(f++,!(g=b.has(c,h)&&r(a[h],c[h],d))))break;if(g){for(h in c)if(b.has(c,h)&&!f--)break; -g=!f}}d.pop();return g}var s=this,I=s._,o={},k=Array.prototype,p=Object.prototype,i=k.slice,J=k.unshift,l=p.toString,K=p.hasOwnProperty,y=k.forEach,z=k.map,A=k.reduce,B=k.reduceRight,C=k.filter,D=k.every,E=k.some,q=k.indexOf,F=k.lastIndexOf,p=Array.isArray,L=Object.keys,t=Function.prototype.bind,b=function(a){return new m(a)};"undefined"!==typeof exports?("undefined"!==typeof module&&module.exports&&(exports=module.exports=b),exports._=b):s._=b;b.VERSION="1.3.3";var j=b.each=b.forEach=function(a, -c,d){if(a!=null)if(y&&a.forEach===y)a.forEach(c,d);else if(a.length===+a.length)for(var e=0,f=a.length;e2;a==null&&(a=[]);if(A&& -a.reduce===A){e&&(c=b.bind(c,e));return f?a.reduce(c,d):a.reduce(c)}j(a,function(a,b,i){if(f)d=c.call(e,d,a,b,i);else{d=a;f=true}});if(!f)throw new TypeError("Reduce of empty array with no initial value");return d};b.reduceRight=b.foldr=function(a,c,d,e){var f=arguments.length>2;a==null&&(a=[]);if(B&&a.reduceRight===B){e&&(c=b.bind(c,e));return f?a.reduceRight(c,d):a.reduceRight(c)}var g=b.toArray(a).reverse();e&&!f&&(c=b.bind(c,e));return f?b.reduce(g,c,d,e):b.reduce(g,c)};b.find=b.detect=function(a, -c,b){var e;G(a,function(a,g,h){if(c.call(b,a,g,h)){e=a;return true}});return e};b.filter=b.select=function(a,c,b){var e=[];if(a==null)return e;if(C&&a.filter===C)return a.filter(c,b);j(a,function(a,g,h){c.call(b,a,g,h)&&(e[e.length]=a)});return e};b.reject=function(a,c,b){var e=[];if(a==null)return e;j(a,function(a,g,h){c.call(b,a,g,h)||(e[e.length]=a)});return e};b.every=b.all=function(a,c,b){var e=true;if(a==null)return e;if(D&&a.every===D)return a.every(c,b);j(a,function(a,g,h){if(!(e=e&&c.call(b, -a,g,h)))return o});return!!e};var G=b.some=b.any=function(a,c,d){c||(c=b.identity);var e=false;if(a==null)return e;if(E&&a.some===E)return a.some(c,d);j(a,function(a,b,h){if(e||(e=c.call(d,a,b,h)))return o});return!!e};b.include=b.contains=function(a,c){var b=false;if(a==null)return b;if(q&&a.indexOf===q)return a.indexOf(c)!=-1;return b=G(a,function(a){return a===c})};b.invoke=function(a,c){var d=i.call(arguments,2);return b.map(a,function(a){return(b.isFunction(c)?c||a:a[c]).apply(a,d)})};b.pluck= -function(a,c){return b.map(a,function(a){return a[c]})};b.max=function(a,c,d){if(!c&&b.isArray(a)&&a[0]===+a[0])return Math.max.apply(Math,a);if(!c&&b.isEmpty(a))return-Infinity;var e={computed:-Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;b>=e.computed&&(e={value:a,computed:b})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a)&&a[0]===+a[0])return Math.min.apply(Math,a);if(!c&&b.isEmpty(a))return Infinity;var e={computed:Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;bd?1:0}),"value")};b.groupBy=function(a,c){var d={},e=b.isFunction(c)?c:function(a){return a[c]}; -j(a,function(a,b){var c=e(a,b);(d[c]||(d[c]=[])).push(a)});return d};b.sortedIndex=function(a,c,d){d||(d=b.identity);for(var e=0,f=a.length;e>1;d(a[g])=0})})};b.difference=function(a){var c=b.flatten(i.call(arguments,1),true);return b.filter(a,function(a){return!b.include(c,a)})};b.zip=function(){for(var a= -i.call(arguments),c=b.max(b.pluck(a,"length")),d=Array(c),e=0;e=0;d--)b=[a[d].apply(this,b)];return b[0]}};b.after=function(a,b){return a<=0?b():function(){if(--a<1)return b.apply(this,arguments)}};b.keys=L||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var c=[],d;for(d in a)b.has(a,d)&&(c[c.length]=d);return c};b.values=function(a){return b.map(a,b.identity)};b.functions=b.methods=function(a){var c=[],d;for(d in a)b.isFunction(a[d])&& -c.push(d);return c.sort()};b.extend=function(a){j(i.call(arguments,1),function(b){for(var d in b)a[d]=b[d]});return a};b.pick=function(a){var c={};j(b.flatten(i.call(arguments,1)),function(b){b in a&&(c[b]=a[b])});return c};b.defaults=function(a){j(i.call(arguments,1),function(b){for(var d in b)a[d]==null&&(a[d]=b[d])});return a};b.clone=function(a){return!b.isObject(a)?a:b.isArray(a)?a.slice():b.extend({},a)};b.tap=function(a,b){b(a);return a};b.isEqual=function(a,b){return r(a,b,[])};b.isEmpty= -function(a){if(a==null)return true;if(b.isArray(a)||b.isString(a))return a.length===0;for(var c in a)if(b.has(a,c))return false;return true};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=p||function(a){return l.call(a)=="[object Array]"};b.isObject=function(a){return a===Object(a)};b.isArguments=function(a){return l.call(a)=="[object Arguments]"};b.isArguments(arguments)||(b.isArguments=function(a){return!(!a||!b.has(a,"callee"))});b.isFunction=function(a){return l.call(a)=="[object Function]"}; -b.isString=function(a){return l.call(a)=="[object String]"};b.isNumber=function(a){return l.call(a)=="[object Number]"};b.isFinite=function(a){return b.isNumber(a)&&isFinite(a)};b.isNaN=function(a){return a!==a};b.isBoolean=function(a){return a===true||a===false||l.call(a)=="[object Boolean]"};b.isDate=function(a){return l.call(a)=="[object Date]"};b.isRegExp=function(a){return l.call(a)=="[object RegExp]"};b.isNull=function(a){return a===null};b.isUndefined=function(a){return a===void 0};b.has=function(a, -b){return K.call(a,b)};b.noConflict=function(){s._=I;return this};b.identity=function(a){return a};b.times=function(a,b,d){for(var e=0;e/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")};b.result=function(a,c){if(a==null)return null;var d=a[c];return b.isFunction(d)?d.call(a):d};b.mixin=function(a){j(b.functions(a),function(c){M(c,b[c]=a[c])})};var N=0;b.uniqueId= -function(a){var b=N++;return a?a+b:b};b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var u=/.^/,n={"\\":"\\","'":"'",r:"\r",n:"\n",t:"\t",u2028:"\u2028",u2029:"\u2029"},v;for(v in n)n[n[v]]=v;var O=/\\|'|\r|\n|\t|\u2028|\u2029/g,P=/\\(\\|'|r|n|t|u2028|u2029)/g,w=function(a){return a.replace(P,function(a,b){return n[b]})};b.template=function(a,c,d){d=b.defaults(d||{},b.templateSettings);a="__p+='"+a.replace(O,function(a){return"\\"+n[a]}).replace(d.escape|| -u,function(a,b){return"'+\n_.escape("+w(b)+")+\n'"}).replace(d.interpolate||u,function(a,b){return"'+\n("+w(b)+")+\n'"}).replace(d.evaluate||u,function(a,b){return"';\n"+w(b)+"\n;__p+='"})+"';\n";d.variable||(a="with(obj||{}){\n"+a+"}\n");var a="var __p='';var print=function(){__p+=Array.prototype.join.call(arguments, '')};\n"+a+"return __p;\n",e=new Function(d.variable||"obj","_",a);if(c)return e(c,b);c=function(a){return e.call(this,a,b)};c.source="function("+(d.variable||"obj")+"){\n"+a+"}";return c}; -b.chain=function(a){return b(a).chain()};var m=function(a){this._wrapped=a};b.prototype=m.prototype;var x=function(a,c){return c?b(a).chain():a},M=function(a,c){m.prototype[a]=function(){var a=i.call(arguments);J.call(a,this._wrapped);return x(c.apply(b,a),this._chain)}};b.mixin(b);j("pop,push,reverse,shift,sort,splice,unshift".split(","),function(a){var b=k[a];m.prototype[a]=function(){var d=this._wrapped;b.apply(d,arguments);var e=d.length;(a=="shift"||a=="splice")&&e===0&&delete d[0];return x(d, -this._chain)}});j(["concat","join","slice"],function(a){var b=k[a];m.prototype[a]=function(){return x(b.apply(this._wrapped,arguments),this._chain)}});m.prototype.chain=function(){this._chain=true;return this};m.prototype.value=function(){return this._wrapped}}).call(this); diff --git a/tests/qunit/node_modules/qunit/node_modules/underscore/underscore.js b/tests/qunit/node_modules/qunit/node_modules/underscore/underscore.js deleted file mode 100644 index f6f7e2f..0000000 --- a/tests/qunit/node_modules/qunit/node_modules/underscore/underscore.js +++ /dev/null @@ -1,1059 +0,0 @@ -// Underscore.js 1.3.3 -// (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc. -// Underscore is freely distributable under the MIT license. -// Portions of Underscore are inspired or borrowed from Prototype, -// Oliver Steele's Functional, and John Resig's Micro-Templating. -// For all details and documentation: -// http://documentcloud.github.com/underscore - -(function() { - - // Baseline setup - // -------------- - - // Establish the root object, `window` in the browser, or `global` on the server. - var root = this; - - // Save the previous value of the `_` variable. - var previousUnderscore = root._; - - // Establish the object that gets returned to break out of a loop iteration. - var breaker = {}; - - // Save bytes in the minified (but not gzipped) version: - var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; - - // Create quick reference variables for speed access to core prototypes. - var slice = ArrayProto.slice, - unshift = ArrayProto.unshift, - toString = ObjProto.toString, - hasOwnProperty = ObjProto.hasOwnProperty; - - // All **ECMAScript 5** native function implementations that we hope to use - // are declared here. - var - nativeForEach = ArrayProto.forEach, - nativeMap = ArrayProto.map, - nativeReduce = ArrayProto.reduce, - nativeReduceRight = ArrayProto.reduceRight, - nativeFilter = ArrayProto.filter, - nativeEvery = ArrayProto.every, - nativeSome = ArrayProto.some, - nativeIndexOf = ArrayProto.indexOf, - nativeLastIndexOf = ArrayProto.lastIndexOf, - nativeIsArray = Array.isArray, - nativeKeys = Object.keys, - nativeBind = FuncProto.bind; - - // Create a safe reference to the Underscore object for use below. - var _ = function(obj) { return new wrapper(obj); }; - - // Export the Underscore object for **Node.js**, with - // backwards-compatibility for the old `require()` API. If we're in - // the browser, add `_` as a global object via a string identifier, - // for Closure Compiler "advanced" mode. - if (typeof exports !== 'undefined') { - if (typeof module !== 'undefined' && module.exports) { - exports = module.exports = _; - } - exports._ = _; - } else { - root['_'] = _; - } - - // Current version. - _.VERSION = '1.3.3'; - - // Collection Functions - // -------------------- - - // The cornerstone, an `each` implementation, aka `forEach`. - // Handles objects with the built-in `forEach`, arrays, and raw objects. - // Delegates to **ECMAScript 5**'s native `forEach` if available. - var each = _.each = _.forEach = function(obj, iterator, context) { - if (obj == null) return; - if (nativeForEach && obj.forEach === nativeForEach) { - obj.forEach(iterator, context); - } else if (obj.length === +obj.length) { - for (var i = 0, l = obj.length; i < l; i++) { - if (i in obj && iterator.call(context, obj[i], i, obj) === breaker) return; - } - } else { - for (var key in obj) { - if (_.has(obj, key)) { - if (iterator.call(context, obj[key], key, obj) === breaker) return; - } - } - } - }; - - // Return the results of applying the iterator to each element. - // Delegates to **ECMAScript 5**'s native `map` if available. - _.map = _.collect = function(obj, iterator, context) { - var results = []; - if (obj == null) return results; - if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context); - each(obj, function(value, index, list) { - results[results.length] = iterator.call(context, value, index, list); - }); - if (obj.length === +obj.length) results.length = obj.length; - return results; - }; - - // **Reduce** builds up a single result from a list of values, aka `inject`, - // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available. - _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) { - var initial = arguments.length > 2; - if (obj == null) obj = []; - if (nativeReduce && obj.reduce === nativeReduce) { - if (context) iterator = _.bind(iterator, context); - return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator); - } - each(obj, function(value, index, list) { - if (!initial) { - memo = value; - initial = true; - } else { - memo = iterator.call(context, memo, value, index, list); - } - }); - if (!initial) throw new TypeError('Reduce of empty array with no initial value'); - return memo; - }; - - // The right-associative version of reduce, also known as `foldr`. - // Delegates to **ECMAScript 5**'s native `reduceRight` if available. - _.reduceRight = _.foldr = function(obj, iterator, memo, context) { - var initial = arguments.length > 2; - if (obj == null) obj = []; - if (nativeReduceRight && obj.reduceRight === nativeReduceRight) { - if (context) iterator = _.bind(iterator, context); - return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator); - } - var reversed = _.toArray(obj).reverse(); - if (context && !initial) iterator = _.bind(iterator, context); - return initial ? _.reduce(reversed, iterator, memo, context) : _.reduce(reversed, iterator); - }; - - // Return the first value which passes a truth test. Aliased as `detect`. - _.find = _.detect = function(obj, iterator, context) { - var result; - any(obj, function(value, index, list) { - if (iterator.call(context, value, index, list)) { - result = value; - return true; - } - }); - return result; - }; - - // Return all the elements that pass a truth test. - // Delegates to **ECMAScript 5**'s native `filter` if available. - // Aliased as `select`. - _.filter = _.select = function(obj, iterator, context) { - var results = []; - if (obj == null) return results; - if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context); - each(obj, function(value, index, list) { - if (iterator.call(context, value, index, list)) results[results.length] = value; - }); - return results; - }; - - // Return all the elements for which a truth test fails. - _.reject = function(obj, iterator, context) { - var results = []; - if (obj == null) return results; - each(obj, function(value, index, list) { - if (!iterator.call(context, value, index, list)) results[results.length] = value; - }); - return results; - }; - - // Determine whether all of the elements match a truth test. - // Delegates to **ECMAScript 5**'s native `every` if available. - // Aliased as `all`. - _.every = _.all = function(obj, iterator, context) { - var result = true; - if (obj == null) return result; - if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context); - each(obj, function(value, index, list) { - if (!(result = result && iterator.call(context, value, index, list))) return breaker; - }); - return !!result; - }; - - // Determine if at least one element in the object matches a truth test. - // Delegates to **ECMAScript 5**'s native `some` if available. - // Aliased as `any`. - var any = _.some = _.any = function(obj, iterator, context) { - iterator || (iterator = _.identity); - var result = false; - if (obj == null) return result; - if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context); - each(obj, function(value, index, list) { - if (result || (result = iterator.call(context, value, index, list))) return breaker; - }); - return !!result; - }; - - // Determine if a given value is included in the array or object using `===`. - // Aliased as `contains`. - _.include = _.contains = function(obj, target) { - var found = false; - if (obj == null) return found; - if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1; - found = any(obj, function(value) { - return value === target; - }); - return found; - }; - - // Invoke a method (with arguments) on every item in a collection. - _.invoke = function(obj, method) { - var args = slice.call(arguments, 2); - return _.map(obj, function(value) { - return (_.isFunction(method) ? method || value : value[method]).apply(value, args); - }); - }; - - // Convenience version of a common use case of `map`: fetching a property. - _.pluck = function(obj, key) { - return _.map(obj, function(value){ return value[key]; }); - }; - - // Return the maximum element or (element-based computation). - _.max = function(obj, iterator, context) { - if (!iterator && _.isArray(obj) && obj[0] === +obj[0]) return Math.max.apply(Math, obj); - if (!iterator && _.isEmpty(obj)) return -Infinity; - var result = {computed : -Infinity}; - each(obj, function(value, index, list) { - var computed = iterator ? iterator.call(context, value, index, list) : value; - computed >= result.computed && (result = {value : value, computed : computed}); - }); - return result.value; - }; - - // Return the minimum element (or element-based computation). - _.min = function(obj, iterator, context) { - if (!iterator && _.isArray(obj) && obj[0] === +obj[0]) return Math.min.apply(Math, obj); - if (!iterator && _.isEmpty(obj)) return Infinity; - var result = {computed : Infinity}; - each(obj, function(value, index, list) { - var computed = iterator ? iterator.call(context, value, index, list) : value; - computed < result.computed && (result = {value : value, computed : computed}); - }); - return result.value; - }; - - // Shuffle an array. - _.shuffle = function(obj) { - var shuffled = [], rand; - each(obj, function(value, index, list) { - rand = Math.floor(Math.random() * (index + 1)); - shuffled[index] = shuffled[rand]; - shuffled[rand] = value; - }); - return shuffled; - }; - - // Sort the object's values by a criterion produced by an iterator. - _.sortBy = function(obj, val, context) { - var iterator = _.isFunction(val) ? val : function(obj) { return obj[val]; }; - return _.pluck(_.map(obj, function(value, index, list) { - return { - value : value, - criteria : iterator.call(context, value, index, list) - }; - }).sort(function(left, right) { - var a = left.criteria, b = right.criteria; - if (a === void 0) return 1; - if (b === void 0) return -1; - return a < b ? -1 : a > b ? 1 : 0; - }), 'value'); - }; - - // Groups the object's values by a criterion. Pass either a string attribute - // to group by, or a function that returns the criterion. - _.groupBy = function(obj, val) { - var result = {}; - var iterator = _.isFunction(val) ? val : function(obj) { return obj[val]; }; - each(obj, function(value, index) { - var key = iterator(value, index); - (result[key] || (result[key] = [])).push(value); - }); - return result; - }; - - // Use a comparator function to figure out at what index an object should - // be inserted so as to maintain order. Uses binary search. - _.sortedIndex = function(array, obj, iterator) { - iterator || (iterator = _.identity); - var low = 0, high = array.length; - while (low < high) { - var mid = (low + high) >> 1; - iterator(array[mid]) < iterator(obj) ? low = mid + 1 : high = mid; - } - return low; - }; - - // Safely convert anything iterable into a real, live array. - _.toArray = function(obj) { - if (!obj) return []; - if (_.isArray(obj)) return slice.call(obj); - if (_.isArguments(obj)) return slice.call(obj); - if (obj.toArray && _.isFunction(obj.toArray)) return obj.toArray(); - return _.values(obj); - }; - - // Return the number of elements in an object. - _.size = function(obj) { - return _.isArray(obj) ? obj.length : _.keys(obj).length; - }; - - // Array Functions - // --------------- - - // Get the first element of an array. Passing **n** will return the first N - // values in the array. Aliased as `head` and `take`. The **guard** check - // allows it to work with `_.map`. - _.first = _.head = _.take = function(array, n, guard) { - return (n != null) && !guard ? slice.call(array, 0, n) : array[0]; - }; - - // Returns everything but the last entry of the array. Especcialy useful on - // the arguments object. Passing **n** will return all the values in - // the array, excluding the last N. The **guard** check allows it to work with - // `_.map`. - _.initial = function(array, n, guard) { - return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n)); - }; - - // Get the last element of an array. Passing **n** will return the last N - // values in the array. The **guard** check allows it to work with `_.map`. - _.last = function(array, n, guard) { - if ((n != null) && !guard) { - return slice.call(array, Math.max(array.length - n, 0)); - } else { - return array[array.length - 1]; - } - }; - - // Returns everything but the first entry of the array. Aliased as `tail`. - // Especially useful on the arguments object. Passing an **index** will return - // the rest of the values in the array from that index onward. The **guard** - // check allows it to work with `_.map`. - _.rest = _.tail = function(array, index, guard) { - return slice.call(array, (index == null) || guard ? 1 : index); - }; - - // Trim out all falsy values from an array. - _.compact = function(array) { - return _.filter(array, function(value){ return !!value; }); - }; - - // Return a completely flattened version of an array. - _.flatten = function(array, shallow) { - return _.reduce(array, function(memo, value) { - if (_.isArray(value)) return memo.concat(shallow ? value : _.flatten(value)); - memo[memo.length] = value; - return memo; - }, []); - }; - - // Return a version of the array that does not contain the specified value(s). - _.without = function(array) { - return _.difference(array, slice.call(arguments, 1)); - }; - - // Produce a duplicate-free version of the array. If the array has already - // been sorted, you have the option of using a faster algorithm. - // Aliased as `unique`. - _.uniq = _.unique = function(array, isSorted, iterator) { - var initial = iterator ? _.map(array, iterator) : array; - var results = []; - // The `isSorted` flag is irrelevant if the array only contains two elements. - if (array.length < 3) isSorted = true; - _.reduce(initial, function (memo, value, index) { - if (isSorted ? _.last(memo) !== value || !memo.length : !_.include(memo, value)) { - memo.push(value); - results.push(array[index]); - } - return memo; - }, []); - return results; - }; - - // Produce an array that contains the union: each distinct element from all of - // the passed-in arrays. - _.union = function() { - return _.uniq(_.flatten(arguments, true)); - }; - - // Produce an array that contains every item shared between all the - // passed-in arrays. (Aliased as "intersect" for back-compat.) - _.intersection = _.intersect = function(array) { - var rest = slice.call(arguments, 1); - return _.filter(_.uniq(array), function(item) { - return _.every(rest, function(other) { - return _.indexOf(other, item) >= 0; - }); - }); - }; - - // Take the difference between one array and a number of other arrays. - // Only the elements present in just the first array will remain. - _.difference = function(array) { - var rest = _.flatten(slice.call(arguments, 1), true); - return _.filter(array, function(value){ return !_.include(rest, value); }); - }; - - // Zip together multiple lists into a single array -- elements that share - // an index go together. - _.zip = function() { - var args = slice.call(arguments); - var length = _.max(_.pluck(args, 'length')); - var results = new Array(length); - for (var i = 0; i < length; i++) results[i] = _.pluck(args, "" + i); - return results; - }; - - // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**), - // we need this function. Return the position of the first occurrence of an - // item in an array, or -1 if the item is not included in the array. - // Delegates to **ECMAScript 5**'s native `indexOf` if available. - // If the array is large and already in sort order, pass `true` - // for **isSorted** to use binary search. - _.indexOf = function(array, item, isSorted) { - if (array == null) return -1; - var i, l; - if (isSorted) { - i = _.sortedIndex(array, item); - return array[i] === item ? i : -1; - } - if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item); - for (i = 0, l = array.length; i < l; i++) if (i in array && array[i] === item) return i; - return -1; - }; - - // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available. - _.lastIndexOf = function(array, item) { - if (array == null) return -1; - if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) return array.lastIndexOf(item); - var i = array.length; - while (i--) if (i in array && array[i] === item) return i; - return -1; - }; - - // Generate an integer Array containing an arithmetic progression. A port of - // the native Python `range()` function. See - // [the Python documentation](http://docs.python.org/library/functions.html#range). - _.range = function(start, stop, step) { - if (arguments.length <= 1) { - stop = start || 0; - start = 0; - } - step = arguments[2] || 1; - - var len = Math.max(Math.ceil((stop - start) / step), 0); - var idx = 0; - var range = new Array(len); - - while(idx < len) { - range[idx++] = start; - start += step; - } - - return range; - }; - - // Function (ahem) Functions - // ------------------ - - // Reusable constructor function for prototype setting. - var ctor = function(){}; - - // Create a function bound to a given object (assigning `this`, and arguments, - // optionally). Binding with arguments is also known as `curry`. - // Delegates to **ECMAScript 5**'s native `Function.bind` if available. - // We check for `func.bind` first, to fail fast when `func` is undefined. - _.bind = function bind(func, context) { - var bound, args; - if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); - if (!_.isFunction(func)) throw new TypeError; - args = slice.call(arguments, 2); - return bound = function() { - if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments))); - ctor.prototype = func.prototype; - var self = new ctor; - var result = func.apply(self, args.concat(slice.call(arguments))); - if (Object(result) === result) return result; - return self; - }; - }; - - // Bind all of an object's methods to that object. Useful for ensuring that - // all callbacks defined on an object belong to it. - _.bindAll = function(obj) { - var funcs = slice.call(arguments, 1); - if (funcs.length == 0) funcs = _.functions(obj); - each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); }); - return obj; - }; - - // Memoize an expensive function by storing its results. - _.memoize = function(func, hasher) { - var memo = {}; - hasher || (hasher = _.identity); - return function() { - var key = hasher.apply(this, arguments); - return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments)); - }; - }; - - // Delays a function for the given number of milliseconds, and then calls - // it with the arguments supplied. - _.delay = function(func, wait) { - var args = slice.call(arguments, 2); - return setTimeout(function(){ return func.apply(null, args); }, wait); - }; - - // Defers a function, scheduling it to run after the current call stack has - // cleared. - _.defer = function(func) { - return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1))); - }; - - // Returns a function, that, when invoked, will only be triggered at most once - // during a given window of time. - _.throttle = function(func, wait) { - var context, args, timeout, throttling, more, result; - var whenDone = _.debounce(function(){ more = throttling = false; }, wait); - return function() { - context = this; args = arguments; - var later = function() { - timeout = null; - if (more) func.apply(context, args); - whenDone(); - }; - if (!timeout) timeout = setTimeout(later, wait); - if (throttling) { - more = true; - } else { - result = func.apply(context, args); - } - whenDone(); - throttling = true; - return result; - }; - }; - - // Returns a function, that, as long as it continues to be invoked, will not - // be triggered. The function will be called after it stops being called for - // N milliseconds. If `immediate` is passed, trigger the function on the - // leading edge, instead of the trailing. - _.debounce = function(func, wait, immediate) { - var timeout; - return function() { - var context = this, args = arguments; - var later = function() { - timeout = null; - if (!immediate) func.apply(context, args); - }; - if (immediate && !timeout) func.apply(context, args); - clearTimeout(timeout); - timeout = setTimeout(later, wait); - }; - }; - - // Returns a function that will be executed at most one time, no matter how - // often you call it. Useful for lazy initialization. - _.once = function(func) { - var ran = false, memo; - return function() { - if (ran) return memo; - ran = true; - return memo = func.apply(this, arguments); - }; - }; - - // Returns the first function passed as an argument to the second, - // allowing you to adjust arguments, run code before and after, and - // conditionally execute the original function. - _.wrap = function(func, wrapper) { - return function() { - var args = [func].concat(slice.call(arguments, 0)); - return wrapper.apply(this, args); - }; - }; - - // Returns a function that is the composition of a list of functions, each - // consuming the return value of the function that follows. - _.compose = function() { - var funcs = arguments; - return function() { - var args = arguments; - for (var i = funcs.length - 1; i >= 0; i--) { - args = [funcs[i].apply(this, args)]; - } - return args[0]; - }; - }; - - // Returns a function that will only be executed after being called N times. - _.after = function(times, func) { - if (times <= 0) return func(); - return function() { - if (--times < 1) { return func.apply(this, arguments); } - }; - }; - - // Object Functions - // ---------------- - - // Retrieve the names of an object's properties. - // Delegates to **ECMAScript 5**'s native `Object.keys` - _.keys = nativeKeys || function(obj) { - if (obj !== Object(obj)) throw new TypeError('Invalid object'); - var keys = []; - for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key; - return keys; - }; - - // Retrieve the values of an object's properties. - _.values = function(obj) { - return _.map(obj, _.identity); - }; - - // Return a sorted list of the function names available on the object. - // Aliased as `methods` - _.functions = _.methods = function(obj) { - var names = []; - for (var key in obj) { - if (_.isFunction(obj[key])) names.push(key); - } - return names.sort(); - }; - - // Extend a given object with all the properties in passed-in object(s). - _.extend = function(obj) { - each(slice.call(arguments, 1), function(source) { - for (var prop in source) { - obj[prop] = source[prop]; - } - }); - return obj; - }; - - // Return a copy of the object only containing the whitelisted properties. - _.pick = function(obj) { - var result = {}; - each(_.flatten(slice.call(arguments, 1)), function(key) { - if (key in obj) result[key] = obj[key]; - }); - return result; - }; - - // Fill in a given object with default properties. - _.defaults = function(obj) { - each(slice.call(arguments, 1), function(source) { - for (var prop in source) { - if (obj[prop] == null) obj[prop] = source[prop]; - } - }); - return obj; - }; - - // Create a (shallow-cloned) duplicate of an object. - _.clone = function(obj) { - if (!_.isObject(obj)) return obj; - return _.isArray(obj) ? obj.slice() : _.extend({}, obj); - }; - - // Invokes interceptor with the obj, and then returns obj. - // The primary purpose of this method is to "tap into" a method chain, in - // order to perform operations on intermediate results within the chain. - _.tap = function(obj, interceptor) { - interceptor(obj); - return obj; - }; - - // Internal recursive comparison function. - function eq(a, b, stack) { - // Identical objects are equal. `0 === -0`, but they aren't identical. - // See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal. - if (a === b) return a !== 0 || 1 / a == 1 / b; - // A strict comparison is necessary because `null == undefined`. - if (a == null || b == null) return a === b; - // Unwrap any wrapped objects. - if (a._chain) a = a._wrapped; - if (b._chain) b = b._wrapped; - // Invoke a custom `isEqual` method if one is provided. - if (a.isEqual && _.isFunction(a.isEqual)) return a.isEqual(b); - if (b.isEqual && _.isFunction(b.isEqual)) return b.isEqual(a); - // Compare `[[Class]]` names. - var className = toString.call(a); - if (className != toString.call(b)) return false; - switch (className) { - // Strings, numbers, dates, and booleans are compared by value. - case '[object String]': - // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is - // equivalent to `new String("5")`. - return a == String(b); - case '[object Number]': - // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for - // other numeric values. - return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b); - case '[object Date]': - case '[object Boolean]': - // Coerce dates and booleans to numeric primitive values. Dates are compared by their - // millisecond representations. Note that invalid dates with millisecond representations - // of `NaN` are not equivalent. - return +a == +b; - // RegExps are compared by their source patterns and flags. - case '[object RegExp]': - return a.source == b.source && - a.global == b.global && - a.multiline == b.multiline && - a.ignoreCase == b.ignoreCase; - } - if (typeof a != 'object' || typeof b != 'object') return false; - // Assume equality for cyclic structures. The algorithm for detecting cyclic - // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. - var length = stack.length; - while (length--) { - // Linear search. Performance is inversely proportional to the number of - // unique nested structures. - if (stack[length] == a) return true; - } - // Add the first object to the stack of traversed objects. - stack.push(a); - var size = 0, result = true; - // Recursively compare objects and arrays. - if (className == '[object Array]') { - // Compare array lengths to determine if a deep comparison is necessary. - size = a.length; - result = size == b.length; - if (result) { - // Deep compare the contents, ignoring non-numeric properties. - while (size--) { - // Ensure commutative equality for sparse arrays. - if (!(result = size in a == size in b && eq(a[size], b[size], stack))) break; - } - } - } else { - // Objects with different constructors are not equivalent. - if ('constructor' in a != 'constructor' in b || a.constructor != b.constructor) return false; - // Deep compare objects. - for (var key in a) { - if (_.has(a, key)) { - // Count the expected number of properties. - size++; - // Deep compare each member. - if (!(result = _.has(b, key) && eq(a[key], b[key], stack))) break; - } - } - // Ensure that both objects contain the same number of properties. - if (result) { - for (key in b) { - if (_.has(b, key) && !(size--)) break; - } - result = !size; - } - } - // Remove the first object from the stack of traversed objects. - stack.pop(); - return result; - } - - // Perform a deep comparison to check if two objects are equal. - _.isEqual = function(a, b) { - return eq(a, b, []); - }; - - // Is a given array, string, or object empty? - // An "empty" object has no enumerable own-properties. - _.isEmpty = function(obj) { - if (obj == null) return true; - if (_.isArray(obj) || _.isString(obj)) return obj.length === 0; - for (var key in obj) if (_.has(obj, key)) return false; - return true; - }; - - // Is a given value a DOM element? - _.isElement = function(obj) { - return !!(obj && obj.nodeType == 1); - }; - - // Is a given value an array? - // Delegates to ECMA5's native Array.isArray - _.isArray = nativeIsArray || function(obj) { - return toString.call(obj) == '[object Array]'; - }; - - // Is a given variable an object? - _.isObject = function(obj) { - return obj === Object(obj); - }; - - // Is a given variable an arguments object? - _.isArguments = function(obj) { - return toString.call(obj) == '[object Arguments]'; - }; - if (!_.isArguments(arguments)) { - _.isArguments = function(obj) { - return !!(obj && _.has(obj, 'callee')); - }; - } - - // Is a given value a function? - _.isFunction = function(obj) { - return toString.call(obj) == '[object Function]'; - }; - - // Is a given value a string? - _.isString = function(obj) { - return toString.call(obj) == '[object String]'; - }; - - // Is a given value a number? - _.isNumber = function(obj) { - return toString.call(obj) == '[object Number]'; - }; - - // Is a given object a finite number? - _.isFinite = function(obj) { - return _.isNumber(obj) && isFinite(obj); - }; - - // Is the given value `NaN`? - _.isNaN = function(obj) { - // `NaN` is the only value for which `===` is not reflexive. - return obj !== obj; - }; - - // Is a given value a boolean? - _.isBoolean = function(obj) { - return obj === true || obj === false || toString.call(obj) == '[object Boolean]'; - }; - - // Is a given value a date? - _.isDate = function(obj) { - return toString.call(obj) == '[object Date]'; - }; - - // Is the given value a regular expression? - _.isRegExp = function(obj) { - return toString.call(obj) == '[object RegExp]'; - }; - - // Is a given value equal to null? - _.isNull = function(obj) { - return obj === null; - }; - - // Is a given variable undefined? - _.isUndefined = function(obj) { - return obj === void 0; - }; - - // Has own property? - _.has = function(obj, key) { - return hasOwnProperty.call(obj, key); - }; - - // Utility Functions - // ----------------- - - // Run Underscore.js in *noConflict* mode, returning the `_` variable to its - // previous owner. Returns a reference to the Underscore object. - _.noConflict = function() { - root._ = previousUnderscore; - return this; - }; - - // Keep the identity function around for default iterators. - _.identity = function(value) { - return value; - }; - - // Run a function **n** times. - _.times = function (n, iterator, context) { - for (var i = 0; i < n; i++) iterator.call(context, i); - }; - - // Escape a string for HTML interpolation. - _.escape = function(string) { - return (''+string).replace(/&/g, '&').replace(//g, '>').replace(/"/g, '"').replace(/'/g, ''').replace(/\//g,'/'); - }; - - // If the value of the named property is a function then invoke it; - // otherwise, return it. - _.result = function(object, property) { - if (object == null) return null; - var value = object[property]; - return _.isFunction(value) ? value.call(object) : value; - }; - - // Add your own custom functions to the Underscore object, ensuring that - // they're correctly added to the OOP wrapper as well. - _.mixin = function(obj) { - each(_.functions(obj), function(name){ - addToWrapper(name, _[name] = obj[name]); - }); - }; - - // Generate a unique integer id (unique within the entire client session). - // Useful for temporary DOM ids. - var idCounter = 0; - _.uniqueId = function(prefix) { - var id = idCounter++; - return prefix ? prefix + id : id; - }; - - // By default, Underscore uses ERB-style template delimiters, change the - // following template settings to use alternative delimiters. - _.templateSettings = { - evaluate : /<%([\s\S]+?)%>/g, - interpolate : /<%=([\s\S]+?)%>/g, - escape : /<%-([\s\S]+?)%>/g - }; - - // When customizing `templateSettings`, if you don't want to define an - // interpolation, evaluation or escaping regex, we need one that is - // guaranteed not to match. - var noMatch = /.^/; - - // Certain characters need to be escaped so that they can be put into a - // string literal. - var escapes = { - '\\': '\\', - "'": "'", - 'r': '\r', - 'n': '\n', - 't': '\t', - 'u2028': '\u2028', - 'u2029': '\u2029' - }; - - for (var p in escapes) escapes[escapes[p]] = p; - var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g; - var unescaper = /\\(\\|'|r|n|t|u2028|u2029)/g; - - // Within an interpolation, evaluation, or escaping, remove HTML escaping - // that had been previously added. - var unescape = function(code) { - return code.replace(unescaper, function(match, escape) { - return escapes[escape]; - }); - }; - - // JavaScript micro-templating, similar to John Resig's implementation. - // Underscore templating handles arbitrary delimiters, preserves whitespace, - // and correctly escapes quotes within interpolated code. - _.template = function(text, data, settings) { - settings = _.defaults(settings || {}, _.templateSettings); - - // Compile the template source, taking care to escape characters that - // cannot be included in a string literal and then unescape them in code - // blocks. - var source = "__p+='" + text - .replace(escaper, function(match) { - return '\\' + escapes[match]; - }) - .replace(settings.escape || noMatch, function(match, code) { - return "'+\n_.escape(" + unescape(code) + ")+\n'"; - }) - .replace(settings.interpolate || noMatch, function(match, code) { - return "'+\n(" + unescape(code) + ")+\n'"; - }) - .replace(settings.evaluate || noMatch, function(match, code) { - return "';\n" + unescape(code) + "\n;__p+='"; - }) + "';\n"; - - // If a variable is not specified, place data values in local scope. - if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; - - source = "var __p='';" + - "var print=function(){__p+=Array.prototype.join.call(arguments, '')};\n" + - source + "return __p;\n"; - - var render = new Function(settings.variable || 'obj', '_', source); - if (data) return render(data, _); - var template = function(data) { - return render.call(this, data, _); - }; - - // Provide the compiled function source as a convenience for build time - // precompilation. - template.source = 'function(' + (settings.variable || 'obj') + '){\n' + - source + '}'; - - return template; - }; - - // Add a "chain" function, which will delegate to the wrapper. - _.chain = function(obj) { - return _(obj).chain(); - }; - - // The OOP Wrapper - // --------------- - - // If Underscore is called as a function, it returns a wrapped object that - // can be used OO-style. This wrapper holds altered versions of all the - // underscore functions. Wrapped objects may be chained. - var wrapper = function(obj) { this._wrapped = obj; }; - - // Expose `wrapper.prototype` as `_.prototype` - _.prototype = wrapper.prototype; - - // Helper function to continue chaining intermediate results. - var result = function(obj, chain) { - return chain ? _(obj).chain() : obj; - }; - - // A method to easily add functions to the OOP wrapper. - var addToWrapper = function(name, func) { - wrapper.prototype[name] = function() { - var args = slice.call(arguments); - unshift.call(args, this._wrapped); - return result(func.apply(_, args), this._chain); - }; - }; - - // Add all of the Underscore functions to the wrapper object. - _.mixin(_); - - // Add all mutator Array functions to the wrapper. - each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { - var method = ArrayProto[name]; - wrapper.prototype[name] = function() { - var wrapped = this._wrapped; - method.apply(wrapped, arguments); - var length = wrapped.length; - if ((name == 'shift' || name == 'splice') && length === 0) delete wrapped[0]; - return result(wrapped, this._chain); - }; - }); - - // Add all accessor Array functions to the wrapper. - each(['concat', 'join', 'slice'], function(name) { - var method = ArrayProto[name]; - wrapper.prototype[name] = function() { - return result(method.apply(this._wrapped, arguments), this._chain); - }; - }); - - // Start chaining a wrapped Underscore object. - wrapper.prototype.chain = function() { - this._chain = true; - return this; - }; - - // Extracts the result from a wrapped and chained object. - wrapper.prototype.value = function() { - return this._wrapped; - }; - -}).call(this); diff --git a/tests/qunit/node_modules/qunit/package.json b/tests/qunit/node_modules/qunit/package.json deleted file mode 100644 index 179aee8..0000000 --- a/tests/qunit/node_modules/qunit/package.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "name": "qunit", - "description": "QUnit testing framework for nodejs", - "version": "0.5.16", - "author": { - "name": "Oleg Slobodskoi", - "email": "oleg008@gmail.com" - }, - "contributors": [ - { - "name": "Jonathan Buchanan" - }, - { - "name": "Ashar Voultoiz" - } - ], - "repository": { - "type": "git", - "url": "http: //github.com/kof/node-qunit.git" - }, - "keywords": [ - "TDD", - "QUnit", - "unit", - "testing", - "tests", - "async" - ], - "bin": { - "qunit": "./bin/cli.js" - }, - "engines": { - "node": ">=0.6.0 < 0.11.0" - }, - "scripts": { - "test": "make test" - }, - "dependencies": { - "underscore": "1.3.3", - "argsparser": "0.0.6", - "cli-table": "0.0.2", - "tracejs": "0.1.4", - "bunker": "0.1.2" - }, - "devDependencies": { - "chainer": "0.0.5", - "timekeeper": "0.0.2" - }, - "optionalDependencies": { - "bunker": "0.1.2" - }, - "licenses": [ - { - "type": "MIT", - "url": "http: //www.opensource.org/licenses/mit-license.php" - } - ], - "readme": "## QUnit testing framework for nodejs.\n\nhttp://qunitjs.com\n\nhttp://github.com/jquery/qunit\n\n### Features\n\n- cli\n- testrunner api\n- test coverage via jscoverage is removed, node-bunker have to be implemented #26\n- tests inside of one testfile run synchronous, but every testfile runs parallel\n- tests from each file run in its own spawned node process\n- same API for client and server side code (original QUnit is used)\n- the simplest API of the world, especially for asynchronous testing\n- you can write tests in TDD or BDD style depending on your task and test type\n- you can run the same tests in browser if there is no dependencies to node\n\n### Installation\n\n npm i qunit\n\n### API\n\n http://api.qunitjs.com\n\n#### The only exception\n\n // Separate tests into modules.\n // Use `QUnit` namespace, because `module` is reserved\n QUnit.module(name, lifecycle)\n\n### Usage\n\n#### Command line\n\nRead full cli api doc using \"--help\" or \"-h\":\n\n $ qunit -h\n\n $ qunit -c ./code.js -t ./tests.js\n\nBy default, code and dependencies are added to the global scope. To specify\nrequiring them into a namespace object, prefix the path or module name with the\nvariable name to be used for the namespace object, followed by a colon:\n\n $ qunit -c code:./code.js -d utils:utilmodule -t ./time.js\n\n#### via api\n\n var testrunner = require(\"qunit\");\n\n Defaults:\n\n {\n // logging options\n log: {\n\n // log assertions overview\n assertions: true,\n\n // log expected and actual values for failed tests\n errors: true,\n\n // log tests overview\n tests: true,\n\n // log summary\n summary: true,\n\n // log global summary (all files)\n globalSummary: true,\n\n // log currently testing code file\n testing: true\n },\n\n // run test coverage tool\n coverage: false,\n\n // define dependencies, which are required then before code\n deps: null,\n\n // define namespace your code will be attached to on global['your namespace']\n namespace: null\n }\n\n\n // change any option for all tests globally\n testrunner.options.optionName = value;\n\n // or use setup function\n testrunner.setup({\n log: {\n summary: true\n }\n });\n\n\n // one code and tests file\n testrunner.run({\n code: \"/path/to/your/code.js\",\n tests: \"/path/to/your/tests.js\"\n }, callback);\n\n // require code into a namespace object, rather than globally\n testrunner.run({\n code: {path: \"/path/to/your/code.js\", namespace: \"code\"},\n tests: \"/path/to/your/tests.js\"\n }, callback);\n\n // one code and multiple tests file\n testrunner.run({\n code: \"/path/to/your/code.js\",\n tests: [\"/path/to/your/tests.js\", \"/path/to/your/tests1.js\"]\n }, callback);\n\n // array of code and test files\n testrunner.run([\n {\n code: \"/path/to/your/code.js\",\n tests: \"/path/to/your/tests.js\"\n },\n {\n code: \"/path/to/your/code.js\",\n tests: \"/path/to/your/tests.js\"\n }\n ], callback);\n\n // using testrunner callback\n testrunner.run({\n code: \"/path/to/your/code.js\",\n tests: \"/path/to/your/tests.js\"\n }, function(err, report) {\n console.dir(report);\n });\n\n // specify dependency\n testrunner.run({\n deps: \"/path/to/your/dependency.js\",\n code: \"/path/to/your/code.js\",\n tests: \"/path/to/your/tests.js\"\n }, callback);\n\n // dependencies can be modules or files\n testrunner.run({\n deps: \"modulename\",\n code: \"/path/to/your/code.js\",\n tests: \"/path/to/your/tests.js\"\n }, callback);\n\n // dependencies can required into a namespace object\n testrunner.run({\n deps: {path: \"utilmodule\", namespace: \"utils\"},\n code: \"/path/to/your/code.js\",\n tests: \"/path/to/your/tests.js\"\n }, callback);\n\n // specify multiple dependencies\n testrunner.run({\n deps: [\"/path/to/your/dependency1.js\", \"/path/to/your/dependency2.js\"],\n code: \"/path/to/your/code.js\",\n tests: \"/path/to/your/tests.js\"\n }, callback);\n\n### Writing tests\n\nQUnit API and code which have to be tested are already loaded and attached to the global context.\n\nSome tests examples\n\n\n test(\"a basic test example\", function (assert) {\n ok(true, \"this test is fine\");\n var value = \"hello\";\n equal(\"hello\", value, \"We expect value to be hello\");\n });\n\n QUnit.module(\"Module A\");\n\n test(\"first test within module\", 1, function (assert) {\n ok(true, \"a dummy\");\n });\n\n test(\"second test within module\", 2, function (assert) {\n ok(true, \"dummy 1 of 2\");\n ok(true, \"dummy 2 of 2\");\n });\n\n QUnit.module(\"Module B\", {\n setup: function () {\n // do some initial stuff before every test for this module\n },\n teardown: function () {\n // do some stuff after every test for this module\n }\n });\n\n test(\"some other test\", function (assert) {\n expect(2);\n equal(true, false, \"failing test\");\n equal(true, true, \"passing test\");\n });\n\n QUnit.module(\"Module C\", {\n setup: function() {\n // setup a shared environment for each test\n this.options = { test: 123 };\n }\n });\n\n test(\"this test is using shared environment\", 1, function (assert) {\n deepEqual({ test: 123 }, this.options, \"passing test\");\n });\n\n test(\"this is an async test example\", function (assert) {\n expect(2);\n stop();\n setTimeout(function () {\n ok(true, \"finished async test\");\n strictEqual(true, true, \"Strict equal assertion uses ===\");\n start();\n }, 100);\n });\n\n\n### Run tests\n\n git submodule init\n git submodule update\n npm i\n make test\n\n### Coverage\n\nJscoverage is removed due to a lot of installation problems and bad api,\nnode-bunker is planned to use but not implemented yet.\n", - "readmeFilename": "readme.md", - "_id": "qunit@0.5.16", - "_from": "qunit@" -} diff --git a/tests/qunit/node_modules/qunit/readme.md b/tests/qunit/node_modules/qunit/readme.md deleted file mode 100644 index 793ef98..0000000 --- a/tests/qunit/node_modules/qunit/readme.md +++ /dev/null @@ -1,237 +0,0 @@ -## QUnit testing framework for nodejs. - -http://qunitjs.com - -http://github.com/jquery/qunit - -### Features - -- cli -- testrunner api -- test coverage via jscoverage is removed, node-bunker have to be implemented #26 -- tests inside of one testfile run synchronous, but every testfile runs parallel -- tests from each file run in its own spawned node process -- same API for client and server side code (original QUnit is used) -- the simplest API of the world, especially for asynchronous testing -- you can write tests in TDD or BDD style depending on your task and test type -- you can run the same tests in browser if there is no dependencies to node - -### Installation - - npm i qunit - -### API - - http://api.qunitjs.com - -#### The only exception - - // Separate tests into modules. - // Use `QUnit` namespace, because `module` is reserved - QUnit.module(name, lifecycle) - -### Usage - -#### Command line - -Read full cli api doc using "--help" or "-h": - - $ qunit -h - - $ qunit -c ./code.js -t ./tests.js - -By default, code and dependencies are added to the global scope. To specify -requiring them into a namespace object, prefix the path or module name with the -variable name to be used for the namespace object, followed by a colon: - - $ qunit -c code:./code.js -d utils:utilmodule -t ./time.js - -#### via api - - var testrunner = require("qunit"); - - Defaults: - - { - // logging options - log: { - - // log assertions overview - assertions: true, - - // log expected and actual values for failed tests - errors: true, - - // log tests overview - tests: true, - - // log summary - summary: true, - - // log global summary (all files) - globalSummary: true, - - // log currently testing code file - testing: true - }, - - // run test coverage tool - coverage: false, - - // define dependencies, which are required then before code - deps: null, - - // define namespace your code will be attached to on global['your namespace'] - namespace: null - } - - - // change any option for all tests globally - testrunner.options.optionName = value; - - // or use setup function - testrunner.setup({ - log: { - summary: true - } - }); - - - // one code and tests file - testrunner.run({ - code: "/path/to/your/code.js", - tests: "/path/to/your/tests.js" - }, callback); - - // require code into a namespace object, rather than globally - testrunner.run({ - code: {path: "/path/to/your/code.js", namespace: "code"}, - tests: "/path/to/your/tests.js" - }, callback); - - // one code and multiple tests file - testrunner.run({ - code: "/path/to/your/code.js", - tests: ["/path/to/your/tests.js", "/path/to/your/tests1.js"] - }, callback); - - // array of code and test files - testrunner.run([ - { - code: "/path/to/your/code.js", - tests: "/path/to/your/tests.js" - }, - { - code: "/path/to/your/code.js", - tests: "/path/to/your/tests.js" - } - ], callback); - - // using testrunner callback - testrunner.run({ - code: "/path/to/your/code.js", - tests: "/path/to/your/tests.js" - }, function(err, report) { - console.dir(report); - }); - - // specify dependency - testrunner.run({ - deps: "/path/to/your/dependency.js", - code: "/path/to/your/code.js", - tests: "/path/to/your/tests.js" - }, callback); - - // dependencies can be modules or files - testrunner.run({ - deps: "modulename", - code: "/path/to/your/code.js", - tests: "/path/to/your/tests.js" - }, callback); - - // dependencies can required into a namespace object - testrunner.run({ - deps: {path: "utilmodule", namespace: "utils"}, - code: "/path/to/your/code.js", - tests: "/path/to/your/tests.js" - }, callback); - - // specify multiple dependencies - testrunner.run({ - deps: ["/path/to/your/dependency1.js", "/path/to/your/dependency2.js"], - code: "/path/to/your/code.js", - tests: "/path/to/your/tests.js" - }, callback); - -### Writing tests - -QUnit API and code which have to be tested are already loaded and attached to the global context. - -Some tests examples - - - test("a basic test example", function (assert) { - ok(true, "this test is fine"); - var value = "hello"; - equal("hello", value, "We expect value to be hello"); - }); - - QUnit.module("Module A"); - - test("first test within module", 1, function (assert) { - ok(true, "a dummy"); - }); - - test("second test within module", 2, function (assert) { - ok(true, "dummy 1 of 2"); - ok(true, "dummy 2 of 2"); - }); - - QUnit.module("Module B", { - setup: function () { - // do some initial stuff before every test for this module - }, - teardown: function () { - // do some stuff after every test for this module - } - }); - - test("some other test", function (assert) { - expect(2); - equal(true, false, "failing test"); - equal(true, true, "passing test"); - }); - - QUnit.module("Module C", { - setup: function() { - // setup a shared environment for each test - this.options = { test: 123 }; - } - }); - - test("this test is using shared environment", 1, function (assert) { - deepEqual({ test: 123 }, this.options, "passing test"); - }); - - test("this is an async test example", function (assert) { - expect(2); - stop(); - setTimeout(function () { - ok(true, "finished async test"); - strictEqual(true, true, "Strict equal assertion uses ==="); - start(); - }, 100); - }); - - -### Run tests - - git submodule init - git submodule update - npm i - make test - -### Coverage - -Jscoverage is removed due to a lot of installation problems and bad api, -node-bunker is planned to use but not implemented yet. diff --git a/tests/qunit/node_modules/qunit/support/json/cycle.js b/tests/qunit/node_modules/qunit/support/json/cycle.js deleted file mode 100644 index e142d15..0000000 --- a/tests/qunit/node_modules/qunit/support/json/cycle.js +++ /dev/null @@ -1,162 +0,0 @@ -// cycle.js -// 2011-08-24 - -/*jslint evil: true, regexp: true */ - -/*members $ref, apply, call, decycle, hasOwnProperty, length, prototype, push, - retrocycle, stringify, test, toString -*/ - -if (typeof JSON.decycle !== 'function') { - JSON.decycle = function decycle(object) { - 'use strict'; - -// Make a deep copy of an object or array, assuring that there is at most -// one instance of each object or array in the resulting structure. The -// duplicate references (which might be forming cycles) are replaced with -// an object of the form -// {$ref: PATH} -// where the PATH is a JSONPath string that locates the first occurance. -// So, -// var a = []; -// a[0] = a; -// return JSON.stringify(JSON.decycle(a)); -// produces the string '[{"$ref":"$"}]'. - -// JSONPath is used to locate the unique object. $ indicates the top level of -// the object or array. [NUMBER] or [STRING] indicates a child member or -// property. - - var objects = [], // Keep a reference to each unique object or array - paths = []; // Keep the path to each unique object or array - - return (function derez(value, path) { - -// The derez recurses through the object, producing the deep copy. - - var i, // The loop counter - name, // Property name - nu; // The new object or array - - switch (typeof value) { - case 'object': - -// typeof null === 'object', so get out if this value is not really an object. - - if (!value) { - return null; - } - -// If the value is an object or array, look to see if we have already -// encountered it. If so, return a $ref/path object. This is a hard way, -// linear search that will get slower as the number of unique objects grows. - - for (i = 0; i < objects.length; i += 1) { - if (objects[i] === value) { - return {$ref: paths[i]}; - } - } - -// Otherwise, accumulate the unique value and its path. - - objects.push(value); - paths.push(path); - -// If it is an array, replicate the array. - - if (Object.prototype.toString.apply(value) === '[object Array]') { - nu = []; - for (i = 0; i < value.length; i += 1) { - nu[i] = derez(value[i], path + '[' + i + ']'); - } - } else { - -// If it is an object, replicate the object. - - nu = {}; - for (name in value) { - if (Object.prototype.hasOwnProperty.call(value, name)) { - nu[name] = derez(value[name], - path + '[' + JSON.stringify(name) + ']'); - } - } - } - return nu; - case 'number': - case 'string': - case 'boolean': - return value; - } - }(object, '$')); - }; -} - - -if (typeof JSON.retrocycle !== 'function') { - JSON.retrocycle = function retrocycle($) { - 'use strict'; - -// Restore an object that was reduced by decycle. Members whose values are -// objects of the form -// {$ref: PATH} -// are replaced with references to the value found by the PATH. This will -// restore cycles. The object will be mutated. - -// The eval function is used to locate the values described by a PATH. The -// root object is kept in a $ variable. A regular expression is used to -// assure that the PATH is extremely well formed. The regexp contains nested -// * quantifiers. That has been known to have extremely bad performance -// problems on some browsers for very long strings. A PATH is expected to be -// reasonably short. A PATH is allowed to belong to a very restricted subset of -// Goessner's JSONPath. - -// So, -// var s = '[{"$ref":"$"}]'; -// return JSON.retrocycle(JSON.parse(s)); -// produces an array containing a single element which is the array itself. - - var px = - /^\$(?:\[(?:\d+|\"(?:[^\\\"\u0000-\u001f]|\\([\\\"\/bfnrt]|u[0-9a-zA-Z]{4}))*\")\])*$/; - - (function rez(value) { - -// The rez function walks recursively through the object looking for $ref -// properties. When it finds one that has a value that is a path, then it -// replaces the $ref object with a reference to the value that is found by -// the path. - - var i, item, name, path; - - if (value && typeof value === 'object') { - if (Object.prototype.toString.apply(value) === '[object Array]') { - for (i = 0; i < value.length; i += 1) { - item = value[i]; - if (item && typeof item === 'object') { - path = item.$ref; - if (typeof path === 'string' && px.test(path)) { - value[i] = eval(path); - } else { - rez(item); - } - } - } - } else { - for (name in value) { - if (typeof value[name] === 'object') { - item = value[name]; - if (item) { - path = item.$ref; - if (typeof path === 'string' && px.test(path)) { - value[name] = eval(path); - } else { - rez(item); - } - } - } - } - } - } - }($)); - return $; - }; -} \ No newline at end of file diff --git a/tests/qunit/node_modules/qunit/support/qunit/.npmignore b/tests/qunit/node_modules/qunit/support/qunit/.npmignore deleted file mode 100644 index 7e11d0b..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/.npmignore +++ /dev/null @@ -1,7 +0,0 @@ -.project -*~ -*.diff -*.patch -.DS_Store -.settings -node_modules diff --git a/tests/qunit/node_modules/qunit/support/qunit/AUTHORS.txt b/tests/qunit/node_modules/qunit/support/qunit/AUTHORS.txt deleted file mode 100644 index 2b56dec..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/AUTHORS.txt +++ /dev/null @@ -1,55 +0,0 @@ -Jörn Zaefferer -Ariel Flesler -Scott González -Richard Worth -Philippe Rathé -John Resig -Will Moffat -Jan Kassens -Ziling Zhao -Ryan Szulczewski -Chris Lloyd -Louis-Rémi Babé -Jake Archibald -Frances Berriman -Rune Halvorsen -Chris Thatcher -Fábio Rehm -Leon Sorokin -Douglas Neiner -Paul Elliott -Nikita Vasilyev -Benjamin Lee -Paul Irish -Oleg Slobodskoi -Anton Matzneller -Aurélien Bombo -Mathias Bynens -Erik Vold -Wesley Walser -Rob Kinninmont -Marc Portier -Michael Righi -Timo Tijhof -Jan Alonzo -Daniel Trebbien -Bob Fanger -Markus Messner-Chaney -Trevor Parscal -Ashar Voultoiz -Jimmy Mabey -Domenic Denicola -Mike Sherov -Seong-A Kong -Graham Conzett -Niall Smart -Johan Sörlin -Gijs Kruitbosch -Erkan Yilmaz -Jonathan Sanchez -Keith Cirkel -Rick Waldron -Herbert Vojčík -Richard Gibson -Alex J Burke -Sergii Kliuchnyk diff --git a/tests/qunit/node_modules/qunit/support/qunit/History.md b/tests/qunit/node_modules/qunit/support/qunit/History.md deleted file mode 100644 index 8a15934..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/History.md +++ /dev/null @@ -1,448 +0,0 @@ - -1.9.0 / 2012-07-11 -================== - * added jsdoc for QUnit.assert functions - * Styling: radius to 5px and small pass/error border, remove inner shadow - * Move checkboxes into toolbar and give them labels and descriptions (as tooltip). Fixes #274 - Improve urlFilter API and UI - * Where we recieve no exception in throws() use a relevant message. - * Also make module filter case-insensitive. Follow-up to #252 - * Banner: Link should ignore "testNumber" and "module". Fixes #270 - * Rename assert.raises to assert.throws. Fixes #267 - * Change package.json name property to 'qunitjs' to avoid conflicht with node-qunit; will publish next release to npm - -1.8.0 / 2012-06-14 -================== - * Improve window.onerror handling - * (issue #260) config.current should be reset at the right time. - * Filter: Implement 'module' url parameter. Fixes #252 - * raises: ignore global exceptions stemming from test. Fixes #257 - Globally-executed errors sneak past raises in IE - -1.7.0 / 2012-06-07 -================== - - * Add config.requireExpects. Fixes #207 - Add option to require all tests to call expect(). - * Improve extractStacktrace() implementation. Fixes #254 - Include all relevant stack lines - * Make filters case-insensitive. Partial fix for #252 - * is() expects lowercase types. Fixes #250 - Expected Date value is not displayed properly - * Fix phantomjs addon header and add readme. Fixes #239 - * Add some hints to composite addon readme. Fixes #251 - * Track tests by the order in which they were run and create rerun links based on that number. Fixes #241 - Make Rerun link run only a single test. - * Use QUnit.push for raises implementation. Fixes #243 - * CLI runner for phantomjs - * Fix jshint validation until they deal with /** */ comments properly - * Update validTest() : Simplify logic, clarify vars and add comments - * Refactor assertion helpers into QUnit.assert (backwards compatible) - * Add Rerun link to placeholders. Fixes #240 - -1.6.0 / 2012-05-04 -================== - - * Save stack for each test, use that for failed expect() results, points at the line where test() was called. Fixes #209 - * Prefix test-output id and ignore that in noglobals check. Fixes #212 - * Only check for an exports object to detect a CommonJS enviroment. Fixes #237 - Incompatibility with require.js - * Add testswarm integration as grunt task - * Added padding on URL config checkboxes. - * Cleanup composite addon: Use callback registration instead of overwriting them. Set the correct src on rerun link (and dblclick). Remove the composite test itself, as that was a crazy hack not worth maintaining - * Cleanup reset() test and usage - run testDone callback first, to allow listeneres ignoring reset assertions - * Double clicking on composite test rows opens individual test page - * test-message for all message-bearing API reporting details - -1.5.0 / 2012-04-04 -================== - - * Modify "Running..." to display test name. Fixes #220 - * Fixed clearing of sessionStorage in Firefox 3.6. - * Fixes #217 by calling "block" with config.current.testEnvironment - * Add stats results to data. QUnit.jUnitReport function take one argument { xml:' QUnit.start() - * Remove the 'let teardown clean up globals test' - IE<9 doesn't support (==buggy) deleting window properties, and that's not worth the trouble, as everything else passes just fine. Fixes #155 - * Fix globals in test.js, part 2 - * Fix globals in test.js. ?tell wwalser to use ?noglobals everyonce in a while - * Extend readme regarding release process - -1.1.0 / 2011-10-11 -================== - - * Fixes #134 - Add a window.onerror handler. Makes uncaught errors actually fail the testsuite, instead of going by unnoticed. - * Whitespace cleanup - * Merge remote branch 'trevorparscal/master' - * Fixed IE compatibility issues with using toString on NodeList objects, which in some browsers results in [object Object] rather than [object NodeList]. Now using duck typing for NodeList objects based on the presence of length, length being a number, presence of item method (which will be typeof string in IE and function in others, so we just check that it's not undefined) and that item(0) returns the same value as [0], unless it's empty, in which case item(0) will return 0, while [0] would return undefined. Tested in IE6, IE8, Firefox 6, Safari 5 and Chrome 16. - * Update readme with basic notes on releases - * More whitespace/parens cleanup - * Check if setTimeout is available before trying to delay running the next task. Fixes #160 - * Whitespace/formatting fix, remove unnecessary parens - * Use alias for Object.prototype.toString - * Merge remote branch 'trevorparscal/master' - * Merge remote branch 'wwalser/recursionBug' - * Default 'expected' to null in asyncTest(), same as in test() itself. - * Whitespace cleanup - * Merge remote branch 'mmchaney/master' - * Merge remote branch 'Krinkle/master' - * Using === instead of == - * Added more strict array type detection for dump output, and allowed NodeList objects to be output as arrays - * Fixes a bug where after an async test, assertions could move between test cases because of internal state (config.current) being incorrectly set - * Simplified check for assertion count and adjusted whitespace - * Redo of fixing issue #156 (Support Object.prototype extending environment). * QUnit.diff: Throws exception without this if Object.prototype is set (Property 'length' of undefined. Since Object.prototype.foo doesn't have a property 'rows') * QUnit.url: Without this fix, if Object.prototype.foo is set, the url will be set to ?foo=...&the=rest. * saveGlobals: Without this fix, whenever a member is added to Object.prototype, saveGlobals will think it was a global variable in this loop. --- This time using the call method instead of obj.hasOwnProperty(key), which may fail if the object has that as it's own property (touché!). - * Handle expect(0) as expected, i.e. expect(0); ok(true, foo); will cause a test to fail - -1.0.0 / 2011-10-06 -================== - - * Make QUnit work with TestSwarm - * Run other addons tests as composite addon demo. Need to move that to /test folder once this setup actually works - * Add-on: New assertion-type: step() - * added parameter to start and stop allowing a user to increment/decrement the semaphore more than once per call - * Update readmes with .md extension for GitHub to render them as markdown - * Update close-enough addon to include readme and match (new) naming convetions - * Merge remote branch 'righi/close-enough-addon' - * Canvas addon: Update file referneces - * Update canvas addon: Rename files and add README - * Merge remote branch 'wwalser/composite' - * Fix #142 - Backslash characters in messages should not be escaped - * Add module name to testStart and testDone callbacks - * Removed extra columns in object literals. Closes #153 - * Remove dead links in comments. - * Merge remote branch 'wwalser/multipleCallbacks' - * Fixed syntax error and CommonJS incompatibilities in package.json - * Allow multiple callbacks to be registered. - * Add placeholder for when Safari may end up providing useful error handling - * changed file names to match addon naming convention - * Whitespace - * Created the composite addon. - * Using array and object literals. - * Issue #140: Make toggle system configurable. - * Merge remote branch 'tweetdeck/master' - * Adds the 'close enough' addon to determine if numbers are acceptably close enough in value. - * Fix recursion support in jsDump, along with tests. Fixes #63 and #100 - * Adding a QUnit.config.altertitle flag which will allow users to opt-out of the functionality introduced in 60147ca0164e3d810b8a9bf46981c3d9cc569efc - * Refactor window.load handler into QUnit.load, makes it possible to call it manually. - * More whitespace cleanup - * Merge remote branch 'erikvold/one-chk-in-title' - * Whitespace - * Merge remote branch 'wwalser/syncStopCalls' - * Introducing the first QUnit addon, based on https://github.com/jquery/qunit/pull/84 - adds QUnit.pixelEqual assertion method, along with example tests. - * Remove config.hidepassed setting in test.js, wasn't intended to land in master. - * Expose QUnit.config.hidepassed setting. Overrides sessionStorage and enables enabling the feature programmatically. Fixes #133 - * Fix formatting (css whitespace) for tracebacks. - * Expose extend, id, and addEvent methods. - * minor comment typo correction - * Ignore Eclipse WTP .settings - * Set 'The jQuery Project' as author in package.json - * Fixes a bug where synchronous calls to stop would cause tests to end before start was called again - * Point to planning testing wiki in readme - * only add one checkmark to the document.title - * Escape the stacktrace output before setting it as innerHTML, since it tends to contain `<` and `>` characters. - * Cleanup whitespace - * Run module.teardown before checking for pollution. Fixes #109 - noglobals should run after module teardown - * Fix accidental global variable "not" - * Update document.title status to use more robust unicode escape sequences, works even when served with non-utf-8-charset. - * Modify document.title when suite is done to show success/failure in tab, allows you to see the overall result without seeing the tab content. - * Merge pull request #107 from sexyprout/master - * Set a generic font - * Add/update headers - * Drop support for deprecated #main in favor of #qunit-fixture. If this breaks your testsuite, replace id="main" with id="qunit-fixture". Fixes #103 - * Remove the same key as the one being set. Partial fix for #101 - * Don't modify expected-count when checking pollution. The failing assertion isn't expected, so shouldn't be counted. And if expect wasn't used, the count is misleading. - * Fix order of noglobals check to produce correct introduced/delete error messages - * Prepend module name to sessionStorage keys to avoid conflicts - * Store filter-tests only when checked - * Write to sessionStorage only bad tests - * Moved QUnit.url() defintion after QUnit properties are merged into the global scope. Fixes #93 - QUnit url/extend function breaking urls in jQuery ajax test component - * Add a "Rerun" link to each test to replce the dblclick (still supported, for now). - * Fixed the regex for parsing the name of a test when double clicking to filter. - * Merge remote branch 'scottgonzalez/url' - * Added checkboxes to show which flags are currently on and allow toggling them. - * Retain all querystring parameters when filtering a test via double click. - * Added better querystring parsing. Now storing all querystring params in QUnit.urlParams so that we can carry the params forward when filtering to a specific test. This removes the ability to specify multiple filters. - * Make reordering optional (QUnit.config.reorder = false) and optimize "Hide passed tests" mode by also hiding "Running [testname]" entries. - * Added missing semicolons and wrapped undefined key in quotes. - * Optimize test hiding, add class on page load if stored in sessionStorage - * Optimize the hiding of passed tests. - * Position test results above test list, making it visible without ever having to scroll. Create a placeholder to avoid pushing down results later. - * Don't check for existing qunit-testresult element, it gets killed on init anyway. - * Added URL flag ?notrycatch (ala ?noglobals) for debugging exceptions. Won't try/catch test code, giving better debugging changes on the original exceptions. Fixes #72 - * Always show quni-toolbar (if at all specified), persist checkbox via sessionStorage. Fixes #47 - * Use non-html testname for calls to fail(). Fixes #77 - * Overhaul of QUnit.callbacks. Consistent single argument with related properties, with additonal runtime property for QUnit.done - * Extended test/logs.html to capture more of the callbacks. - * Fixed moduleStart/Done callbacks. Added test/logs.html to test these callbacks. To be extended. - * Update copyright and license header. Fixes #61 - * Formatting fix. - * Use a semaphore to synchronize stop() and start() calls. Fixes #76 - * Merge branch 'master' of https://github.com/paulirish/qunit into paulirish-master - * Added two tests for previous QUnit.raises behaviour. For #69 - * add optional 2. arg to QUnit.raises #69. - * fix references inside Complex Instances Nesting to what was originally intended. - * Qualify calls to ok() in raises() for compability with CLI enviroments. - * Fix done() handling, check for blocking, not block property - * Fix moduleStart/Done and done callbacks. - * Replacing sessionStorage test with the one from Modernizr/master (instead of current release). Here's hoping it'll work for some time. - * Updated test for availibility of sessionStorage, based on test from Modernizr. Fixes #64 - * Defer test execution when previous run passed, persisted via sessionStorage. Fixes #49 - * Refactored module handling and queuing to enable selective defer of test runs. - * Move assertions property from config to Test - * Move expected-tests property from config to Test - * Refactored test() method to delegate to a Test object to encapsulate all properties and methods of a single test, allowing further modifications. - * Adding output of sourcefile and linenumber of failed assertions (except ok()). Only limited cross-browser support for now. Fixes #60 - * Drop 'hide missing tests' feature. Fixes #48 - * Adding readme. Fixes #58 - * Merge branch 'prettydiff' - * Improve jsDump output with formatted diffs. - * Cleanup whitespace - * Cleanup whitespace - * Added additional guards around browser specific code and cleaned up jsDump code - * Added guards around tests which are only for browsers - * cleaned up setTimeout undefined checking and double done on test finish - * fixing .gitignore - * making window setTimeout query more consistent - * Moved expect-code back to beginning of function, where it belongs. Fixes #52 - * Bread crumb in header: Link to suite without filters, add link to current page based on the filter, if present. Fixes #50 - * Make the toolbar element optional when checking for show/hide of test results. Fixes #46 - * Adding headless.html to manually test logging and verify that QUnit works without output elements. Keeping #qunit-fixture as a few tests actually use that. - * Fix for QUnit.moduleDone, get rid of initial bogus log. Fixes #33 - * Pass raw data (result, message, actual, expected) as third argument to QUnit.log. Fixes #32 - * Dump full exception. Not pretty, but functional (see issue Pretty diff for pretty output). Fixes #31 - * Don't let QUnit.reset() cause assertions to run. Manually applied from Scott Gonzalez branch. Fixes #34 - * Added missing semicolons. Fixes #37 - * Show okay/failed instead of undefined. Fixes #38 - * Expose push as QUnit.push to build custom assertions. Fixes #39 - * Respect filter pass selection when writing new results. Fixes #43 - * Cleanup tests, removing asyncTest-undefined check and formatting - * Reset: Fall back to innerHTML when jQuery isn't available. Fixes #44 - * Merge branch 'master' of github.com:jquery/qunit - * reset doesn't exist here - fixes #28. - * - less css cruft, better readability - replaced inline style for test counts with "counts" class - test counts now use a "failed"/"passed" vs "pass"/"fail", shorter/more distinct selectors - pulled all test counts styling together and up (they're always the same regardless of section pass/fail state) - * Adding .gitignore file - * Removing diff test - diffing works fine, as the browser collapses whitespace in its output, but the test can't do that and isn't worth fixing. - * Always synchronize the done-step (it'll set the timeout when necessary), fixes timing race conditions. - * Insert location.href as an anchor around the header. Fixes issue #29 - * - kill double ;; in escapeHtml. oops - * Removed html escaping from QUnit.diff, as input is already escaped, only leads to double escaping. Replaced newlines with single whitespace. - * Optimized and cleaned up CSS file - * Making the reset-method non-global (only module, test and assertions should be global), and fixing the fixture reset by using jQuery's html() method again, doesn't work with innerHTML, yet - * Introducing #qunit-fixture element, deprecating the (never documented) #main element. Doesn't require inline styles and is now independent of jQuery. - * Ammending previous commit: Remove jQuery-core specific resets (will be replaced within jQuery testsuite). Fixes issue #19 - QUnit.reset() removes global jQuery ajax event handlers - * Remove jQuery-core specific resets (will be replaced within jQuery testsuite). Fixes issue #19 - QUnit.reset() removes global jQuery ajax event handlers - * Cleaning up rubble from the previous commit. - * Added raises assertion, reusing some of kennsnyder's code. - * Merged kensnyder's object detection code. Original message: Streamlined object detection and exposed QUnit.objectType as a function. - * Fixed some bad formatting. - * Move various QUnit properties below the globals-export to avoid init becoming a global method. Fixes issue #11 - Remove 'init' function from a global namespace - * Improved output when expected != actual: Output both only then, and add a diff. Fixes issue #10 - Show diff if equal() or deepEqual() failed - * Expand failed tests on load. Fixes issue #8 - Failed tests expanded on load - * Set location.search for url-filtering instead of location.href. Fixes issue #7 - Modify location.search instead of location.href on test double-click - * Add QUnit.begin() callback. Fixes issue #6 - Add 'start' callback. - * add css style for result (".test-actual") in passed tests - * Fixed output escaping by using leeoniya's custom escaping along with innerHTML. Also paves the way for outputting diffs. - * Cleanup - * Revert "Revert part of bad merge, back to using createTextNode" - * Revert part of bad merge, back to using createTextNode - * Fixed doubleclick-handler and filtering to rerun only a single test. - * Add ability to css style a test's messages, expected and actual results. Merged from Leon Sorokin (leeoniya). - * Remove space between module name and colon - * - removed "module" wording from reports (unneeded and cluttery) - added and modified css to make module & test names styleable - * Logging support for Each test can extend the module testEnvironment - * Fixing whitespace - * Update tests to use equal() and deepEqual() rather than the deprecated equals() and same() - * Consistent argument names for deepEqual - * Skip DOM part of jsDump test if using a SSJS environment without a DOM - * Improve async testing by creating the result element before running the test, updating it later. If the test fails, its clear which test is the culprit. - * Add autostart option to config. Set via QUnit.config.autostart = false; start later via QUnit.start() - * Expose QUnit.config, but don't make config a global - * Expose QUnit.config as global to make external workarounds easier - * Merge branch 'asyncsetup' - * Allowing async setup and teardown. Fixes http://github.com/jquery/qunit/issues#issue/20 - * Always output expected and actual result (no reason not to). Fixes http://github.com/jquery/qunit/issues#issue/21 - * More changes to the detection of types in jsDump's typeOf. - * Change the typeOf checks in QUnit to be more accurate. - * Added test for jsDump and modified its options to properly output results when document.createTextNode is used; currently tests for DOM elements cause a stackoverflow error in IEs, works fine, with the correct output, elsewhere - * Always use jsDump to output result objects into messages, making the output for passing assertions more useful - * Make it so that the display is updated, at least, once a second - also prevents scripts from executing for too long and causing problems. - * added tests and patch for qunit.equiv to avoid circular references in objects and arrays - * No reason to continue looping, we can stop at this point. Thanks to Chris Thatcher for the suggestion. - * Use createTextNode instead of innerHTML for showing test result since expected and actual might be something that looks like a tag. - * 'Test card' design added - * switched green to blue for top-level pass + reduced padding - * Bringing the QUnit API in line with the CommonJS API. - * Explicitly set list-style-position: inside on result LIs. - * Madness with border-radius. - * Corrected banner styles for new class names - * Added rounded corners and removed body rules for embedded tests - * Resolving merge conflicts. - * added colouring for value summary - * adding some extra text colours - * added styles for toolbar - * added new styles - * IE 6 and 7 weren't respecting the CSS rules for the banner, used a different technique instead. - * Went a bit further and made extra-sure that the target was specified correctly. - * Fixed problem where double-clicking an entry in IE caused an error to occur. - * Path for http://dev.jquery.com/ticket/5426 - fix the microformat test result - * Fixed test() to use 'expected' 2nd param - * Remove the named function expressions, to stop Safari 2 from freaking out. Fixes #5. - * Each test can extend the module testEnvironment - * Extra test for current test environment - * Make the current testEnvironment available to utility functions - * typeOf in QUnit.jsDump now uses QUnit.is - * hoozit in QUnit.equiv now uses QUnit.is - * Properly set label attributes. - * Some minor tweaks to RyanS' GETParams change. - * left a console.log in :( - * Took into account a fringe case when using qunit with testswarm. Trying to run all the tests with the extra url params from testswarm would make qunit look for a testsuite that did not exist - * need to set config.currentModule to have correct names and working filters - * Support logging of testEnvironment - * async tests aren't possible on rhino - * Fixed a missing QUnit.reset(). - * The QUnit. prefix was missing from the uses of the start() method. - * Merged lifecycle object into testEnvironment - * "replacing totally wrong diff algorithm with a working one" Patch from kassens (manually applied). - * fixing jslint errors in test.js - * Fixed: testDone() was always called with 0 failures in CommonJS mode - * Fixed: moduleDone() was invoked on first call to module() - * Added a new asyncTest method - removes the need for having to call start() at the beginning of an asynchronous test. - * Added support for expected numbers in the test method. - * Fixed broken dynamic loading of tests (can now dynamically load tests and done still works properly). - * Simplified the logic for calling 'done' and pushing off new tests - was causing too many inconsistencies otherwise. - * Simplified the markup for the QUnit test test suite. - * Realized that it's really easy to handle the case where stop() has been called and then an exception is thrown. - * Added in better logging support. Now handle moduleStart/moduleDone and testStart/testDone. Also make sure that done only fires once at the end. - * Made it so that you can reset the suite to an initial state (at which point tests can be dynamically loaded and run, for example). - * Re-worked QUnit to handle dynamic loading of additional code (the 'done' code will be re-run after additional code is loaded). - * Removed the old SVN version stuff. - * Moved the QUnit source into a separate directory and updated the test suite/packages files. - * Added in CommonJS support for exporting the QUnit functionality. - * Missing quote from package.json. - * Fixed trailing comma in package.json. - * Added a CommonJS/Narwhal package.json file. - * Accidentally reverted the jsDump/equiv changes that had been made. - * Hide the filter toolbar if it's not needed. Also exposed the jsDump and equiv objects on QUnit. - * Retooled the QUnit CSS to be more generic. - * Renamed the QUnit files from testrunner/testsuite to QUnit. - * Expose QUnit.equiv and QUnit.jsDump in QUnit. - * Moved the QUnit test directory into the QUnit directory. - * Reworked the QUnit CSS (moved jQuery-specific stuff out, made all the other selectors more specific). - * Removed the #main reset for non-jQuery code (QUnit.reset can be overwritten with your own reset code). - * Moved the QUnit toolbar inline. - * Switched to using a qunit- prefix for special elements (banner, userAgent, and tests). - * Missed a case in QUnit where an element was assumed to exist. - * QUnit's isSet and isObj are no longer needed - you should use same instead. - * Make sure that QUnit's equiv entity escaping is enabled by default (otherwise the output gets kind of crazy). - * Refactored QUnit, completely reorganized the structure of the file. Additionally made it so that QUnit can run outside of a browser (inside Rhino, for example). - * Removed some legacy and jQuery-specific test methods. - * Added callbacks for tests and modules. It's now possible to reproduce the full display of the testrunner without using the regular rendering. - * QUnit no longer depends upon rendering the results (it can work simply by using the logging callbacks). - * Made QUnit no longer require jQuery (it is now a standalone, framework independent, test runner). - * Reverted the noglobals changed from QUnit - causing chaos in the jQuery test suite. - * qunit: removed noglobals flag, instead always check for globals after teardown; if a test has to introduce a global "myVar", use delete window.myVar in teardown or at the end of a test - * qunit: don't child selectors when IE should behave nicely, too - * qunit: improvment for the test-scope: create a new object and call setup, the test, and teardown in the scope of that object - allows you to provide test fixtures to each test without messing with global data; kudos to Martin Häcker for the contribution - * qunit: added missing semicolons - * qunit: fixed a semicolon, that should have been a comma - * QUnit: implemented error handling for Opera as proposed by #3628 - * qunit: fix for http://dev.jquery.com/ticket/3215 changing wording of testresults, to something more positive (x of y passed, z failed) - * QUnit: testrunner.js: Ensures equality of types (String, Boolean, Number) declared with the 'new' prefix. See comments #3, #4 and #5 on http://philrathe.com/articles/equiv - * qunit: wrap name of test in span when a module is used for better styling - * qunit: auto-prepend default mark (#header, #banner, #userAgent, #tests) when not present - * Landing some changes to add logging to QUnit (so that it's easier to hook in to when a test finishes). - * Added checkbox for hiding missing tests (tests that fail with the text 'missing test - untested code is broken code') - * qunit: eol-style:native and mime-type - * HTML being injected for the test result wasn't valid HTML. - * qunit: setting mimetype for testsuite.css - * qunit: update to Ariel's noglobals patch to support async tests as well - * Landing Ariel's change - checks for global variable leakage. - * qunit: run module-teardown in its own synchronize block to synchronize with async tests (ugh) - * qunit: same: equiv - completely refactored in the testrunner. - * testrunner.js: - Update equiv to support Date and RegExp. - Change behavior when comparing function: - abort when in an instance of Object (when references comparison failed) - skip otherwise (like before) - * qunit: code refactoring and cleanup - * QUnit: update equiv to latest version, handling multiple arguments and NaN, see http://philrathe.com/articles/equiv - * QUnit: cleanup, deprecating compare, compare2 and serialArray: usage now throws an error with a helpful message - * QUnit: optional timeout argument for stop, while making tests undetermined, useful for debugging - * QUnit: added toolbar with "hide passed tests" checkbox to help focus on failed tests - * QUnit: minor output formatting - * QUnit: adding same-assertion for a recursive comparsion of primite values, arrays and objects, thanks to Philippe Rathé for the contribution, including tests - * QUnit: adding same-assertion for a recursive comparsion of primite values, arrays and objects, thanks to Philippe Rathé for the contribution, including tests - * QUnit: adding same-assertion for a recursive comparsion of primite values, arrays and objects, thanks to Philippe Rathé for the contribution, including tests - * qunit: use window.load to initialize tests, allowing other code to run on document-ready before starting to run tests - * qunit: allow either setup or teardown, instead of both or nothing - * qunit: make everything private by default, expose only public API; removed old timeout-option (non-deterministic, disabled for a long time anyway); use local $ reference instead of global jQuery reference; minor code cleanup (var config instead of _config; queue.shift instead of slice) - * qunit: added support for module level setup/teardown callbacks - * qunit: modified example for equals to avoid confusion with parameter ordering - * qunit: added id/classes to result element to enable integration with browser automation tools, see http://docs.jquery.com/QUnit#Integration_into_Browser_Automation_Tools - * qunit: replaced $ alias with jQuery (merged from jquery/test/data/testrunner.js) - * qunit: fixed inline documentation for equals - * qunit testrunner - catch and log possible error during reset() - * QUnit: Switched out Date and Rev for Id. - * qunit: when errors are thrown in a test, the message is successfully show on all browsers. - * qunit: added license header - * qunit: moved jquery testrunner to top-level project, see http://docs.jquery.com/QUnit - * Share project 'qunit' into 'https://jqueryjs.googlecode.com/svn' diff --git a/tests/qunit/node_modules/qunit/support/qunit/README.md b/tests/qunit/node_modules/qunit/support/qunit/README.md deleted file mode 100644 index 1c6545f..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/README.md +++ /dev/null @@ -1,58 +0,0 @@ -[QUnit](http://docs.jquery.com/QUnit) - A JavaScript Unit Testing framework. -================================ - -QUnit is a powerful, easy-to-use, JavaScript test suite. It's used by the jQuery -project to test its code and plugins but is capable of testing any generic -JavaScript code (and even capable of testing JavaScript code on the server-side). - -QUnit is especially useful for regression testing: Whenever a bug is reported, -write a test that asserts the existence of that particular bug. Then fix it and -commit both. Every time you work on the code again, run the tests. If the bug -comes up again - a regression - you'll spot it immediately and know how to fix -it, because you know what code you just changed. - -Having good unit test coverage makes safe refactoring easy and cheap. You can -run the tests after each small refactoring step and always know what change -broke something. - -QUnit is similar to other unit testing frameworks like JUnit, but makes use of -the features JavaScript provides and helps with testing code in the browser, e.g. -with its stop/start facilities for testing asynchronous code. - -If you are interested in helping developing QUnit, you are in the right place. -For related discussions, visit the -[QUnit and Testing forum](http://forum.jquery.com/qunit-and-testing). - -Planning for a qunitjs.com site and other testing tools related work now happens -on the [jQuery Testing Team planning wiki](http://jquerytesting.pbworks.com/w/page/41556026/FrontPage). - -Development ------------ - -To submit patches, fork the repository, create a branch for the change. Then implement -the change, run `grunt` to lint and test it, then commit, push and create a pull request. - -Include some background for the change in the commit message and `Fixes #nnn`, referring -to the issue number you're addressing. - -To run `grunt`, you need `node` and `npm`, then `npm install grunt -g`. - -Releases --------- - -Install git-extras and run `git changelog` to update History.md. -Update qunit/qunit.js|css and package.json to the release version, commit and -tag, update them again to the next version, commit and push commits and tags -(`git push --tags origin master`). - -Put the 'v' in front of the tag, e.g. `v1.8.0`. Clean up the changelog, removing merge commits -or whitespace cleanups. - -To upload to code.jquery.com (replace $version accordingly): - - scp -q qunit/qunit.js jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/qunit/qunit-$version.js - scp -q qunit/qunit.css jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/qunit/qunit-$version.css - -Then update /var/www/html/code.jquery.com/index.html and purge it with: - - curl -s http://code.origin.jquery.com/?reload \ No newline at end of file diff --git a/tests/qunit/node_modules/qunit/support/qunit/addons/canvas/README.md b/tests/qunit/node_modules/qunit/support/qunit/addons/canvas/README.md deleted file mode 100644 index 7c0f366..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/addons/canvas/README.md +++ /dev/null @@ -1,16 +0,0 @@ -Canvas - A QUnit Addon For Testing Canvas Rendering -================================ - -This addon for QUnit adds a pixelEqual method that allows you to assert -individual pixel values in a given canvas. - -Usage: - - pixelEqual(canvas, x, y, r, g, b, a, message) - -Where: - - * canvas: Reference to a canvas element - * x, y: Coordinates of the pixel to test - * r, g, b, a: The color and opacity value of the pixel that you except - * message: Optional message, same as for other assertions diff --git a/tests/qunit/node_modules/qunit/support/qunit/addons/canvas/canvas-test.js b/tests/qunit/node_modules/qunit/support/qunit/addons/canvas/canvas-test.js deleted file mode 100644 index 72ad66f..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/addons/canvas/canvas-test.js +++ /dev/null @@ -1,76 +0,0 @@ -test("Canvas pixels", function () { - var canvas = document.getElementById('qunit-canvas'), context; - try { - context = canvas.getContext('2d'); - } catch(e) { - // propably no canvas support, just exit - return; - } - context.fillStyle = 'rgba(0, 0, 0, 0)'; - context.fillRect(0, 0, 5, 5); - QUnit.pixelEqual(canvas, 0, 0, 0, 0, 0, 0); - context.clearRect(0,0,5,5); - context.fillStyle = 'rgba(255, 0, 0, 0)'; - context.fillRect(0, 0, 5, 5); - QUnit.pixelEqual(canvas, 0, 0, 0, 0, 0, 0); - context.clearRect(0,0,5,5); - context.fillStyle = 'rgba(0, 255, 0, 0)'; - context.fillRect(0, 0, 5, 5); - QUnit.pixelEqual(canvas, 0, 0, 0, 0, 0, 0); - context.clearRect(0,0,5,5); - context.fillStyle = 'rgba(0, 0, 255, 0)'; - context.fillRect(0, 0, 5, 5); - QUnit.pixelEqual(canvas, 0, 0, 0, 0, 0, 0); - context.clearRect(0,0,5,5); - - context.fillStyle = 'rgba(0, 0, 0, 0.5)'; - context.fillRect(0, 0, 5, 5); - QUnit.pixelEqual(canvas, 0, 0, 0, 0, 0, 127); - context.clearRect(0,0,5,5); - context.fillStyle = 'rgba(255, 0, 0, 0.5)'; - context.fillRect(0, 0, 5, 5); - QUnit.pixelEqual(canvas, 0, 0, 255, 0, 0, 127); - context.clearRect(0,0,5,5); - context.fillStyle = 'rgba(0, 255, 0, 0.5)'; - context.fillRect(0, 0, 5, 5); - QUnit.pixelEqual(canvas, 0, 0, 0, 255, 0, 127); - context.clearRect(0,0,5,5); - context.fillStyle = 'rgba(0, 0, 255, 0.5)'; - context.fillRect(0, 0, 5, 5); - QUnit.pixelEqual(canvas, 0, 0, 0, 0, 255, 127); - context.clearRect(0,0,5,5); - - context.fillStyle = 'rgba(0, 0, 0, 0.5)'; - context.fillRect(0, 0, 5, 5); - QUnit.pixelEqual(canvas, 2, 2, 0, 0, 0, 127); - context.clearRect(0,0,5,5); - context.fillStyle = 'rgba(255, 0, 0, 0.5)'; - context.fillRect(0, 0, 5, 5); - QUnit.pixelEqual(canvas, 2, 2, 255, 0, 0, 127); - context.clearRect(0,0,5,5); - context.fillStyle = 'rgba(0, 255, 0, 0.5)'; - context.fillRect(0, 0, 5, 5); - QUnit.pixelEqual(canvas, 2, 2, 0, 255, 0, 127); - context.clearRect(0,0,5,5); - context.fillStyle = 'rgba(0, 0, 255, 0.5)'; - context.fillRect(0, 0, 5, 5); - QUnit.pixelEqual(canvas, 2, 2, 0, 0, 255, 127); - context.clearRect(0,0,5,5); - - context.fillStyle = 'rgba(0, 0, 0, 1)'; - context.fillRect(0, 0, 5, 5); - QUnit.pixelEqual(canvas, 4, 4, 0, 0, 0, 255); - context.clearRect(0,0,5,5); - context.fillStyle = 'rgba(255, 0, 0, 1)'; - context.fillRect(0, 0, 5, 5); - QUnit.pixelEqual(canvas, 4, 4, 255, 0, 0, 255); - context.clearRect(0,0,5,5); - context.fillStyle = 'rgba(0, 255, 0, 1)'; - context.fillRect(0, 0, 5, 5); - QUnit.pixelEqual(canvas, 4, 4, 0, 255, 0, 255); - context.clearRect(0,0,5,5); - context.fillStyle = 'rgba(0, 0, 255, 1)'; - context.fillRect(0, 0, 5, 5); - QUnit.pixelEqual(canvas, 4, 4, 0, 0, 255, 255); - context.clearRect(0,0,5,5); -}); diff --git a/tests/qunit/node_modules/qunit/support/qunit/addons/canvas/canvas.html b/tests/qunit/node_modules/qunit/support/qunit/addons/canvas/canvas.html deleted file mode 100644 index 5d253b8..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/addons/canvas/canvas.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - QUnit Test Suite - Canvas Addon - - - - - - -
- - - diff --git a/tests/qunit/node_modules/qunit/support/qunit/addons/canvas/qunit-canvas.js b/tests/qunit/node_modules/qunit/support/qunit/addons/canvas/qunit-canvas.js deleted file mode 100644 index bc26c4c..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/addons/canvas/qunit-canvas.js +++ /dev/null @@ -1,6 +0,0 @@ -QUnit.extend( QUnit, { - pixelEqual: function(canvas, x, y, r, g, b, a, message) { - var actual = Array.prototype.slice.apply(canvas.getContext('2d').getImageData(x, y, 1, 1).data), expected = [r, g, b, a]; - QUnit.push(QUnit.equiv(actual, expected), actual, expected, message); - } -}); diff --git a/tests/qunit/node_modules/qunit/support/qunit/addons/close-enough/README.md b/tests/qunit/node_modules/qunit/support/qunit/addons/close-enough/README.md deleted file mode 100644 index d490b25..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/addons/close-enough/README.md +++ /dev/null @@ -1,17 +0,0 @@ -Close-Enough - A QUnit Addon For Number Approximations -================================ - -This addon for QUnit adds close and notClose assertion methods, to test that -numbers are close enough (or different enough) from an expected number, with -a specified accuracy. - -Usage: - - close(actual, expected, maxDifference, message) - notClose(actual, expected, minDifference, message) - -Where: - - * maxDifference: the maximum inclusive difference allowed between the actual and expected numbers - * minDifference: the minimum exclusive difference allowed between the actual and expected numbers - * actual, expected, message: The usual diff --git a/tests/qunit/node_modules/qunit/support/qunit/addons/close-enough/close-enough-test.js b/tests/qunit/node_modules/qunit/support/qunit/addons/close-enough/close-enough-test.js deleted file mode 100644 index fc6a9a8..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/addons/close-enough/close-enough-test.js +++ /dev/null @@ -1,35 +0,0 @@ -test("Close Numbers", function () { - var halfPi = Math.PI / 2, - sqrt2 = Math.sqrt(2); - - QUnit.close(7, 7, 0); - QUnit.close(7, 7.1, 0.1); - QUnit.close(7, 7.1, 0.2); - - QUnit.close(3.141, Math.PI, 0.001); - QUnit.close(3.1, Math.PI, 0.1); - - QUnit.close(halfPi, 1.57, 0.001); - - QUnit.close(sqrt2, 1.4142, 0.0001); - - QUnit.close(Infinity, Infinity, 1); -}); - -test("Distant Numbers", function () { - var halfPi = Math.PI / 2, - sqrt2 = Math.sqrt(2); - - QUnit.notClose(6, 7, 0); - QUnit.notClose(7, 7.2, 0.1); - QUnit.notClose(7, 7.2, 0.19999999999); - - QUnit.notClose(3.141, Math.PI, 0.0001); - QUnit.notClose(3.1, Math.PI, 0.001); - - QUnit.notClose(halfPi, 1.57, 0.0001); - - QUnit.notClose(sqrt2, 1.4142, 0.00001); - - QUnit.notClose(Infinity, -Infinity, 5); -}); \ No newline at end of file diff --git a/tests/qunit/node_modules/qunit/support/qunit/addons/close-enough/close-enough.html b/tests/qunit/node_modules/qunit/support/qunit/addons/close-enough/close-enough.html deleted file mode 100644 index f568320..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/addons/close-enough/close-enough.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - QUnit Test Suite - Close Enough Addon - - - - - - -
- - diff --git a/tests/qunit/node_modules/qunit/support/qunit/addons/close-enough/qunit-close-enough.js b/tests/qunit/node_modules/qunit/support/qunit/addons/close-enough/qunit-close-enough.js deleted file mode 100644 index ddb5a58..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/addons/close-enough/qunit-close-enough.js +++ /dev/null @@ -1,32 +0,0 @@ -QUnit.extend( QUnit, { - /** - * Checks that the first two arguments are equal, or are numbers close enough to be considered equal - * based on a specified maximum allowable difference. - * - * @example close(3.141, Math.PI, 0.001); - * - * @param Number actual - * @param Number expected - * @param Number maxDifference (the maximum inclusive difference allowed between the actual and expected numbers) - * @param String message (optional) - */ - close: function(actual, expected, maxDifference, message) { - var passes = (actual === expected) || Math.abs(actual - expected) <= maxDifference; - QUnit.push(passes, actual, expected, message); - }, - - /** - * Checks that the first two arguments are numbers with differences greater than the specified - * minimum difference. - * - * @example notClose(3.1, Math.PI, 0.001); - * - * @param Number actual - * @param Number expected - * @param Number minDifference (the minimum exclusive difference allowed between the actual and expected numbers) - * @param String message (optional) - */ - notClose: function(actual, expected, minDifference, message) { - QUnit.push(Math.abs(actual - expected) > minDifference, actual, expected, message); - } -}); \ No newline at end of file diff --git a/tests/qunit/node_modules/qunit/support/qunit/addons/composite/README.md b/tests/qunit/node_modules/qunit/support/qunit/addons/composite/README.md deleted file mode 100644 index 2e2d2fd..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/addons/composite/README.md +++ /dev/null @@ -1,12 +0,0 @@ -Composite - A QUnit Addon For Running Multiple Test Files -================================ - -Composite is a QUnit addon that, when handed an array of files, will -open each of those files inside of an iframe, run the tests and -display the results as a single suite of QUnit tests. - -The Rerun link next to each suite allows you to quickly rerun that suite, -outside the composite runner. - -If you want to see what assertion failed in a long list of assertions, -just use the regular "Hide passed tests" checkbox. \ No newline at end of file diff --git a/tests/qunit/node_modules/qunit/support/qunit/addons/composite/composite-demo-test.html b/tests/qunit/node_modules/qunit/support/qunit/addons/composite/composite-demo-test.html deleted file mode 100644 index ad964c9..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/addons/composite/composite-demo-test.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - QUnit SubsuiteRunner Test Suite - - - - - - - - - -
-
-
- - diff --git a/tests/qunit/node_modules/qunit/support/qunit/addons/composite/index.html b/tests/qunit/node_modules/qunit/support/qunit/addons/composite/index.html deleted file mode 100644 index b08f5e9..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/addons/composite/index.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - Composite - - -

Composite

-

A QUnit Addon For Running Multiple Test Files

-

Composite is a QUnit addon that, when handed an array of - files, will open each of those files inside of an iframe, run - the tests and display the results as a single suite of QUnit - tests.

-

Using Composite

-

To use Composite, setup a standard QUnit html page as you - would with other QUnit tests. Remember to include composite.js - and composite.css. Then, inside of either an external js file, - or a script block call the only new method that Composite - exposes, QUnit.testSuites().

QUnit.testSuites() is - passed an array of test files to run as follows:

-
-QUnit.testSuites([
-    "test-file-1.html",
-    "test-file-2.html",
-    "test-file-3.html"
-]);
-		
-

Tests

-

- Composite Demo: A suite which demoes how Composite is bootstrapped and run. -

- - diff --git a/tests/qunit/node_modules/qunit/support/qunit/addons/composite/qunit-composite.css b/tests/qunit/node_modules/qunit/support/qunit/addons/composite/qunit-composite.css deleted file mode 100644 index df47362..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/addons/composite/qunit-composite.css +++ /dev/null @@ -1,13 +0,0 @@ -iframe.qunit-subsuite{ - position: fixed; - bottom: 0; - left: 0; - - margin: 0; - padding: 0; - border-width: 1px 0 0; - height: 45%; - width: 100%; - - background: #fff; -} \ No newline at end of file diff --git a/tests/qunit/node_modules/qunit/support/qunit/addons/composite/qunit-composite.js b/tests/qunit/node_modules/qunit/support/qunit/addons/composite/qunit-composite.js deleted file mode 100644 index 89c47eb..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/addons/composite/qunit-composite.js +++ /dev/null @@ -1,102 +0,0 @@ -(function( QUnit ) { - -QUnit.extend( QUnit, { - testSuites: function( suites ) { - QUnit.begin(function() { - QUnit.initIframe(); - }); - - for ( var i = 0; i < suites.length; i++ ) { - QUnit.runSuite( suites[i] ); - } - - QUnit.done(function() { - this.iframe.style.display = "none"; - }); - }, - - runSuite: function( suite ) { - asyncTest( suite, function() { - QUnit.iframe.setAttribute( "src", suite ); - }); - }, - - initIframe: function() { - var body = document.body, - iframe = this.iframe = document.createElement( "iframe" ), - iframeWin; - - iframe.className = "qunit-subsuite"; - body.appendChild( iframe ); - - function onIframeLoad() { - var module, test, - count = 0; - - - iframeWin.QUnit.moduleStart(function( data ) { - // capture module name for messages - module = data.name; - }); - - iframeWin.QUnit.testStart(function( data ) { - // capture test name for messages - test = data.name; - }); - iframeWin.QUnit.testDone(function() { - test = null; - }); - - iframeWin.QUnit.log(function( data ) { - if (test === null) { - return; - } - // pass all test details through to the main page - var message = module + ": " + test + ": " + data.message; - expect( ++count ); - QUnit.push( data.result, data.actual, data.expected, message ); - }); - - iframeWin.QUnit.done(function() { - // start the wrapper test from the main page - start(); - }); - } - QUnit.addEvent( iframe, "load", onIframeLoad ); - - iframeWin = iframe.contentWindow; - } -}); - -QUnit.testStart(function( data ) { - // update the test status to show which test suite is running - QUnit.id( "qunit-testresult" ).innerHTML = "Running " + data.name + "...
 "; -}); - -QUnit.testDone(function() { - var i, - current = QUnit.id( this.config.current.id ), - children = current.children, - src = this.iframe.src; - - // undo the auto-expansion of failed tests - for ( i = 0; i < children.length; i++ ) { - if ( children[i].nodeName === "OL" ) { - children[i].style.display = "none"; - } - } - - QUnit.addEvent(current, "dblclick", function( e ) { - var target = e && e.target ? e.target : window.event.srcElement; - if ( target.nodeName.toLowerCase() === "span" || target.nodeName.toLowerCase() === "b" ) { - target = target.parentNode; - } - if ( window.location && target.nodeName.toLowerCase() === "strong" ) { - window.location = src; - } - }); - - current.getElementsByTagName('a')[0].href = src; -}); - -}( QUnit ) ); diff --git a/tests/qunit/node_modules/qunit/support/qunit/addons/junitlogger/index.html b/tests/qunit/node_modules/qunit/support/qunit/addons/junitlogger/index.html deleted file mode 100644 index fe78af3..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/addons/junitlogger/index.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - -QUnit Test Suite - JUnit report - - - - - - -
- - diff --git a/tests/qunit/node_modules/qunit/support/qunit/addons/junitlogger/junitlogger.js b/tests/qunit/node_modules/qunit/support/qunit/addons/junitlogger/junitlogger.js deleted file mode 100644 index dde4707..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/addons/junitlogger/junitlogger.js +++ /dev/null @@ -1,268 +0,0 @@ -(function() { - var count = 0, suiteCount = 0, currentSuite, currentTest, suites = [], assertCount, start, results = {failed:0, passed:0, total:0, time:0}; - - QUnit.jUnitReport = function(data) { - // Gets called when a report is generated - }; - - QUnit.moduleStart(function(data) { - currentSuite = { - name: data.name, - tests: [], - failures: 0, - time: 0, - stdout : '', - stderr : '' - }; - - suites.push(currentSuite); - }); - - QUnit.moduleDone(function(data) { - }); - - QUnit.testStart(function(data) { - if(!start){ start = new Date(); } - - assertCount = 0; - - currentTest = { - name: data.name, - failures: [], - start: new Date() - }; - - // Setup default suite if no module was specified - if (!currentSuite) { - currentSuite = { - name: "default", - tests: [], - failures: 0, - time: 0, - stdout : '', - stderr : '' - }; - - suites.push(currentSuite); - } - - currentSuite.tests.push(currentTest); - }); - - QUnit.testDone(function(data) { - currentTest.failed = data.failed; - currentTest.total = data.total; - currentSuite.failures += data.failed; - - results.failed += data.failed; - results.passed += data.passed; - results.total += data.total; - }); - - QUnit.log(function(data) { - assertCount++; - - if (!data.result) { - currentTest.failures.push(data.message); - - // Add log message of failure to make it easier to find in jenkins UI - currentSuite.stdout += '[' + currentSuite.name + ', ' + currentTest.name + ', ' + assertCount + '] ' + data.message + '\n'; - } - }); - - QUnit.done(function(data) { - function ISODateString(d) { - function pad(n) { - return n < 10 ? '0' + n : n; - } - - return d.getUTCFullYear() + '-' + - pad(d.getUTCMonth() + 1)+'-' + - pad(d.getUTCDate()) + 'T' + - pad(d.getUTCHours()) + ':' + - pad(d.getUTCMinutes()) + ':' + - pad(d.getUTCSeconds()) + 'Z'; - } - - // Generate XML report - var i, ti, fi, test, suite, - xmlWriter = new XmlWriter({ - linebreak_at : "testsuites,testsuite,testcase,failure,system-out,system-err" - }), - now = new Date(); - - xmlWriter.start('testsuites'); - - for (i = 0; i < suites.length; i++) { - suite = suites[i]; - - // Calculate time - for (ti = 0; ti < suite.tests.length; ti++) { - test = suite.tests[ti]; - - test.time = (now.getTime() - test.start.getTime()) / 1000; - suite.time += test.time; - } - - xmlWriter.start('testsuite', { - id: "" + i, - name: suite.name, - errors: "0", - failures: suite.failures, - hostname: "localhost", - tests: suite.tests.length, - time: Math.round(suite.time * 1000) / 1000, - timestamp: ISODateString(now) - }); - - for (ti = 0; ti < suite.tests.length; ti++) { - test = suite.tests[ti]; - - xmlWriter.start('testcase', { - name: test.name, - total: test.total, - failed: test.failed, - time: Math.round(test.time * 1000) / 1000 - }); - - for (fi = 0; fi < test.failures.length; fi++) { - xmlWriter.start('failure', {type: "AssertionFailedError", message: test.failures[fi]}, true); - } - - xmlWriter.end('testcase'); - } - - if (suite.stdout) { - xmlWriter.start('system-out'); - xmlWriter.cdata('\n' + suite.stdout); - xmlWriter.end('system-out'); - } - - if (suite.stderr) { - xmlWriter.start('system-err'); - xmlWriter.cdata('\n' + suite.stderr); - xmlWriter.end('system-err'); - } - - xmlWriter.end('testsuite'); - } - - xmlWriter.end('testsuites'); - - results.time = new Date() - start; - - QUnit.jUnitReport({ - results:results, - xml: xmlWriter.getString() - }); - }); - - function XmlWriter(settings) { - function addLineBreak(name) { - if (lineBreakAt[name] && data[data.length - 1] !== '\n') { - data.push('\n'); - } - } - - function makeMap(items, delim, map) { - var i; - - items = items || []; - - if (typeof(items) === "string") { - items = items.split(','); - } - - map = map || {}; - - i = items.length; - while (i--) { - map[items[i]] = {}; - } - - return map; - } - - function encode(text) { - var baseEntities = { - '"' : '"', - "'" : ''', - '<' : '<', - '>' : '>', - '&' : '&' - }; - - return ('' + text).replace(/[<>&\"\']/g, function(chr) { - return baseEntities[chr] || chr; - }); - } - - var data = [], stack = [], lineBreakAt; - - settings = settings || {}; - lineBreakAt = makeMap(settings.linebreak_at || 'mytag'); - - this.start = function(name, attrs, empty) { - if (!empty) { - stack.push(name); - } - - data.push('<', name); - - for (var aname in attrs) { - data.push(" " + encode(aname), '="', encode(attrs[aname]), '"'); - } - - data.push(empty ? ' />' : '>'); - addLineBreak(name); - }; - - this.end = function(name) { - stack.pop(); - addLineBreak(name); - data.push(''); - addLineBreak(name); - }; - - this.text = function(text) { - data.push(encode(text)); - }; - - this.cdata = function(text) { - data.push(''); - }; - - this.comment = function(text) { - data.push(''); - }; - - this.pi = function(name, text) { - if (text) { - data.push('\n'); - } else { - data.push('\n'); - } - }; - - this.doctype = function(text) { - data.push('\n'); - }; - - this.getString = function() { - for (var i = stack.length - 1; i >= 0; i--) { - this.end(stack[i]); - } - - stack = []; - - return data.join('').replace(/\n$/, ''); - }; - - this.reset = function() { - data = []; - stack = []; - }; - - this.pi(settings.xmldecl || 'xml version="1.0" encoding="UTF-8"'); - } -})(); \ No newline at end of file diff --git a/tests/qunit/node_modules/qunit/support/qunit/addons/phantomjs/README.md b/tests/qunit/node_modules/qunit/support/qunit/addons/phantomjs/README.md deleted file mode 100644 index ed6a446..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/addons/phantomjs/README.md +++ /dev/null @@ -1,14 +0,0 @@ -PhantomJS Runner -================ - -A runner for PhantomJS, providing console output for tests. - -Usage: - - phantomjs runner.js url - -Example: - - phantomjs runner.js http://localhost/qunit/test - -If you're using Grunt, you should take a look at its [qunit task](https://github.com/cowboy/grunt/blob/master/docs/task_qunit.md). \ No newline at end of file diff --git a/tests/qunit/node_modules/qunit/support/qunit/addons/phantomjs/runner.js b/tests/qunit/node_modules/qunit/support/qunit/addons/phantomjs/runner.js deleted file mode 100644 index 135ff44..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/addons/phantomjs/runner.js +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Qt+WebKit powered headless test runner using Phantomjs - * - * Phantomjs installation: http://code.google.com/p/phantomjs/wiki/BuildInstructions - * - * Run with: - * phantomjs runner.js [url-of-your-qunit-testsuite] - * - * E.g. - * phantomjs runner.js http://localhost/qunit/test - */ - -var url = phantom.args[0]; - -var page = require('webpage').create(); - -// Route "console.log()" calls from within the Page context to the main Phantom context (i.e. current "this") -page.onConsoleMessage = function(msg) { - console.log(msg); -}; - -page.onInitialized = function() { - page.evaluate(addLogging); -}; -page.open(url, function(status){ - if (status !== "success") { - console.log("Unable to access network: " + status); - phantom.exit(1); - } else { - // page.evaluate(addLogging); - var interval = setInterval(function() { - if (finished()) { - clearInterval(interval); - onfinishedTests(); - } - }, 500); - } -}); - -function finished() { - return page.evaluate(function(){ - return !!window.qunitDone; - }); -} - -function onfinishedTests() { - var output = page.evaluate(function() { - return JSON.stringify(window.qunitDone); - }); - phantom.exit(JSON.parse(output).failed > 0 ? 1 : 0); -} - -function addLogging() { - window.document.addEventListener( "DOMContentLoaded", function() { - var current_test_assertions = []; - var module; - - QUnit.moduleStart(function(context) { - module = context.name; - }); - - QUnit.testDone(function(result) { - var name = module + ': ' + result.name; - var i; - - if (result.failed) { - console.log('Assertion Failed: ' + name); - - for (i = 0; i < current_test_assertions.length; i++) { - console.log(' ' + current_test_assertions[i]); - } - } - - current_test_assertions = []; - }); - - QUnit.log(function(details) { - var response; - - if (details.result) { - return; - } - - response = details.message || ''; - - if (typeof details.expected !== 'undefined') { - if (response) { - response += ', '; - } - - response += 'expected: ' + details.expected + ', but was: ' + details.actual; - } - - current_test_assertions.push('Failed assertion: ' + response); - }); - - QUnit.done(function(result){ - console.log('Took ' + result.runtime + 'ms to run ' + result.total + ' tests. ' + result.passed + ' passed, ' + result.failed + ' failed.'); - window.qunitDone = result; - }); - }, false ); -} diff --git a/tests/qunit/node_modules/qunit/support/qunit/addons/step/README.md b/tests/qunit/node_modules/qunit/support/qunit/addons/step/README.md deleted file mode 100644 index 37af9df..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/addons/step/README.md +++ /dev/null @@ -1,18 +0,0 @@ -QUnit.step() - A QUnit Addon For Testing execution in order -============================================================ - -This addon for QUnit adds a step method that allows you to assert -the proper sequence in which the code should execute. - -Example: - - test("example test", function () { - function x() { - QUnit.step(2, "function y should be called first"); - } - function y() { - QUnit.step(1); - } - y(); - x(); - }); \ No newline at end of file diff --git a/tests/qunit/node_modules/qunit/support/qunit/addons/step/qunit-step.js b/tests/qunit/node_modules/qunit/support/qunit/addons/step/qunit-step.js deleted file mode 100644 index 1ed3ff0..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/addons/step/qunit-step.js +++ /dev/null @@ -1,25 +0,0 @@ -QUnit.extend( QUnit, { - - /** - * Check the sequence/order - * - * @example step(1); setTimeout(function () { step(3); }, 100); step(2); - * @param Number expected The excepted step within the test() - * @param String message (optional) - */ - step: function (expected, message) { - this.config.current.step++; // increment internal step counter. - if (typeof message === "undefined") { - message = "step " + expected; - } - var actual = this.config.current.step; - QUnit.push(QUnit.equiv(actual, expected), actual, expected, message); - } -}); - -/** - * Reset the step counter for every test() - */ -QUnit.testStart(function () { - this.config.current.step = 0; -}); diff --git a/tests/qunit/node_modules/qunit/support/qunit/addons/step/step-test.js b/tests/qunit/node_modules/qunit/support/qunit/addons/step/step-test.js deleted file mode 100644 index a78c534..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/addons/step/step-test.js +++ /dev/null @@ -1,13 +0,0 @@ -module('Step Addon'); -test("step", 3, function () { - QUnit.step(1, "step starts at 1"); - setTimeout(function () { - start(); - QUnit.step(3); - }, 100); - QUnit.step(2, "before the setTimeout callback is run"); - stop(); -}); -test("step counter", 1, function () { - QUnit.step(1, "each test has its own step counter"); -}); \ No newline at end of file diff --git a/tests/qunit/node_modules/qunit/support/qunit/addons/step/step.html b/tests/qunit/node_modules/qunit/support/qunit/addons/step/step.html deleted file mode 100644 index 95ba492..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/addons/step/step.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - - QUnit Test Suite - Step Addon - - - - - - -
- - diff --git a/tests/qunit/node_modules/qunit/support/qunit/addons/themes/README.md b/tests/qunit/node_modules/qunit/support/qunit/addons/themes/README.md deleted file mode 100644 index 8bc1862..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/addons/themes/README.md +++ /dev/null @@ -1,6 +0,0 @@ -Themes -====== - -These custom themes fully replace the default qunit.css file and should work -with the default markup. To see them in action, open the html file for each. -They'll run the QUnit testsuite itself. \ No newline at end of file diff --git a/tests/qunit/node_modules/qunit/support/qunit/addons/themes/gabe.css b/tests/qunit/node_modules/qunit/support/qunit/addons/themes/gabe.css deleted file mode 100644 index 82eee57..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/addons/themes/gabe.css +++ /dev/null @@ -1,362 +0,0 @@ -/** - * QUnit Theme by Gabe Hendry - * - * http://docs.jquery.com/QUnit - * - * Copyright 2012 jQuery Foundation and other contributors - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - */ - -/** General Styles and Page Sturcture */ -body { - font-family:Arial, 'sans serif'; - padding:20px 20px 0 20px; - position:relative; -} - -h1, h2, h3, h4, h5, h6, #qunit-header, #qunit-banner { - font-family:Calibri, Arial, 'sans-serif'; -} - -h2 #qunit-tests, h2 #qunit-testrunner-toolbar, h2 #qunit-userAgent, #qunit-testresult { - font-family: Arial, 'sans-serif'; -} - -#qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; } -#qunit-tests { font-size: smaller; } - - -/** Resets */ - -#qunit-tests, #qunit-tests ol, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult { - margin: 0; - padding: 0; -} - - -/** Headers */ - -#qunit-header { - padding: 10px 0px 25px 0px; - color: #3B73B9; - font-size: 1.8em; - font-weight: normal; - height:2em; -} - -#qunit-header a { - text-decoration: none; - color: #3B73B9; - font-weight:bold; - padding-right:22px; - float:left; - -} - -#qunit-header label { - font-size:14px; - color:#6BC9ED; - float:right; - font-family:Arial, 'sans-serif'; - display: inline-block; -} - -#qunit-header a + label:after { - content: ' }'; -} - -#qunit-header label + label { - margin-right:8px; -} - -#qunit-header a:hover, #qunit-header a:focus { - color: #3B73B9; - background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAcCAYAAABoMT8aAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2RpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo4RjRENzREMkRFMzBFMTExQkZCM0YxOUI1MEUyRUQ0OCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpERkFDNTFBMjMwREYxMUUxQTA3RjlDQkNDQzY3MkI4MCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpERkFDNTFBMTMwREYxMUUxQTA3RjlDQkNDQzY3MkI4MCIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IFdpbmRvd3MiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo4RjRENzREMkRFMzBFMTExQkZCM0YxOUI1MEUyRUQ0OCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo4RjRENzREMkRFMzBFMTExQkZCM0YxOUI1MEUyRUQ0OCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PjKftvwAAAFqSURBVHja5NTNKwVRHMbxey9X3rrXStlY2ljJRiQLGytLIkUpIks7lIUFC9laCX+DhUiSlMRdsFBSdkqSt4u8ju+vnqkxZriZheTUp1NzzvxmzjnPTNxxnFiUlohFbL9fIL9xeOUf7EEiSgEbf8XUTwv04A59mIuyB2VowyqKvytQjkU8YwaFul6CJmQ+5MB38zSGUIAs8vCi3loc6bA3mECvJl2o0Jhn/B47qAorMIgU9lGJBc/YDZbQgNugAt1I4gGtepq1ZTxiHu2B34L6LpRiD6ee8UPUqfe2lPbl0i1Qoz4T8JCgm89hf6IKdwnX6tM5ZGIEb1py1i2wporNORToUDa2LStugVntdPKr3GvMUnmFUe8p2No3FNOBkCIWsn7NOcC6Pwd2EicoUiZsnVvYxZNutpM601F/CpIFpNazH5bIel1LqOAmqrWEwG/BirQorp3KgL3yMSZxFBYkf7OJ43/jp/ouwAB8JktCUeXXIAAAAABJRU5ErkJggg==') center right no-repeat; -} - -h2, p { - padding: 10px 0 10px 0; - margin:0; - font-size:1.3em; -} - -p { - padding-top:0; - font-size:small; - color:#7B7979; - line-height:1.6em; -} - -h2#qunit-banner { - height: 16px; - padding:5px 5px 5px 25px; - line-height:16px; - margin:0px 0 15px 0; - border-radius: 5px; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - background-position:0px; - background-repeat:no-repeat; - font-size:1em; - font-weight:normal; -} - -h2#qunit-banner.qunit-pass { - background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjc1RjgyNEY5MzE2NzExRTFCQTA0RTIzMEVFNkY4ODM2IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjc1RjgyNEZBMzE2NzExRTFCQTA0RTIzMEVFNkY4ODM2Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6NzVGODI0RjczMTY3MTFFMUJBMDRFMjMwRUU2Rjg4MzYiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NzVGODI0RjgzMTY3MTFFMUJBMDRFMjMwRUU2Rjg4MzYiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz4C94F5AAAAwklEQVR42mL8//8/AyWAiYFCQLEBLOW7GEnVYwzEaUC8B4hXs5CoWRCIVwGxEtQQE1K9ANMMN5AUAzqA2AWJ/x6IzxJrAMi55WhiriBDYAYoEQi0DjSxdJDtsGgESd4F4jNYDAIF2m4oDQOzoBieDsqRbDoDpWEAXfMeqO0oCWkPmo1noH6eiWbYPSAOw5YSQYKr0cRnQg1BDvEwKI1hAEyyAk9AVsACDV9e6MRhSydyoBHKTKuh8bsHSTM+lzEABBgAXD0oIFydPtEAAAAASUVORK5CYII='); - color:#76B900; -} - -h2#qunit-banner.qunit-pass:after { - content:'Congrats! All of your tests passed!'; -} - -h2#qunit-banner.qunit-fail { - background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyBpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNSBXaW5kb3dzIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjU5QUIzNEU2MzE2NzExRTE4ODc3OEVFNEY2NzhDMjM4IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjU5QUIzNEU3MzE2NzExRTE4ODc3OEVFNEY2NzhDMjM4Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6NTlBQjM0RTQzMTY3MTFFMTg4Nzc4RUU0RjY3OEMyMzgiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NTlBQjM0RTUzMTY3MTFFMTg4Nzc4RUU0RjY3OEMyMzgiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz46NEjgAAAAzElEQVR42mL8//8/AyWABUS8N1EFUS5AfA+KcQFBIE6DsjsFz9yGGAAEu6EGgEA6EM/CoRmkzhiJX8EE5bggKZyJZAsuzQwwNhMOp6IbsgpNM9jn8DCAOnsmFkNgNrlg0dyJbMAsNE0MOPgwza5AfBbdC7OgLsEHUDRjCwNChqBoxhWIxngMQI8dDAPKsSlCM2AmLgNAkh04/I3TECZcJiNFrys+Q2AGhOLQPAsaaLgMwZkS0fMDLkPgBqzGoxnZEBMg3gM1CBzdAAEGABpTMr+umvCXAAAAAElFTkSuQmCC'); - color:#ee3324; -} - -h2#qunit-banner.qunit-fail:after { - content:'Oops! One or more tests failed!'; -} - -/** Test Runner Result Styles */ - -#qunit-testrunner-toolbar { - position:absolute; - top:55px; - right:20px; - color:#6BC9ED; - font-size:14px; -} - -#qunit-testrunner-toolbar:after { - content:' }'; -} - -h2#qunit-userAgent { - padding: 0; - color: #7B7979; - border:0; - font-size:small; - font-family: Arial, 'sans-serif'; - font-weight:normal; - font-style:italic; -} - -h2#qunit-userAgent:before { - content:'User Agents: '; -} - - -/** Tests: Pass/Fail */ - -#qunit-tests { - list-style-position: inside; - list-style-type:none; -} - -#qunit-tests li { - padding: 4px 10px; - list-style-position:outside; - border-radius: 5px; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - margin-bottom:5px; - position:relative; - *zoom:1; - list-style-type:none; -} - -#qunit-tests.hidepass li.pass, #qunit-tests.hidepass li.running { - display: none; -} - -#qunit-tests li strong { - cursor: pointer; -} - -#qunit-tests li a { - display:block; - position:absolute; - right:10px; - padding:0px 16px 0 0; - font-size:0.8em; - background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAYCAYAAADOMhxqAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2RpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo4RjRENzREMkRFMzBFMTExQkZCM0YxOUI1MEUyRUQ0OCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpENEZDRDdDQTMxODUxMUUxOTc3NEQ0OTUxNjc4REFEQiIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpENEZDRDdDOTMxODUxMUUxOTc3NEQ0OTUxNjc4REFEQiIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IFdpbmRvd3MiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo5MDRENzREMkRFMzBFMTExQkZCM0YxOUI1MEUyRUQ0OCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo4RjRENzREMkRFMzBFMTExQkZCM0YxOUI1MEUyRUQ0OCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PpE8SAQAAAD3SURBVHjaYsw5+YYBC5gGxN+BuBhdgoUBO1AFYlMgFgXiOGQJJjSFrEDcC8RaQMwPxEFAvBuXDSDFP6D4F1SMG4gtgFgBiB+g2/ATiL8C8UIgPgMV+wvEujDFyBoWQRVPB+IsqOa3QCyFrBhZgysQMwLxFCjfB4hFgPgVlH8DiOcha/jHgBu0ALEMEH9G1rAXqikHi4ZkIP4DxEuQNaQBMReUngjEdkAcDPU8KKROAPFp5GAFBSUPNHZToZEFM+wsEHtgiziQJmYg7gPiy0B8HIiTgNgRX0yD/FFzYdXZK0B8Fchei5GWgBI40xJQbjQtjdi0BBBgAAsUYVWmfe1CAAAAAElFTkSuQmCC') bottom right no-repeat; - color: #3b73b9; - text-decoration: none; - height:12px; - top:5px; -} -#qunit-tests li a:hover, -#qunit-tests li a:focus { - color: #6bc9ed; - background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAYCAYAAADOMhxqAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2RpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo4RjRENzREMkRFMzBFMTExQkZCM0YxOUI1MEUyRUQ0OCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpENEZDRDdDQTMxODUxMUUxOTc3NEQ0OTUxNjc4REFEQiIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpENEZDRDdDOTMxODUxMUUxOTc3NEQ0OTUxNjc4REFEQiIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IFdpbmRvd3MiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo5MDRENzREMkRFMzBFMTExQkZCM0YxOUI1MEUyRUQ0OCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo4RjRENzREMkRFMzBFMTExQkZCM0YxOUI1MEUyRUQ0OCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PpE8SAQAAAD3SURBVHjaYsw5+YYBC5gGxN+BuBhdgoUBO1AFYlMgFgXiOGQJJjSFrEDcC8RaQMwPxEFAvBuXDSDFP6D4F1SMG4gtgFgBiB+g2/ATiL8C8UIgPgMV+wvEujDFyBoWQRVPB+IsqOa3QCyFrBhZgysQMwLxFCjfB4hFgPgVlH8DiOcha/jHgBu0ALEMEH9G1rAXqikHi4ZkIP4DxEuQNaQBMReUngjEdkAcDPU8KKROAPFp5GAFBSUPNHZToZEFM+wsEHtgiziQJmYg7gPiy0B8HIiTgNgRX0yD/FFzYdXZK0B8Fchei5GWgBI40xJQbjQtjdi0BBBgAAsUYVWmfe1CAAAAAElFTkSuQmCC') top right no-repeat; -} -#qunit-tests li.pass strong > span {color:#76B900;} -#qunit-tests li.pass strong:first-child { - padding-left:20px; - background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2RpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo5MTRENzREMkRFMzBFMTExQkZCM0YxOUI1MEUyRUQ0OCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDozODgyNDY5QzMxN0ExMUUxOTdFMkVCQkNENjFBMjc3RSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDozODgyNDY5QjMxN0ExMUUxOTdFMkVCQkNENjFBMjc3RSIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IFdpbmRvd3MiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo5MTRENzREMkRFMzBFMTExQkZCM0YxOUI1MEUyRUQ0OCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo5MTRENzREMkRFMzBFMTExQkZCM0YxOUI1MEUyRUQ0OCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pv7qI08AAAClSURBVHjaYvz//z8DKYClfBcjMeqUgFgQiM+yEKEYpHA3VFMYExEaVkEVg20ipKEDiF2g7LNAPIsJaqUgFsVpQFwOZb8H4nQQzQR13zuoAhgwhpoOA2FQGxiYkNw3E4phnoTZWgHEe2A6maC63yM54y6S4llA3InsTiaobhOYlUiKz0JNZ0DXAAL3gNgViFcjeRLZZkRMI7FhioyhBrzHFs4AAQYAz08iXvWgossAAAAASUVORK5CYII=') center left no-repeat; -} - -#qunit-tests li.fail strong > span {color:#EE3324;} -#qunit-tests li.fail strong:first-child { - padding-left:20px; - background:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAYAAABWdVznAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2RpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMC1jMDYwIDYxLjEzNDc3NywgMjAxMC8wMi8xMi0xNzozMjowMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDo5MTRENzREMkRFMzBFMTExQkZCM0YxOUI1MEUyRUQ0OCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo0MzNBNEM0QzMxN0ExMUUxQjk0MUYyOEJCODA0OTM1OSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo0MzNBNEM0QjMxN0ExMUUxQjk0MUYyOEJCODA0OTM1OSIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IFdpbmRvd3MiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDo5MTRENzREMkRFMzBFMTExQkZCM0YxOUI1MEUyRUQ0OCIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDo5MTRENzREMkRFMzBFMTExQkZCM0YxOUI1MEUyRUQ0OCIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PnO7dSIAAACtSURBVHjaYnxnrMIABEpA/B6K0YEgEBsD8VnBM7ffM0E5d6HYGIvi3UiYgQkqiCyJrAmZbwzTcBaKYZrOAHEaEM9E05wOIlig7nZFM20mmtM6gXgWzAYGJE1nsXgapLACxmFCkniPQwOKGLKGmVC3owMUcZiGDjTFs9BMhmuCxUM5muJ0qJ9Wo2lCcRII7IEFH9RPYbDQgaUCFqjVYdDkMQuLH9Khau6BOAABBgDmhyuetyQ3ywAAAABJRU5ErkJggg==') center left no-repeat; -} - -#qunit-tests li ol { - margin:0; - padding:10px 0 0 0; - background-color: #fff; -} - -#qunit-tests li ol li { - list-style-position: inside; - list-style-type:decimal; - *list-style-position: outside; -} - -#qunit-tests table { - border-collapse: collapse; - margin-top: .2em; -} - -#qunit-tests th { - text-align: right; - vertical-align: top; - padding: 0 .5em 0 0; -} - -#qunit-tests td { - vertical-align: top; -} - -#qunit-tests pre { - margin: 0; - white-space: pre-wrap; - word-wrap: break-word; -} - -#qunit-tests del { - background-color: #add566; - color: #555; - text-decoration: none; -} - -#qunit-tests ins { - background-color: #f5857c; - color: #555; - text-decoration: none; -} - -/*** Test Counts */ - -#qunit-tests b.counts { - color: #7B7979; - font-size:0.8em; - margin-left:10px; -} - -b.counts b.passed, b.counts b.failed { - display:inline-block; - padding:0px 1px; - border-radius: 3px; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - color:#FFF; -} - -b.counts b.passed { - background:#76b900; -} - -b.counts b.failed { - background:#ee3324; - } - - -#qunit-tests li li { - margin:0 0 5px; - padding: 0.4em 0.5em 0.4em 0.5em; - background-color: #fff; - border-bottom: none; - border-radius: 3px; - -moz-border-radius: 3px; - -webkit-border-radius: 3px; - overflow:auto; -} - -/*** Passing Styles */ - -#qunit-tests li li.pass { - color: #7B7979; - background-color: #fff; - border-left: 20px solid #76B900; -} - -#qunit-tests .pass { color: #76B900; background-color: #FFF; border: 1px solid #add566; } - -#qunit-tests .pass .test-actual, -#qunit-tests .pass .test-expected { color: #999999; } - - -/*** Failing Styles */ -#qunit-tests li.fail ol { - background:#f7f7f7; -} - -#qunit-tests li li.fail { - color: #7B7979; - background-color: #fff; - border-left: 20px solid #EE3324; - white-space: pre; -} - -#qunit-tests .fail { color: #EE3324; border: 1px solid #f5857c; background-color: #f7f7f7; } - - -#qunit-tests .fail .test-actual, -#qunit-tests .fail .test-expected { color: #999999; } - - - -/** Result */ - -p#qunit-testresult { - padding: 10px 0; - font-weight:bold; - line-height:1.6em; - color: #7B7979; -} - -p#qunit-testresult span.passed, p#qunit-testresult span.failed { - font-size:1.5em; - font-weight:bold; - display:inline-block; - padding:3px; - border-radius: 5px; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; -} - -p#qunit-testresult span.passed { - color:#FFF; - background:#76b900 -} - -p#qunit-testresult span.failed { - color:#FFF; - background:#ee3324; -} - - -/** Fixture */ - -#qunit-fixture { - position: absolute; - top: -10000px; - left: -10000px; - width: 1000px; - height: 1000px; -} diff --git a/tests/qunit/node_modules/qunit/support/qunit/addons/themes/gabe.html b/tests/qunit/node_modules/qunit/support/qunit/addons/themes/gabe.html deleted file mode 100644 index ea53247..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/addons/themes/gabe.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - QUnit Test Suite - Gabe Theme - - - - - - -
-
test markup
- - diff --git a/tests/qunit/node_modules/qunit/support/qunit/addons/themes/nv.css b/tests/qunit/node_modules/qunit/support/qunit/addons/themes/nv.css deleted file mode 100644 index 2beb00b..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/addons/themes/nv.css +++ /dev/null @@ -1,208 +0,0 @@ -/** - * QUnit Theme by NV - * - * http://docs.jquery.com/QUnit - * - * Copyright 2012 jQuery Foundation and other contributors - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - */ - -/** Font Family and Sizes */ - -#qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult { - font-family: "Helvetica Neue", Helvetica, sans-serif; -} - -#qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; } -#qunit-tests { font-size: smaller; } - - -/** Resets */ - -#qunit-wrapper, #qunit-tests, #qunit-tests ol, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult { - margin: 0; - padding: 0; -} - - -/** Header */ - -#qunit-header { - font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Helvetica, sans-serif; - padding: 0.5em 0 0.5em 1.3em; - - color: #8699a4; - background-color: #0d3349; - - font-size: 1.5em; - line-height: 1em; - font-weight: normal; -} - -#qunit-header a { - text-decoration: none; - color: #c2ccd1; -} - -#qunit-header a:hover, -#qunit-header a:focus { - color: #fff; -} - -#qunit-header label { - display: inline-block; -} - -#qunit-banner.qunit-pass { - height: 3px; -} -#qunit-banner.qunit-fail { - height: 5px; -} - -#qunit-testrunner-toolbar { - padding: 0 0 0.5em 2em; -} - -#qunit-testrunner-toolbar label { - margin-right: 1em; -} - -#qunit-userAgent { - padding: 0.5em 0 0.5em 2.5em; - font-weight: normal; - color: #666; -} - - -/** Tests: Pass/Fail */ - -#qunit-tests { - list-style-type: none; - background-color: #D2E0E6; -} - -#qunit-tests li { - padding: 0.4em 0.5em 0.4em 2.5em; -} - -#qunit-tests li strong { - font-weight: normal; - cursor: pointer; -} - -#qunit-tests ol { - margin: 0.5em 0 1em; - background-color: #fff; -} - -#qunit-tests table { - border-collapse: collapse; - margin-top: .2em; -} - -#qunit-tests th { - text-align: right; - vertical-align: top; - padding: 0 .5em 0 0; -} - -#qunit-tests td { - vertical-align: top; -} - -#qunit-tests pre { - margin: 0; - white-space: pre-wrap; - word-wrap: break-word; -} - -#qunit-tests del { - background-color: #e0f2be; - color: #374e0c; - text-decoration: none; -} - -#qunit-tests ins { - background-color: #ffcaca; - color: #500; - text-decoration: none; -} - -/*** Test Counts */ - -#qunit-tests b.passed { color: #5E740B; } -#qunit-tests b.failed { - color: #710909; -} -#qunit-tests li.fail .failed { - color: #E48989; -} -#qunit-tests li.fail .passed { - color: #E3C987; -} - -#qunit-tests li li { - margin-left: 2.5em; - padding: 0.7em 0.5em 0.7em 0; - background-color: #fff; - border-bottom: none; -} - -#qunit-tests b.counts { - font-weight: normal; -} - -/*** Passing Styles */ - -#qunit-tests li li.pass { - color: #5E740B; - background-color: #fff; -} - -#qunit-tests .pass { color: #2f3424; background-color: #d9dec3; } -#qunit-tests .pass .module-name { color: #636b51; } - -#qunit-tests .pass .test-actual, -#qunit-tests .pass .test-expected { color: #999999; } - -#qunit-banner.qunit-pass { background-color: #C6E746; } - -/*** Failing Styles */ - -#qunit-tests li li.fail { - color: #710909; - background-color: #fff; -} - -#qunit-tests .fail { color: #fff; background-color: #962323; } -#qunit-tests .fail .module-name, -#qunit-tests .fail .counts { color: #DEC1C1; } - -#qunit-tests .fail .test-actual { color: #B72F2F; } -#qunit-tests .fail .test-expected { color: green; } - -#qunit-banner.qunit-fail, -#qunit-testrunner-toolbar { color: #dec1c1; background-color: #962323; } - - -/** Footer */ - -#qunit-testresult { - padding: 0.5em 0.5em 0.5em 2.5em; - color: #333; -} -#qunit-testresult .module-name { - font-weight: bold; -} - -/** Fixture */ - -#qunit-fixture { - position: absolute; - top: -10000px; - left: -10000px; - width: 1000px; - height: 1000px; -} diff --git a/tests/qunit/node_modules/qunit/support/qunit/addons/themes/nv.html b/tests/qunit/node_modules/qunit/support/qunit/addons/themes/nv.html deleted file mode 100644 index 4208450..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/addons/themes/nv.html +++ /dev/null @@ -1,14 +0,0 @@ - - - - QUnit Test Suite - NV Theme - - - - - - -
-
test markup
- - diff --git a/tests/qunit/node_modules/qunit/support/qunit/grunt.js b/tests/qunit/node_modules/qunit/support/qunit/grunt.js deleted file mode 100644 index ad26191..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/grunt.js +++ /dev/null @@ -1,100 +0,0 @@ -/*global config:true, task:true*/ -module.exports = function( grunt ) { - -grunt.loadNpmTasks( "grunt-git-authors" ); - -grunt.initConfig({ - pkg: '', - qunit: { - // TODO include 'test/logs.html' as well - qunit: 'test/index.html', - addons: [ - 'addons/canvas/canvas.html', - 'addons/close-enough/close-enough.html', - 'addons/composite/composite-demo-test.html' - ] - }, - lint: { - qunit: 'qunit/qunit.js', - // addons: 'addons/**/*.js', - grunt: 'grunt.js' - // TODO need to figure out which warnings to fix and which to disable - // tests: 'test/test.js' - }, - jshint: { - qunit: { - options: { - onevar: true, - browser: true, - bitwise: true, - curly: true, - trailing: true, - immed: true, - latedef: false, - newcap: true, - noarg: false, - noempty: true, - nonew: true, - sub: true, - undef: true, - eqnull: true, - proto: true, - smarttabs: true - }, - globals: { - jQuery: true, - exports: true - } - }, - addons: { - options: { - browser: true, - curly: true, - eqnull: true, - eqeqeq: true, - expr: true, - evil: true, - jquery: true, - latedef: true, - noarg: true, - onevar: true, - smarttabs: true, - trailing: true, - undef: true - }, - globals: { - module: true, - test: true, - asyncTest: true, - expect: true, - start: true, - stop: true, - QUnit: true - } - }, - tests: { - } - } -}); - -grunt.registerTask( "testswarm", function( commit, configFile ) { - var testswarm = require( "testswarm" ), - config = grunt.file.readJSON( configFile ).qunit; - testswarm({ - url: config.swarmUrl, - pollInterval: 10000, - done: this.async() - }, { - authUsername: "qunit", - authToken: config.authToken, - jobName: 'QUnit commit #' + commit.substr( 0, 10 ) + '', - runMax: config.runMax, - "runNames[]": "QUnit", - "runUrls[]": config.testUrl + commit + "/test/index.html", - "browserSets[]": ["popular"] - }); -}); - -grunt.registerTask('default', 'lint qunit'); - -}; diff --git a/tests/qunit/node_modules/qunit/support/qunit/package.json b/tests/qunit/node_modules/qunit/support/qunit/package.json deleted file mode 100644 index 37df0ee..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "qunitjs", - "title": "QUnit", - "description": "An easy-to-use JavaScript Unit Testing framework.", - "version": "1.10.0pre", - "author": "The jQuery Project", - "contributors": [ - "John Resig (http://ejohn.org/)", - "Jörn Zaefferer (http://bassistance.de/)" - ], - "homepage": "http://docs.jquery.com/QUnit", - "repository": { - "type": "git", - "url": "git://github.com/jquery/qunit.git" - }, - "bugs": { - "url": "https://github.com/jquery/qunit/issues" - }, - "license": { - "name": "MIT", - "url": "http://www.opensource.org/licenses/mit-license.php" - }, - "keywords": [ - "testing", - "unit", - "jquery" - ], - "main": "qunit/qunit.js", - "devDependencies": { - "grunt": "0.3.x", - "grunt-git-authors": "1.0.0", - "testswarm": "0.2.2" - } -} diff --git a/tests/qunit/node_modules/qunit/support/qunit/qunit/qunit.css b/tests/qunit/node_modules/qunit/support/qunit/qunit/qunit.css deleted file mode 100644 index dc8540b..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/qunit/qunit.css +++ /dev/null @@ -1,231 +0,0 @@ -/** - * QUnit v1.10.0pre - A JavaScript Unit Testing Framework - * - * http://docs.jquery.com/QUnit - * - * Copyright 2012 jQuery Foundation and other contributors - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - */ - -/** Font Family and Sizes */ - -#qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult { - font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif; -} - -#qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; } -#qunit-tests { font-size: smaller; } - - -/** Resets */ - -#qunit-tests, #qunit-tests ol, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult { - margin: 0; - padding: 0; -} - - -/** Header */ - -#qunit-header { - padding: 0.5em 0 0.5em 1em; - - color: #8699a4; - background-color: #0d3349; - - font-size: 1.5em; - line-height: 1em; - font-weight: normal; - - border-radius: 5px 5px 0 0; - -moz-border-radius: 5px 5px 0 0; - -webkit-border-top-right-radius: 5px; - -webkit-border-top-left-radius: 5px; -} - -#qunit-header a { - text-decoration: none; - color: #c2ccd1; -} - -#qunit-header a:hover, -#qunit-header a:focus { - color: #fff; -} - -#qunit-testrunner-toolbar label { - display: inline-block; - padding: 0 .5em 0 .1em; -} - -#qunit-banner { - height: 5px; -} - -#qunit-testrunner-toolbar { - padding: 0.5em 0 0.5em 2em; - color: #5E740B; - background-color: #eee; -} - -#qunit-userAgent { - padding: 0.5em 0 0.5em 2.5em; - background-color: #2b81af; - color: #fff; - text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px; -} - - -/** Tests: Pass/Fail */ - -#qunit-tests { - list-style-position: inside; -} - -#qunit-tests li { - padding: 0.4em 0.5em 0.4em 2.5em; - border-bottom: 1px solid #fff; - list-style-position: inside; -} - -#qunit-tests.hidepass li.pass, #qunit-tests.hidepass li.running { - display: none; -} - -#qunit-tests li strong { - cursor: pointer; -} - -#qunit-tests li a { - padding: 0.5em; - color: #c2ccd1; - text-decoration: none; -} -#qunit-tests li a:hover, -#qunit-tests li a:focus { - color: #000; -} - -#qunit-tests ol { - margin-top: 0.5em; - padding: 0.5em; - - background-color: #fff; - - border-radius: 5px; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; -} - -#qunit-tests table { - border-collapse: collapse; - margin-top: .2em; -} - -#qunit-tests th { - text-align: right; - vertical-align: top; - padding: 0 .5em 0 0; -} - -#qunit-tests td { - vertical-align: top; -} - -#qunit-tests pre { - margin: 0; - white-space: pre-wrap; - word-wrap: break-word; -} - -#qunit-tests del { - background-color: #e0f2be; - color: #374e0c; - text-decoration: none; -} - -#qunit-tests ins { - background-color: #ffcaca; - color: #500; - text-decoration: none; -} - -/*** Test Counts */ - -#qunit-tests b.counts { color: black; } -#qunit-tests b.passed { color: #5E740B; } -#qunit-tests b.failed { color: #710909; } - -#qunit-tests li li { - padding: 5px; - background-color: #fff; - border-bottom: none; - list-style-position: inside; -} - -/*** Passing Styles */ - -#qunit-tests li li.pass { - color: #3c510c; - background-color: #fff; - border-left: 10px solid #C6E746; -} - -#qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; } -#qunit-tests .pass .test-name { color: #366097; } - -#qunit-tests .pass .test-actual, -#qunit-tests .pass .test-expected { color: #999999; } - -#qunit-banner.qunit-pass { background-color: #C6E746; } - -/*** Failing Styles */ - -#qunit-tests li li.fail { - color: #710909; - background-color: #fff; - border-left: 10px solid #EE5757; - white-space: pre; -} - -#qunit-tests > li:last-child { - border-radius: 0 0 5px 5px; - -moz-border-radius: 0 0 5px 5px; - -webkit-border-bottom-right-radius: 5px; - -webkit-border-bottom-left-radius: 5px; -} - -#qunit-tests .fail { color: #000000; background-color: #EE5757; } -#qunit-tests .fail .test-name, -#qunit-tests .fail .module-name { color: #000000; } - -#qunit-tests .fail .test-actual { color: #EE5757; } -#qunit-tests .fail .test-expected { color: green; } - -#qunit-banner.qunit-fail { background-color: #EE5757; } - - -/** Result */ - -#qunit-testresult { - padding: 0.5em 0.5em 0.5em 2.5em; - - color: #2b81af; - background-color: #D2E0E6; - - border-bottom: 1px solid white; -} -#qunit-testresult .module-name { - font-weight: bold; -} - -/** Fixture */ - -#qunit-fixture { - position: absolute; - top: -10000px; - left: -10000px; - width: 1000px; - height: 1000px; -} diff --git a/tests/qunit/node_modules/qunit/support/qunit/qunit/qunit.js b/tests/qunit/node_modules/qunit/support/qunit/qunit/qunit.js deleted file mode 100644 index 5c9050b..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/qunit/qunit.js +++ /dev/null @@ -1,1934 +0,0 @@ -/** - * QUnit v1.10.0pre - A JavaScript Unit Testing Framework - * - * http://docs.jquery.com/QUnit - * - * Copyright 2012 jQuery Foundation and other contributors - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - */ - -(function( window ) { - -var QUnit, - config, - onErrorFnPrev, - testId = 0, - fileName = (sourceFromStacktrace( 0 ) || "" ).replace(/(:\d+)+\)?/, "").replace(/.+\//, ""), - toString = Object.prototype.toString, - hasOwn = Object.prototype.hasOwnProperty, - // Keep a local reference to Date (GH-283) - Date = window.Date, - defined = { - setTimeout: typeof window.setTimeout !== "undefined", - sessionStorage: (function() { - var x = "qunit-test-string"; - try { - sessionStorage.setItem( x, x ); - sessionStorage.removeItem( x ); - return true; - } catch( e ) { - return false; - } - }()) -}; - -function Test( settings ) { - extend( this, settings ); - this.assertions = []; - this.testNumber = ++Test.count; -} - -Test.count = 0; - -Test.prototype = { - init: function() { - var a, b, li, - tests = id( "qunit-tests" ); - - if ( tests ) { - b = document.createElement( "strong" ); - b.innerHTML = this.name; - - // `a` initialized at top of scope - a = document.createElement( "a" ); - a.innerHTML = "Rerun"; - a.href = QUnit.url({ testNumber: this.testNumber }); - - li = document.createElement( "li" ); - li.appendChild( b ); - li.appendChild( a ); - li.className = "running"; - li.id = this.id = "qunit-test-output" + testId++; - - tests.appendChild( li ); - } - }, - setup: function() { - if ( this.module !== config.previousModule ) { - if ( config.previousModule ) { - runLoggingCallbacks( "moduleDone", QUnit, { - name: config.previousModule, - failed: config.moduleStats.bad, - passed: config.moduleStats.all - config.moduleStats.bad, - total: config.moduleStats.all - }); - } - config.previousModule = this.module; - config.moduleStats = { all: 0, bad: 0 }; - runLoggingCallbacks( "moduleStart", QUnit, { - name: this.module - }); - } else if ( config.autorun ) { - runLoggingCallbacks( "moduleStart", QUnit, { - name: this.module - }); - } - - config.current = this; - - this.testEnvironment = extend({ - setup: function() {}, - teardown: function() {} - }, this.moduleTestEnvironment ); - - runLoggingCallbacks( "testStart", QUnit, { - name: this.testName, - module: this.module - }); - - // allow utility functions to access the current test environment - // TODO why?? - QUnit.current_testEnvironment = this.testEnvironment; - - if ( !config.pollution ) { - saveGlobal(); - } - if ( config.notrycatch ) { - this.testEnvironment.setup.call( this.testEnvironment ); - return; - } - try { - this.testEnvironment.setup.call( this.testEnvironment ); - } catch( e ) { - QUnit.pushFailure( "Setup failed on " + this.testName + ": " + e.message, extractStacktrace( e, 1 ) ); - } - }, - run: function() { - config.current = this; - - var running = id( "qunit-testresult" ); - - if ( running ) { - running.innerHTML = "Running:
" + this.name; - } - - if ( this.async ) { - QUnit.stop(); - } - - if ( config.notrycatch ) { - this.callback.call( this.testEnvironment, QUnit.assert ); - return; - } - - try { - this.callback.call( this.testEnvironment, QUnit.assert ); - } catch( e ) { - QUnit.pushFailure( "Died on test #" + (this.assertions.length + 1) + " " + this.stack + ": " + e.message, extractStacktrace( e, 0 ) ); - // else next test will carry the responsibility - saveGlobal(); - - // Restart the tests if they're blocking - if ( config.blocking ) { - QUnit.start(); - } - } - }, - teardown: function() { - config.current = this; - if ( config.notrycatch ) { - this.testEnvironment.teardown.call( this.testEnvironment ); - return; - } else { - try { - this.testEnvironment.teardown.call( this.testEnvironment ); - } catch( e ) { - QUnit.pushFailure( "Teardown failed on " + this.testName + ": " + e.message, extractStacktrace( e, 1 ) ); - } - } - checkPollution(); - }, - finish: function() { - config.current = this; - if ( config.requireExpects && this.expected == null ) { - QUnit.pushFailure( "Expected number of assertions to be defined, but expect() was not called.", this.stack ); - } else if ( this.expected != null && this.expected != this.assertions.length ) { - QUnit.pushFailure( "Expected " + this.expected + " assertions, but " + this.assertions.length + " were run", this.stack ); - } else if ( this.expected == null && !this.assertions.length ) { - QUnit.pushFailure( "Expected at least one assertion, but none were run - call expect(0) to accept zero assertions.", this.stack ); - } - - var assertion, a, b, i, li, ol, - test = this, - good = 0, - bad = 0, - tests = id( "qunit-tests" ); - - config.stats.all += this.assertions.length; - config.moduleStats.all += this.assertions.length; - - if ( tests ) { - ol = document.createElement( "ol" ); - - for ( i = 0; i < this.assertions.length; i++ ) { - assertion = this.assertions[i]; - - li = document.createElement( "li" ); - li.className = assertion.result ? "pass" : "fail"; - li.innerHTML = assertion.message || ( assertion.result ? "okay" : "failed" ); - ol.appendChild( li ); - - if ( assertion.result ) { - good++; - } else { - bad++; - config.stats.bad++; - config.moduleStats.bad++; - } - } - - // store result when possible - if ( QUnit.config.reorder && defined.sessionStorage ) { - if ( bad ) { - sessionStorage.setItem( "qunit-test-" + this.module + "-" + this.testName, bad ); - } else { - sessionStorage.removeItem( "qunit-test-" + this.module + "-" + this.testName ); - } - } - - if ( bad === 0 ) { - ol.style.display = "none"; - } - - // `b` initialized at top of scope - b = document.createElement( "strong" ); - b.innerHTML = this.name + " (" + bad + ", " + good + ", " + this.assertions.length + ")"; - - addEvent(b, "click", function() { - var next = b.nextSibling.nextSibling, - display = next.style.display; - next.style.display = display === "none" ? "block" : "none"; - }); - - addEvent(b, "dblclick", function( e ) { - var target = e && e.target ? e.target : window.event.srcElement; - if ( target.nodeName.toLowerCase() == "span" || target.nodeName.toLowerCase() == "b" ) { - target = target.parentNode; - } - if ( window.location && target.nodeName.toLowerCase() === "strong" ) { - window.location = QUnit.url({ testNumber: test.testNumber }); - } - }); - - // `li` initialized at top of scope - li = id( this.id ); - li.className = bad ? "fail" : "pass"; - li.removeChild( li.firstChild ); - a = li.firstChild; - li.appendChild( b ); - li.appendChild ( a ); - li.appendChild( ol ); - - } else { - for ( i = 0; i < this.assertions.length; i++ ) { - if ( !this.assertions[i].result ) { - bad++; - config.stats.bad++; - config.moduleStats.bad++; - } - } - } - - runLoggingCallbacks( "testDone", QUnit, { - name: this.testName, - module: this.module, - failed: bad, - passed: this.assertions.length - bad, - total: this.assertions.length - }); - - QUnit.reset(); - - config.current = undefined; - }, - - queue: function() { - var bad, - test = this; - - synchronize(function() { - test.init(); - }); - function run() { - // each of these can by async - synchronize(function() { - test.setup(); - }); - synchronize(function() { - test.run(); - }); - synchronize(function() { - test.teardown(); - }); - synchronize(function() { - test.finish(); - }); - } - - // `bad` initialized at top of scope - // defer when previous test run passed, if storage is available - bad = QUnit.config.reorder && defined.sessionStorage && - +sessionStorage.getItem( "qunit-test-" + this.module + "-" + this.testName ); - - if ( bad ) { - run(); - } else { - synchronize( run, true ); - } - } -}; - -// Root QUnit object. -// `QUnit` initialized at top of scope -QUnit = { - - // call on start of module test to prepend name to all tests - module: function( name, testEnvironment ) { - config.currentModule = name; - config.currentModuleTestEnviroment = testEnvironment; - }, - - asyncTest: function( testName, expected, callback ) { - if ( arguments.length === 2 ) { - callback = expected; - expected = null; - } - - QUnit.test( testName, expected, callback, true ); - }, - - test: function( testName, expected, callback, async ) { - var test, - name = "" + escapeInnerText( testName ) + ""; - - if ( arguments.length === 2 ) { - callback = expected; - expected = null; - } - - if ( config.currentModule ) { - name = "" + config.currentModule + ": " + name; - } - - test = new Test({ - name: name, - testName: testName, - expected: expected, - async: async, - callback: callback, - module: config.currentModule, - moduleTestEnvironment: config.currentModuleTestEnviroment, - stack: sourceFromStacktrace( 2 ) - }); - - if ( !validTest( test ) ) { - return; - } - - test.queue(); - }, - - // Specify the number of expected assertions to gurantee that failed test (no assertions are run at all) don't slip through. - expect: function( asserts ) { - config.current.expected = asserts; - }, - - start: function( count ) { - config.semaphore -= count || 1; - // don't start until equal number of stop-calls - if ( config.semaphore > 0 ) { - return; - } - // ignore if start is called more often then stop - if ( config.semaphore < 0 ) { - config.semaphore = 0; - } - // A slight delay, to avoid any current callbacks - if ( defined.setTimeout ) { - window.setTimeout(function() { - if ( config.semaphore > 0 ) { - return; - } - if ( config.timeout ) { - clearTimeout( config.timeout ); - } - - config.blocking = false; - process( true ); - }, 13); - } else { - config.blocking = false; - process( true ); - } - }, - - stop: function( count ) { - config.semaphore += count || 1; - config.blocking = true; - - if ( config.testTimeout && defined.setTimeout ) { - clearTimeout( config.timeout ); - config.timeout = window.setTimeout(function() { - QUnit.ok( false, "Test timed out" ); - config.semaphore = 1; - QUnit.start(); - }, config.testTimeout ); - } - } -}; - -// Asssert helpers -// All of these must call either QUnit.push() or manually do: -// - runLoggingCallbacks( "log", .. ); -// - config.current.assertions.push({ .. }); -QUnit.assert = { - /** - * Asserts rough true-ish result. - * @name ok - * @function - * @example ok( "asdfasdf".length > 5, "There must be at least 5 chars" ); - */ - ok: function( result, msg ) { - if ( !config.current ) { - throw new Error( "ok() assertion outside test context, was " + sourceFromStacktrace(2) ); - } - result = !!result; - - var source, - details = { - result: result, - message: msg - }; - - msg = escapeInnerText( msg || (result ? "okay" : "failed" ) ); - msg = "" + msg + ""; - - if ( !result ) { - source = sourceFromStacktrace( 2 ); - if ( source ) { - details.source = source; - msg += "
Source:
" + escapeInnerText( source ) + "
"; - } - } - runLoggingCallbacks( "log", QUnit, details ); - config.current.assertions.push({ - result: result, - message: msg - }); - }, - - /** - * Assert that the first two arguments are equal, with an optional message. - * Prints out both actual and expected values. - * @name equal - * @function - * @example equal( format( "Received {0} bytes.", 2), "Received 2 bytes.", "format() replaces {0} with next argument" ); - */ - equal: function( actual, expected, message ) { - QUnit.push( expected == actual, actual, expected, message ); - }, - - /** - * @name notEqual - * @function - */ - notEqual: function( actual, expected, message ) { - QUnit.push( expected != actual, actual, expected, message ); - }, - - /** - * @name deepEqual - * @function - */ - deepEqual: function( actual, expected, message ) { - QUnit.push( QUnit.equiv(actual, expected), actual, expected, message ); - }, - - /** - * @name notDeepEqual - * @function - */ - notDeepEqual: function( actual, expected, message ) { - QUnit.push( !QUnit.equiv(actual, expected), actual, expected, message ); - }, - - /** - * @name strictEqual - * @function - */ - strictEqual: function( actual, expected, message ) { - QUnit.push( expected === actual, actual, expected, message ); - }, - - /** - * @name notStrictEqual - * @function - */ - notStrictEqual: function( actual, expected, message ) { - QUnit.push( expected !== actual, actual, expected, message ); - }, - - throws: function( block, expected, message ) { - var actual, - ok = false; - - // 'expected' is optional - if ( typeof expected === "string" ) { - message = expected; - expected = null; - } - - config.current.ignoreGlobalErrors = true; - try { - block.call( config.current.testEnvironment ); - } catch (e) { - actual = e; - } - config.current.ignoreGlobalErrors = false; - - if ( actual ) { - // we don't want to validate thrown error - if ( !expected ) { - ok = true; - // expected is a regexp - } else if ( QUnit.objectType( expected ) === "regexp" ) { - ok = expected.test( actual ); - // expected is a constructor - } else if ( actual instanceof expected ) { - ok = true; - // expected is a validation function which returns true is validation passed - } else if ( expected.call( {}, actual ) === true ) { - ok = true; - } - - QUnit.push( ok, actual, null, message ); - } else { - QUnit.pushFailure( message, null, 'No exception was thrown.' ); - } - } -}; - -/** - * @deprecate since 1.8.0 - * Kept assertion helpers in root for backwards compatibility - */ -extend( QUnit, QUnit.assert ); - -/** - * @deprecated since 1.9.0 - * Kept global "raises()" for backwards compatibility - */ -QUnit.raises = QUnit.assert.throws; - -/** - * @deprecated since 1.0.0, replaced with error pushes since 1.3.0 - * Kept to avoid TypeErrors for undefined methods. - */ -QUnit.equals = function() { - QUnit.push( false, false, false, "QUnit.equals has been deprecated since 2009 (e88049a0), use QUnit.equal instead" ); -}; -QUnit.same = function() { - QUnit.push( false, false, false, "QUnit.same has been deprecated since 2009 (e88049a0), use QUnit.deepEqual instead" ); -}; - -// We want access to the constructor's prototype -(function() { - function F() {} - F.prototype = QUnit; - QUnit = new F(); - // Make F QUnit's constructor so that we can add to the prototype later - QUnit.constructor = F; -}()); - -/** - * Config object: Maintain internal state - * Later exposed as QUnit.config - * `config` initialized at top of scope - */ -config = { - // The queue of tests to run - queue: [], - - // block until document ready - blocking: true, - - // when enabled, show only failing tests - // gets persisted through sessionStorage and can be changed in UI via checkbox - hidepassed: false, - - // by default, run previously failed tests first - // very useful in combination with "Hide passed tests" checked - reorder: true, - - // by default, modify document.title when suite is done - altertitle: true, - - // when enabled, all tests must call expect() - requireExpects: false, - - // add checkboxes that are persisted in the query-string - // when enabled, the id is set to `true` as a `QUnit.config` property - urlConfig: [ - { - id: "noglobals", - label: "Check for Globals", - tooltip: "Enabling this will test if any test introduces new properties on the `window` object. Stored as query-strings." - }, - { - id: "notrycatch", - label: "No try-catch", - tooltip: "Enabling this will run tests outside of a try-catch block. Makes debugging exceptions in IE reasonable. Stored as query-strings." - } - ], - - // logging callback queues - begin: [], - done: [], - log: [], - testStart: [], - testDone: [], - moduleStart: [], - moduleDone: [] -}; - -// Initialize more QUnit.config and QUnit.urlParams -(function() { - var i, - location = window.location || { search: "", protocol: "file:" }, - params = location.search.slice( 1 ).split( "&" ), - length = params.length, - urlParams = {}, - current; - - if ( params[ 0 ] ) { - for ( i = 0; i < length; i++ ) { - current = params[ i ].split( "=" ); - current[ 0 ] = decodeURIComponent( current[ 0 ] ); - // allow just a key to turn on a flag, e.g., test.html?noglobals - current[ 1 ] = current[ 1 ] ? decodeURIComponent( current[ 1 ] ) : true; - urlParams[ current[ 0 ] ] = current[ 1 ]; - } - } - - QUnit.urlParams = urlParams; - - // String search anywhere in moduleName+testName - config.filter = urlParams.filter; - - // Exact match of the module name - config.module = urlParams.module; - - config.testNumber = parseInt( urlParams.testNumber, 10 ) || null; - - // Figure out if we're running the tests from a server or not - QUnit.isLocal = location.protocol === "file:"; -}()); - -// Export global variables, unless an 'exports' object exists, -// in that case we assume we're in CommonJS (dealt with on the bottom of the script) -if ( typeof exports === "undefined" ) { - extend( window, QUnit ); - - // Expose QUnit object - window.QUnit = QUnit; -} - -// Extend QUnit object, -// these after set here because they should not be exposed as global functions -extend( QUnit, { - config: config, - - // Initialize the configuration options - init: function() { - extend( config, { - stats: { all: 0, bad: 0 }, - moduleStats: { all: 0, bad: 0 }, - started: +new Date(), - updateRate: 1000, - blocking: false, - autostart: true, - autorun: false, - filter: "", - queue: [], - semaphore: 0 - }); - - var tests, banner, result, - qunit = id( "qunit" ); - - if ( qunit ) { - qunit.innerHTML = - "

" + escapeInnerText( document.title ) + "

" + - "

" + - "
" + - "

" + - "
    "; - } - - tests = id( "qunit-tests" ); - banner = id( "qunit-banner" ); - result = id( "qunit-testresult" ); - - if ( tests ) { - tests.innerHTML = ""; - } - - if ( banner ) { - banner.className = ""; - } - - if ( result ) { - result.parentNode.removeChild( result ); - } - - if ( tests ) { - result = document.createElement( "p" ); - result.id = "qunit-testresult"; - result.className = "result"; - tests.parentNode.insertBefore( result, tests ); - result.innerHTML = "Running...
     "; - } - }, - - // Resets the test setup. Useful for tests that modify the DOM. - // If jQuery is available, uses jQuery's html(), otherwise just innerHTML. - reset: function() { - var fixture; - - if ( window.jQuery ) { - jQuery( "#qunit-fixture" ).html( config.fixture ); - } else { - fixture = id( "qunit-fixture" ); - if ( fixture ) { - fixture.innerHTML = config.fixture; - } - } - }, - - // Trigger an event on an element. - // @example triggerEvent( document.body, "click" ); - triggerEvent: function( elem, type, event ) { - if ( document.createEvent ) { - event = document.createEvent( "MouseEvents" ); - event.initMouseEvent(type, true, true, elem.ownerDocument.defaultView, - 0, 0, 0, 0, 0, false, false, false, false, 0, null); - - elem.dispatchEvent( event ); - } else if ( elem.fireEvent ) { - elem.fireEvent( "on" + type ); - } - }, - - // Safe object type checking - is: function( type, obj ) { - return QUnit.objectType( obj ) == type; - }, - - objectType: function( obj ) { - if ( typeof obj === "undefined" ) { - return "undefined"; - // consider: typeof null === object - } - if ( obj === null ) { - return "null"; - } - - var type = toString.call( obj ).match(/^\[object\s(.*)\]$/)[1] || ""; - - switch ( type ) { - case "Number": - if ( isNaN(obj) ) { - return "nan"; - } - return "number"; - case "String": - case "Boolean": - case "Array": - case "Date": - case "RegExp": - case "Function": - return type.toLowerCase(); - } - if ( typeof obj === "object" ) { - return "object"; - } - return undefined; - }, - - push: function( result, actual, expected, message ) { - if ( !config.current ) { - throw new Error( "assertion outside test context, was " + sourceFromStacktrace() ); - } - - var output, source, - details = { - result: result, - message: message, - actual: actual, - expected: expected - }; - - message = escapeInnerText( message ) || ( result ? "okay" : "failed" ); - message = "" + message + ""; - output = message; - - if ( !result ) { - expected = escapeInnerText( QUnit.jsDump.parse(expected) ); - actual = escapeInnerText( QUnit.jsDump.parse(actual) ); - output += ""; - - if ( actual != expected ) { - output += ""; - output += ""; - } - - source = sourceFromStacktrace(); - - if ( source ) { - details.source = source; - output += ""; - } - - output += "
    Expected:
    " + expected + "
    Result:
    " + actual + "
    Diff:
    " + QUnit.diff( expected, actual ) + "
    Source:
    " + escapeInnerText( source ) + "
    "; - } - - runLoggingCallbacks( "log", QUnit, details ); - - config.current.assertions.push({ - result: !!result, - message: output - }); - }, - - pushFailure: function( message, source, actual ) { - if ( !config.current ) { - throw new Error( "pushFailure() assertion outside test context, was " + sourceFromStacktrace(2) ); - } - - var output, - details = { - result: false, - message: message - }; - - message = escapeInnerText( message ) || "error"; - message = "" + message + ""; - output = message; - - output += ""; - - if ( actual ) { - output += ""; - } - - if ( source ) { - details.source = source; - output += ""; - } - - output += "
    Result:
    " + escapeInnerText( actual ) + "
    Source:
    " + escapeInnerText( source ) + "
    "; - - runLoggingCallbacks( "log", QUnit, details ); - - config.current.assertions.push({ - result: false, - message: output - }); - }, - - url: function( params ) { - params = extend( extend( {}, QUnit.urlParams ), params ); - var key, - querystring = "?"; - - for ( key in params ) { - if ( !hasOwn.call( params, key ) ) { - continue; - } - querystring += encodeURIComponent( key ) + "=" + - encodeURIComponent( params[ key ] ) + "&"; - } - return window.location.pathname + querystring.slice( 0, -1 ); - }, - - extend: extend, - id: id, - addEvent: addEvent - // load, equiv, jsDump, diff: Attached later -}); - -/** - * @deprecated: Created for backwards compatibility with test runner that set the hook function - * into QUnit.{hook}, instead of invoking it and passing the hook function. - * QUnit.constructor is set to the empty F() above so that we can add to it's prototype here. - * Doing this allows us to tell if the following methods have been overwritten on the actual - * QUnit object. - */ -extend( QUnit.constructor.prototype, { - - // Logging callbacks; all receive a single argument with the listed properties - // run test/logs.html for any related changes - begin: registerLoggingCallback( "begin" ), - - // done: { failed, passed, total, runtime } - done: registerLoggingCallback( "done" ), - - // log: { result, actual, expected, message } - log: registerLoggingCallback( "log" ), - - // testStart: { name } - testStart: registerLoggingCallback( "testStart" ), - - // testDone: { name, failed, passed, total } - testDone: registerLoggingCallback( "testDone" ), - - // moduleStart: { name } - moduleStart: registerLoggingCallback( "moduleStart" ), - - // moduleDone: { name, failed, passed, total } - moduleDone: registerLoggingCallback( "moduleDone" ) -}); - -if ( typeof document === "undefined" || document.readyState === "complete" ) { - config.autorun = true; -} - -QUnit.load = function() { - runLoggingCallbacks( "begin", QUnit, {} ); - - // Initialize the config, saving the execution queue - var banner, filter, i, label, len, main, ol, toolbar, userAgent, val, urlConfigCheckboxes, - urlConfigHtml = "", - oldconfig = extend( {}, config ); - - QUnit.init(); - extend(config, oldconfig); - - config.blocking = false; - - len = config.urlConfig.length; - - for ( i = 0; i < len; i++ ) { - val = config.urlConfig[i]; - if ( typeof val === "string" ) { - val = { - id: val, - label: val, - tooltip: "[no tooltip available]" - }; - } - config[ val.id ] = QUnit.urlParams[ val.id ]; - urlConfigHtml += ""; - } - - // `userAgent` initialized at top of scope - userAgent = id( "qunit-userAgent" ); - if ( userAgent ) { - userAgent.innerHTML = navigator.userAgent; - } - - // `banner` initialized at top of scope - banner = id( "qunit-header" ); - if ( banner ) { - banner.innerHTML = "" + banner.innerHTML + " "; - } - - // `toolbar` initialized at top of scope - toolbar = id( "qunit-testrunner-toolbar" ); - if ( toolbar ) { - // `filter` initialized at top of scope - filter = document.createElement( "input" ); - filter.type = "checkbox"; - filter.id = "qunit-filter-pass"; - - addEvent( filter, "click", function() { - var tmp, - ol = document.getElementById( "qunit-tests" ); - - if ( filter.checked ) { - ol.className = ol.className + " hidepass"; - } else { - tmp = " " + ol.className.replace( /[\n\t\r]/g, " " ) + " "; - ol.className = tmp.replace( / hidepass /, " " ); - } - if ( defined.sessionStorage ) { - if (filter.checked) { - sessionStorage.setItem( "qunit-filter-passed-tests", "true" ); - } else { - sessionStorage.removeItem( "qunit-filter-passed-tests" ); - } - } - }); - - if ( config.hidepassed || defined.sessionStorage && sessionStorage.getItem( "qunit-filter-passed-tests" ) ) { - filter.checked = true; - // `ol` initialized at top of scope - ol = document.getElementById( "qunit-tests" ); - ol.className = ol.className + " hidepass"; - } - toolbar.appendChild( filter ); - - // `label` initialized at top of scope - label = document.createElement( "label" ); - label.setAttribute( "for", "qunit-filter-pass" ); - label.setAttribute( "title", "Only show tests and assertons that fail. Stored in sessionStorage." ); - label.innerHTML = "Hide passed tests"; - toolbar.appendChild( label ); - - urlConfigCheckboxes = document.createElement( 'span' ); - urlConfigCheckboxes.innerHTML = urlConfigHtml; - addEvent( urlConfigCheckboxes, "change", function( event ) { - var params = {}; - params[ event.target.name ] = event.target.checked ? true : undefined; - window.location = QUnit.url( params ); - }); - toolbar.appendChild( urlConfigCheckboxes ); - } - - // `main` initialized at top of scope - main = id( "qunit-fixture" ); - if ( main ) { - config.fixture = main.innerHTML; - } - - if ( config.autostart ) { - QUnit.start(); - } -}; - -addEvent( window, "load", QUnit.load ); - -// `onErrorFnPrev` initialized at top of scope -// Preserve other handlers -onErrorFnPrev = window.onerror; - -// Cover uncaught exceptions -// Returning true will surpress the default browser handler, -// returning false will let it run. -window.onerror = function ( error, filePath, linerNr ) { - var ret = false; - if ( onErrorFnPrev ) { - ret = onErrorFnPrev( error, filePath, linerNr ); - } - - // Treat return value as window.onerror itself does, - // Only do our handling if not surpressed. - if ( ret !== true ) { - if ( QUnit.config.current ) { - if ( QUnit.config.current.ignoreGlobalErrors ) { - return true; - } - QUnit.pushFailure( error, filePath + ":" + linerNr ); - } else { - QUnit.test( "global failure", function() { - QUnit.pushFailure( error, filePath + ":" + linerNr ); - }); - } - return false; - } - - return ret; -}; - -function done() { - config.autorun = true; - - // Log the last module results - if ( config.currentModule ) { - runLoggingCallbacks( "moduleDone", QUnit, { - name: config.currentModule, - failed: config.moduleStats.bad, - passed: config.moduleStats.all - config.moduleStats.bad, - total: config.moduleStats.all - }); - } - - var i, key, - banner = id( "qunit-banner" ), - tests = id( "qunit-tests" ), - runtime = +new Date() - config.started, - passed = config.stats.all - config.stats.bad, - html = [ - "Tests completed in ", - runtime, - " milliseconds.
    ", - "", - passed, - " tests of ", - config.stats.all, - " passed, ", - config.stats.bad, - " failed." - ].join( "" ); - - if ( banner ) { - banner.className = ( config.stats.bad ? "qunit-fail" : "qunit-pass" ); - } - - if ( tests ) { - id( "qunit-testresult" ).innerHTML = html; - } - - if ( config.altertitle && typeof document !== "undefined" && document.title ) { - // show ✖ for good, ✔ for bad suite result in title - // use escape sequences in case file gets loaded with non-utf-8-charset - document.title = [ - ( config.stats.bad ? "\u2716" : "\u2714" ), - document.title.replace( /^[\u2714\u2716] /i, "" ) - ].join( " " ); - } - - // clear own sessionStorage items if all tests passed - if ( config.reorder && defined.sessionStorage && config.stats.bad === 0 ) { - // `key` & `i` initialized at top of scope - for ( i = 0; i < sessionStorage.length; i++ ) { - key = sessionStorage.key( i++ ); - if ( key.indexOf( "qunit-test-" ) === 0 ) { - sessionStorage.removeItem( key ); - } - } - } - - runLoggingCallbacks( "done", QUnit, { - failed: config.stats.bad, - passed: passed, - total: config.stats.all, - runtime: runtime - }); -} - -/** @return Boolean: true if this test should be ran */ -function validTest( test ) { - var include, - filter = config.filter && config.filter.toLowerCase(), - module = config.module && config.module.toLowerCase(), - fullName = (test.module + ": " + test.testName).toLowerCase(); - - if ( config.testNumber ) { - return test.testNumber === config.testNumber; - } - - if ( module && ( !test.module || test.module.toLowerCase() !== module ) ) { - return false; - } - - if ( !filter ) { - return true; - } - - include = filter.charAt( 0 ) !== "!"; - if ( !include ) { - filter = filter.slice( 1 ); - } - - // If the filter matches, we need to honour include - if ( fullName.indexOf( filter ) !== -1 ) { - return include; - } - - // Otherwise, do the opposite - return !include; -} - -// so far supports only Firefox, Chrome and Opera (buggy), Safari (for real exceptions) -// Later Safari and IE10 are supposed to support error.stack as well -// See also https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error/Stack -function extractStacktrace( e, offset ) { - offset = offset === undefined ? 3 : offset; - - var stack, include, i, regex; - - if ( e.stacktrace ) { - // Opera - return e.stacktrace.split( "\n" )[ offset + 3 ]; - } else if ( e.stack ) { - // Firefox, Chrome - stack = e.stack.split( "\n" ); - if (/^error$/i.test( stack[0] ) ) { - stack.shift(); - } - if ( fileName ) { - include = []; - for ( i = offset; i < stack.length; i++ ) { - if ( stack[ i ].indexOf( fileName ) != -1 ) { - break; - } - include.push( stack[ i ] ); - } - if ( include.length ) { - return include.join( "\n" ); - } - } - return stack[ offset ]; - } else if ( e.sourceURL ) { - // Safari, PhantomJS - // hopefully one day Safari provides actual stacktraces - // exclude useless self-reference for generated Error objects - if ( /qunit.js$/.test( e.sourceURL ) ) { - return; - } - // for actual exceptions, this is useful - return e.sourceURL + ":" + e.line; - } -} -function sourceFromStacktrace( offset ) { - try { - throw new Error(); - } catch ( e ) { - return extractStacktrace( e, offset ); - } -} - -function escapeInnerText( s ) { - if ( !s ) { - return ""; - } - s = s + ""; - return s.replace( /[\&<>]/g, function( s ) { - switch( s ) { - case "&": return "&"; - case "<": return "<"; - case ">": return ">"; - default: return s; - } - }); -} - -function synchronize( callback, last ) { - config.queue.push( callback ); - - if ( config.autorun && !config.blocking ) { - process( last ); - } -} - -function process( last ) { - function next() { - process( last ); - } - var start = new Date().getTime(); - config.depth = config.depth ? config.depth + 1 : 1; - - while ( config.queue.length && !config.blocking ) { - if ( !defined.setTimeout || config.updateRate <= 0 || ( ( new Date().getTime() - start ) < config.updateRate ) ) { - config.queue.shift()(); - } else { - window.setTimeout( next, 13 ); - break; - } - } - config.depth--; - if ( last && !config.blocking && !config.queue.length && config.depth === 0 ) { - done(); - } -} - -function saveGlobal() { - config.pollution = []; - - if ( config.noglobals ) { - for ( var key in window ) { - // in Opera sometimes DOM element ids show up here, ignore them - if ( !hasOwn.call( window, key ) || /^qunit-test-output/.test( key ) ) { - continue; - } - config.pollution.push( key ); - } - } -} - -function checkPollution( name ) { - var newGlobals, - deletedGlobals, - old = config.pollution; - - saveGlobal(); - - newGlobals = diff( config.pollution, old ); - if ( newGlobals.length > 0 ) { - QUnit.pushFailure( "Introduced global variable(s): " + newGlobals.join(", ") ); - } - - deletedGlobals = diff( old, config.pollution ); - if ( deletedGlobals.length > 0 ) { - QUnit.pushFailure( "Deleted global variable(s): " + deletedGlobals.join(", ") ); - } -} - -// returns a new Array with the elements that are in a but not in b -function diff( a, b ) { - var i, j, - result = a.slice(); - - for ( i = 0; i < result.length; i++ ) { - for ( j = 0; j < b.length; j++ ) { - if ( result[i] === b[j] ) { - result.splice( i, 1 ); - i--; - break; - } - } - } - return result; -} - -function extend( a, b ) { - for ( var prop in b ) { - if ( b[ prop ] === undefined ) { - delete a[ prop ]; - - // Avoid "Member not found" error in IE8 caused by setting window.constructor - } else if ( prop !== "constructor" || a !== window ) { - a[ prop ] = b[ prop ]; - } - } - - return a; -} - -function addEvent( elem, type, fn ) { - if ( elem.addEventListener ) { - elem.addEventListener( type, fn, false ); - } else if ( elem.attachEvent ) { - elem.attachEvent( "on" + type, fn ); - } else { - fn(); - } -} - -function id( name ) { - return !!( typeof document !== "undefined" && document && document.getElementById ) && - document.getElementById( name ); -} - -function registerLoggingCallback( key ) { - return function( callback ) { - config[key].push( callback ); - }; -} - -// Supports deprecated method of completely overwriting logging callbacks -function runLoggingCallbacks( key, scope, args ) { - //debugger; - var i, callbacks; - if ( QUnit.hasOwnProperty( key ) ) { - QUnit[ key ].call(scope, args ); - } else { - callbacks = config[ key ]; - for ( i = 0; i < callbacks.length; i++ ) { - callbacks[ i ].call( scope, args ); - } - } -} - -// Test for equality any JavaScript type. -// Author: Philippe Rathé -QUnit.equiv = (function() { - - // Call the o related callback with the given arguments. - function bindCallbacks( o, callbacks, args ) { - var prop = QUnit.objectType( o ); - if ( prop ) { - if ( QUnit.objectType( callbacks[ prop ] ) === "function" ) { - return callbacks[ prop ].apply( callbacks, args ); - } else { - return callbacks[ prop ]; // or undefined - } - } - } - - // the real equiv function - var innerEquiv, - // stack to decide between skip/abort functions - callers = [], - // stack to avoiding loops from circular referencing - parents = [], - - getProto = Object.getPrototypeOf || function ( obj ) { - return obj.__proto__; - }, - callbacks = (function () { - - // for string, boolean, number and null - function useStrictEquality( b, a ) { - if ( b instanceof a.constructor || a instanceof b.constructor ) { - // to catch short annotaion VS 'new' annotation of a - // declaration - // e.g. var i = 1; - // var j = new Number(1); - return a == b; - } else { - return a === b; - } - } - - return { - "string": useStrictEquality, - "boolean": useStrictEquality, - "number": useStrictEquality, - "null": useStrictEquality, - "undefined": useStrictEquality, - - "nan": function( b ) { - return isNaN( b ); - }, - - "date": function( b, a ) { - return QUnit.objectType( b ) === "date" && a.valueOf() === b.valueOf(); - }, - - "regexp": function( b, a ) { - return QUnit.objectType( b ) === "regexp" && - // the regex itself - a.source === b.source && - // and its modifers - a.global === b.global && - // (gmi) ... - a.ignoreCase === b.ignoreCase && - a.multiline === b.multiline; - }, - - // - skip when the property is a method of an instance (OOP) - // - abort otherwise, - // initial === would have catch identical references anyway - "function": function() { - var caller = callers[callers.length - 1]; - return caller !== Object && typeof caller !== "undefined"; - }, - - "array": function( b, a ) { - var i, j, len, loop; - - // b could be an object literal here - if ( QUnit.objectType( b ) !== "array" ) { - return false; - } - - len = a.length; - if ( len !== b.length ) { - // safe and faster - return false; - } - - // track reference to avoid circular references - parents.push( a ); - for ( i = 0; i < len; i++ ) { - loop = false; - for ( j = 0; j < parents.length; j++ ) { - if ( parents[j] === a[i] ) { - loop = true;// dont rewalk array - } - } - if ( !loop && !innerEquiv(a[i], b[i]) ) { - parents.pop(); - return false; - } - } - parents.pop(); - return true; - }, - - "object": function( b, a ) { - var i, j, loop, - // Default to true - eq = true, - aProperties = [], - bProperties = []; - - // comparing constructors is more strict than using - // instanceof - if ( a.constructor !== b.constructor ) { - // Allow objects with no prototype to be equivalent to - // objects with Object as their constructor. - if ( !(( getProto(a) === null && getProto(b) === Object.prototype ) || - ( getProto(b) === null && getProto(a) === Object.prototype ) ) ) { - return false; - } - } - - // stack constructor before traversing properties - callers.push( a.constructor ); - // track reference to avoid circular references - parents.push( a ); - - for ( i in a ) { // be strict: don't ensures hasOwnProperty - // and go deep - loop = false; - for ( j = 0; j < parents.length; j++ ) { - if ( parents[j] === a[i] ) { - // don't go down the same path twice - loop = true; - } - } - aProperties.push(i); // collect a's properties - - if (!loop && !innerEquiv( a[i], b[i] ) ) { - eq = false; - break; - } - } - - callers.pop(); // unstack, we are done - parents.pop(); - - for ( i in b ) { - bProperties.push( i ); // collect b's properties - } - - // Ensures identical properties name - return eq && innerEquiv( aProperties.sort(), bProperties.sort() ); - } - }; - }()); - - innerEquiv = function() { // can take multiple arguments - var args = [].slice.apply( arguments ); - if ( args.length < 2 ) { - return true; // end transition - } - - return (function( a, b ) { - if ( a === b ) { - return true; // catch the most you can - } else if ( a === null || b === null || typeof a === "undefined" || - typeof b === "undefined" || - QUnit.objectType(a) !== QUnit.objectType(b) ) { - return false; // don't lose time with error prone cases - } else { - return bindCallbacks(a, callbacks, [ b, a ]); - } - - // apply transition with (1..n) arguments - }( args[0], args[1] ) && arguments.callee.apply( this, args.splice(1, args.length - 1 )) ); - }; - - return innerEquiv; -}()); - -/** - * jsDump Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com | - * http://flesler.blogspot.com Licensed under BSD - * (http://www.opensource.org/licenses/bsd-license.php) Date: 5/15/2008 - * - * @projectDescription Advanced and extensible data dumping for Javascript. - * @version 1.0.0 - * @author Ariel Flesler - * @link {http://flesler.blogspot.com/2008/05/jsdump-pretty-dump-of-any-javascript.html} - */ -QUnit.jsDump = (function() { - function quote( str ) { - return '"' + str.toString().replace( /"/g, '\\"' ) + '"'; - } - function literal( o ) { - return o + ""; - } - function join( pre, arr, post ) { - var s = jsDump.separator(), - base = jsDump.indent(), - inner = jsDump.indent(1); - if ( arr.join ) { - arr = arr.join( "," + s + inner ); - } - if ( !arr ) { - return pre + post; - } - return [ pre, inner + arr, base + post ].join(s); - } - function array( arr, stack ) { - var i = arr.length, ret = new Array(i); - this.up(); - while ( i-- ) { - ret[i] = this.parse( arr[i] , undefined , stack); - } - this.down(); - return join( "[", ret, "]" ); - } - - var reName = /^function (\w+)/, - jsDump = { - parse: function( obj, type, stack ) { //type is used mostly internally, you can fix a (custom)type in advance - stack = stack || [ ]; - var inStack, res, - parser = this.parsers[ type || this.typeOf(obj) ]; - - type = typeof parser; - inStack = inArray( obj, stack ); - - if ( inStack != -1 ) { - return "recursion(" + (inStack - stack.length) + ")"; - } - //else - if ( type == "function" ) { - stack.push( obj ); - res = parser.call( this, obj, stack ); - stack.pop(); - return res; - } - // else - return ( type == "string" ) ? parser : this.parsers.error; - }, - typeOf: function( obj ) { - var type; - if ( obj === null ) { - type = "null"; - } else if ( typeof obj === "undefined" ) { - type = "undefined"; - } else if ( QUnit.is( "regexp", obj) ) { - type = "regexp"; - } else if ( QUnit.is( "date", obj) ) { - type = "date"; - } else if ( QUnit.is( "function", obj) ) { - type = "function"; - } else if ( typeof obj.setInterval !== undefined && typeof obj.document !== "undefined" && typeof obj.nodeType === "undefined" ) { - type = "window"; - } else if ( obj.nodeType === 9 ) { - type = "document"; - } else if ( obj.nodeType ) { - type = "node"; - } else if ( - // native arrays - toString.call( obj ) === "[object Array]" || - // NodeList objects - ( typeof obj.length === "number" && typeof obj.item !== "undefined" && ( obj.length ? obj.item(0) === obj[0] : ( obj.item( 0 ) === null && typeof obj[0] === "undefined" ) ) ) - ) { - type = "array"; - } else { - type = typeof obj; - } - return type; - }, - separator: function() { - return this.multiline ? this.HTML ? "
    " : "\n" : this.HTML ? " " : " "; - }, - indent: function( extra ) {// extra can be a number, shortcut for increasing-calling-decreasing - if ( !this.multiline ) { - return ""; - } - var chr = this.indentChar; - if ( this.HTML ) { - chr = chr.replace( /\t/g, " " ).replace( / /g, " " ); - } - return new Array( this._depth_ + (extra||0) ).join(chr); - }, - up: function( a ) { - this._depth_ += a || 1; - }, - down: function( a ) { - this._depth_ -= a || 1; - }, - setParser: function( name, parser ) { - this.parsers[name] = parser; - }, - // The next 3 are exposed so you can use them - quote: quote, - literal: literal, - join: join, - // - _depth_: 1, - // This is the list of parsers, to modify them, use jsDump.setParser - parsers: { - window: "[Window]", - document: "[Document]", - error: "[ERROR]", //when no parser is found, shouldn"t happen - unknown: "[Unknown]", - "null": "null", - "undefined": "undefined", - "function": function( fn ) { - var ret = "function", - name = "name" in fn ? fn.name : (reName.exec(fn) || [])[1];//functions never have name in IE - - if ( name ) { - ret += " " + name; - } - ret += "( "; - - ret = [ ret, QUnit.jsDump.parse( fn, "functionArgs" ), "){" ].join( "" ); - return join( ret, QUnit.jsDump.parse(fn,"functionCode" ), "}" ); - }, - array: array, - nodelist: array, - "arguments": array, - object: function( map, stack ) { - var ret = [ ], keys, key, val, i; - QUnit.jsDump.up(); - if ( Object.keys ) { - keys = Object.keys( map ); - } else { - keys = []; - for ( key in map ) { - keys.push( key ); - } - } - keys.sort(); - for ( i = 0; i < keys.length; i++ ) { - key = keys[ i ]; - val = map[ key ]; - ret.push( QUnit.jsDump.parse( key, "key" ) + ": " + QUnit.jsDump.parse( val, undefined, stack ) ); - } - QUnit.jsDump.down(); - return join( "{", ret, "}" ); - }, - node: function( node ) { - var a, val, - open = QUnit.jsDump.HTML ? "<" : "<", - close = QUnit.jsDump.HTML ? ">" : ">", - tag = node.nodeName.toLowerCase(), - ret = open + tag; - - for ( a in QUnit.jsDump.DOMAttrs ) { - val = node[ QUnit.jsDump.DOMAttrs[a] ]; - if ( val ) { - ret += " " + a + "=" + QUnit.jsDump.parse( val, "attribute" ); - } - } - return ret + close + open + "/" + tag + close; - }, - functionArgs: function( fn ) {//function calls it internally, it's the arguments part of the function - var args, - l = fn.length; - - if ( !l ) { - return ""; - } - - args = new Array(l); - while ( l-- ) { - args[l] = String.fromCharCode(97+l);//97 is 'a' - } - return " " + args.join( ", " ) + " "; - }, - key: quote, //object calls it internally, the key part of an item in a map - functionCode: "[code]", //function calls it internally, it's the content of the function - attribute: quote, //node calls it internally, it's an html attribute value - string: quote, - date: quote, - regexp: literal, //regex - number: literal, - "boolean": literal - }, - DOMAttrs: { - //attributes to dump from nodes, name=>realName - id: "id", - name: "name", - "class": "className" - }, - HTML: false,//if true, entities are escaped ( <, >, \t, space and \n ) - indentChar: " ",//indentation unit - multiline: true //if true, items in a collection, are separated by a \n, else just a space. - }; - - return jsDump; -}()); - -// from Sizzle.js -function getText( elems ) { - var i, elem, - ret = ""; - - for ( i = 0; elems[i]; i++ ) { - elem = elems[i]; - - // Get the text from text nodes and CDATA nodes - if ( elem.nodeType === 3 || elem.nodeType === 4 ) { - ret += elem.nodeValue; - - // Traverse everything else, except comment nodes - } else if ( elem.nodeType !== 8 ) { - ret += getText( elem.childNodes ); - } - } - - return ret; -} - -// from jquery.js -function inArray( elem, array ) { - if ( array.indexOf ) { - return array.indexOf( elem ); - } - - for ( var i = 0, length = array.length; i < length; i++ ) { - if ( array[ i ] === elem ) { - return i; - } - } - - return -1; -} - -/* - * Javascript Diff Algorithm - * By John Resig (http://ejohn.org/) - * Modified by Chu Alan "sprite" - * - * Released under the MIT license. - * - * More Info: - * http://ejohn.org/projects/javascript-diff-algorithm/ - * - * Usage: QUnit.diff(expected, actual) - * - * QUnit.diff( "the quick brown fox jumped over", "the quick fox jumps over" ) == "the quick brown fox jumped jumps over" - */ -QUnit.diff = (function() { - function diff( o, n ) { - var i, - ns = {}, - os = {}; - - for ( i = 0; i < n.length; i++ ) { - if ( ns[ n[i] ] == null ) { - ns[ n[i] ] = { - rows: [], - o: null - }; - } - ns[ n[i] ].rows.push( i ); - } - - for ( i = 0; i < o.length; i++ ) { - if ( os[ o[i] ] == null ) { - os[ o[i] ] = { - rows: [], - n: null - }; - } - os[ o[i] ].rows.push( i ); - } - - for ( i in ns ) { - if ( !hasOwn.call( ns, i ) ) { - continue; - } - if ( ns[i].rows.length == 1 && typeof os[i] != "undefined" && os[i].rows.length == 1 ) { - n[ ns[i].rows[0] ] = { - text: n[ ns[i].rows[0] ], - row: os[i].rows[0] - }; - o[ os[i].rows[0] ] = { - text: o[ os[i].rows[0] ], - row: ns[i].rows[0] - }; - } - } - - for ( i = 0; i < n.length - 1; i++ ) { - if ( n[i].text != null && n[ i + 1 ].text == null && n[i].row + 1 < o.length && o[ n[i].row + 1 ].text == null && - n[ i + 1 ] == o[ n[i].row + 1 ] ) { - - n[ i + 1 ] = { - text: n[ i + 1 ], - row: n[i].row + 1 - }; - o[ n[i].row + 1 ] = { - text: o[ n[i].row + 1 ], - row: i + 1 - }; - } - } - - for ( i = n.length - 1; i > 0; i-- ) { - if ( n[i].text != null && n[ i - 1 ].text == null && n[i].row > 0 && o[ n[i].row - 1 ].text == null && - n[ i - 1 ] == o[ n[i].row - 1 ]) { - - n[ i - 1 ] = { - text: n[ i - 1 ], - row: n[i].row - 1 - }; - o[ n[i].row - 1 ] = { - text: o[ n[i].row - 1 ], - row: i - 1 - }; - } - } - - return { - o: o, - n: n - }; - } - - return function( o, n ) { - o = o.replace( /\s+$/, "" ); - n = n.replace( /\s+$/, "" ); - - var i, pre, - str = "", - out = diff( o === "" ? [] : o.split(/\s+/), n === "" ? [] : n.split(/\s+/) ), - oSpace = o.match(/\s+/g), - nSpace = n.match(/\s+/g); - - if ( oSpace == null ) { - oSpace = [ " " ]; - } - else { - oSpace.push( " " ); - } - - if ( nSpace == null ) { - nSpace = [ " " ]; - } - else { - nSpace.push( " " ); - } - - if ( out.n.length === 0 ) { - for ( i = 0; i < out.o.length; i++ ) { - str += "" + out.o[i] + oSpace[i] + ""; - } - } - else { - if ( out.n[0].text == null ) { - for ( n = 0; n < out.o.length && out.o[n].text == null; n++ ) { - str += "" + out.o[n] + oSpace[n] + ""; - } - } - - for ( i = 0; i < out.n.length; i++ ) { - if (out.n[i].text == null) { - str += "" + out.n[i] + nSpace[i] + ""; - } - else { - // `pre` initialized at top of scope - pre = ""; - - for ( n = out.n[i].row + 1; n < out.o.length && out.o[n].text == null; n++ ) { - pre += "" + out.o[n] + oSpace[n] + ""; - } - str += " " + out.n[i].text + nSpace[i] + pre; - } - } - } - - return str; - }; -}()); - -// for CommonJS enviroments, export everything -if ( typeof exports !== "undefined" ) { - extend(exports, QUnit); -} - -// get at whatever the global object is, like window in browsers -}( (function() {return this;}.call()) )); diff --git a/tests/qunit/node_modules/qunit/support/qunit/test/deepEqual.js b/tests/qunit/node_modules/qunit/support/qunit/test/deepEqual.js deleted file mode 100644 index f31d283..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/test/deepEqual.js +++ /dev/null @@ -1,1432 +0,0 @@ -module("equiv"); - - -test("Primitive types and constants", function () { - equal(QUnit.equiv(null, null), true, "null"); - equal(QUnit.equiv(null, {}), false, "null"); - equal(QUnit.equiv(null, undefined), false, "null"); - equal(QUnit.equiv(null, 0), false, "null"); - equal(QUnit.equiv(null, false), false, "null"); - equal(QUnit.equiv(null, ''), false, "null"); - equal(QUnit.equiv(null, []), false, "null"); - - equal(QUnit.equiv(undefined, undefined), true, "undefined"); - equal(QUnit.equiv(undefined, null), false, "undefined"); - equal(QUnit.equiv(undefined, 0), false, "undefined"); - equal(QUnit.equiv(undefined, false), false, "undefined"); - equal(QUnit.equiv(undefined, {}), false, "undefined"); - equal(QUnit.equiv(undefined, []), false, "undefined"); - equal(QUnit.equiv(undefined, ""), false, "undefined"); - - // Nan usually doest not equal to Nan using the '==' operator. - // Only isNaN() is able to do it. - equal(QUnit.equiv(0/0, 0/0), true, "NaN"); // NaN VS NaN - equal(QUnit.equiv(1/0, 2/0), true, "Infinity"); // Infinity VS Infinity - equal(QUnit.equiv(-1/0, 2/0), false, "-Infinity, Infinity"); // -Infinity VS Infinity - equal(QUnit.equiv(-1/0, -2/0), true, "-Infinity, -Infinity"); // -Infinity VS -Infinity - equal(QUnit.equiv(0/0, 1/0), false, "NaN, Infinity"); // Nan VS Infinity - equal(QUnit.equiv(1/0, 0/0), false, "NaN, Infinity"); // Nan VS Infinity - equal(QUnit.equiv(0/0, null), false, "NaN"); - equal(QUnit.equiv(0/0, undefined), false, "NaN"); - equal(QUnit.equiv(0/0, 0), false, "NaN"); - equal(QUnit.equiv(0/0, false), false, "NaN"); - equal(QUnit.equiv(0/0, function () {}), false, "NaN"); - equal(QUnit.equiv(1/0, null), false, "NaN, Infinity"); - equal(QUnit.equiv(1/0, undefined), false, "NaN, Infinity"); - equal(QUnit.equiv(1/0, 0), false, "NaN, Infinity"); - equal(QUnit.equiv(1/0, 1), false, "NaN, Infinity"); - equal(QUnit.equiv(1/0, false), false, "NaN, Infinity"); - equal(QUnit.equiv(1/0, true), false, "NaN, Infinity"); - equal(QUnit.equiv(1/0, function () {}), false, "NaN, Infinity"); - - equal(QUnit.equiv(0, 0), true, "number"); - equal(QUnit.equiv(0, 1), false, "number"); - equal(QUnit.equiv(1, 0), false, "number"); - equal(QUnit.equiv(1, 1), true, "number"); - equal(QUnit.equiv(1.1, 1.1), true, "number"); - equal(QUnit.equiv(0.0000005, 0.0000005), true, "number"); - equal(QUnit.equiv(0, ''), false, "number"); - equal(QUnit.equiv(0, '0'), false, "number"); - equal(QUnit.equiv(1, '1'), false, "number"); - equal(QUnit.equiv(0, false), false, "number"); - equal(QUnit.equiv(1, true), false, "number"); - - equal(QUnit.equiv(true, true), true, "boolean"); - equal(QUnit.equiv(true, false), false, "boolean"); - equal(QUnit.equiv(false, true), false, "boolean"); - equal(QUnit.equiv(false, 0), false, "boolean"); - equal(QUnit.equiv(false, null), false, "boolean"); - equal(QUnit.equiv(false, undefined), false, "boolean"); - equal(QUnit.equiv(true, 1), false, "boolean"); - equal(QUnit.equiv(true, null), false, "boolean"); - equal(QUnit.equiv(true, undefined), false, "boolean"); - - equal(QUnit.equiv('', ''), true, "string"); - equal(QUnit.equiv('a', 'a'), true, "string"); - equal(QUnit.equiv("foobar", "foobar"), true, "string"); - equal(QUnit.equiv("foobar", "foo"), false, "string"); - equal(QUnit.equiv('', 0), false, "string"); - equal(QUnit.equiv('', false), false, "string"); - equal(QUnit.equiv('', null), false, "string"); - equal(QUnit.equiv('', undefined), false, "string"); - - // Short annotation VS new annotation - equal(QUnit.equiv(0, new Number()), true, "short annotation VS new annotation"); - equal(QUnit.equiv(new Number(), 0), true, "short annotation VS new annotation"); - equal(QUnit.equiv(1, new Number(1)), true, "short annotation VS new annotation"); - equal(QUnit.equiv(new Number(1), 1), true, "short annotation VS new annotation"); - equal(QUnit.equiv(new Number(0), 1), false, "short annotation VS new annotation"); - equal(QUnit.equiv(0, new Number(1)), false, "short annotation VS new annotation"); - - equal(QUnit.equiv(new String(), ""), true, "short annotation VS new annotation"); - equal(QUnit.equiv("", new String()), true, "short annotation VS new annotation"); - equal(QUnit.equiv(new String("My String"), "My String"), true, "short annotation VS new annotation"); - equal(QUnit.equiv("My String", new String("My String")), true, "short annotation VS new annotation"); - equal(QUnit.equiv("Bad String", new String("My String")), false, "short annotation VS new annotation"); - equal(QUnit.equiv(new String("Bad String"), "My String"), false, "short annotation VS new annotation"); - - equal(QUnit.equiv(false, new Boolean()), true, "short annotation VS new annotation"); - equal(QUnit.equiv(new Boolean(), false), true, "short annotation VS new annotation"); - equal(QUnit.equiv(true, new Boolean(true)), true, "short annotation VS new annotation"); - equal(QUnit.equiv(new Boolean(true), true), true, "short annotation VS new annotation"); - equal(QUnit.equiv(true, new Boolean(1)), true, "short annotation VS new annotation"); - equal(QUnit.equiv(false, new Boolean(false)), true, "short annotation VS new annotation"); - equal(QUnit.equiv(new Boolean(false), false), true, "short annotation VS new annotation"); - equal(QUnit.equiv(false, new Boolean(0)), true, "short annotation VS new annotation"); - equal(QUnit.equiv(true, new Boolean(false)), false, "short annotation VS new annotation"); - equal(QUnit.equiv(new Boolean(false), true), false, "short annotation VS new annotation"); - - equal(QUnit.equiv(new Object(), {}), true, "short annotation VS new annotation"); - equal(QUnit.equiv({}, new Object()), true, "short annotation VS new annotation"); - equal(QUnit.equiv(new Object(), {a:1}), false, "short annotation VS new annotation"); - equal(QUnit.equiv({a:1}, new Object()), false, "short annotation VS new annotation"); - equal(QUnit.equiv({a:undefined}, new Object()), false, "short annotation VS new annotation"); - equal(QUnit.equiv(new Object(), {a:undefined}), false, "short annotation VS new annotation"); -}); - -test("Objects Basics.", function() { - equal(QUnit.equiv({}, {}), true); - equal(QUnit.equiv({}, null), false); - equal(QUnit.equiv({}, undefined), false); - equal(QUnit.equiv({}, 0), false); - equal(QUnit.equiv({}, false), false); - - // This test is a hard one, it is very important - // REASONS: - // 1) They are of the same type "object" - // 2) [] instanceof Object is true - // 3) Their properties are the same (doesn't exists) - equal(QUnit.equiv({}, []), false); - - equal(QUnit.equiv({a:1}, {a:1}), true); - equal(QUnit.equiv({a:1}, {a:"1"}), false); - equal(QUnit.equiv({a:[]}, {a:[]}), true); - equal(QUnit.equiv({a:{}}, {a:null}), false); - equal(QUnit.equiv({a:1}, {}), false); - equal(QUnit.equiv({}, {a:1}), false); - - // Hard ones - equal(QUnit.equiv({a:undefined}, {}), false); - equal(QUnit.equiv({}, {a:undefined}), false); - equal(QUnit.equiv( - { - a: [{ bar: undefined }] - }, - { - a: [{ bat: undefined }] - } - ), false); - - // Objects with no prototype, created via Object.create(null), are used e.g. as dictionaries. - // Being able to test equivalence against object literals is quite useful. - if (typeof Object.create === 'function') { - equal(QUnit.equiv(Object.create(null), {}), true, "empty object without prototype VS empty object"); - - var nonEmptyWithNoProto = Object.create(null); - nonEmptyWithNoProto.foo = "bar"; - - equal(QUnit.equiv(nonEmptyWithNoProto, { foo: "bar" }), true, "object without prototype VS object"); - } -}); - - -test("Arrays Basics.", function() { - - equal(QUnit.equiv([], []), true); - - // May be a hard one, can invoke a crash at execution. - // because their types are both "object" but null isn't - // like a true object, it doesn't have any property at all. - equal(QUnit.equiv([], null), false); - - equal(QUnit.equiv([], undefined), false); - equal(QUnit.equiv([], false), false); - equal(QUnit.equiv([], 0), false); - equal(QUnit.equiv([], ""), false); - - // May be a hard one, but less hard - // than {} with [] (note the order) - equal(QUnit.equiv([], {}), false); - - equal(QUnit.equiv([null],[]), false); - equal(QUnit.equiv([undefined],[]), false); - equal(QUnit.equiv([],[null]), false); - equal(QUnit.equiv([],[undefined]), false); - equal(QUnit.equiv([null],[undefined]), false); - equal(QUnit.equiv([[]],[[]]), true); - equal(QUnit.equiv([[],[],[]],[[],[],[]]), true); - equal(QUnit.equiv( - [[],[],[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]], - [[],[],[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]), - true); - equal(QUnit.equiv( - [[],[],[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]], - [[],[],[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]), // shorter - false); - equal(QUnit.equiv( - [[],[],[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[{}]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]], - [[],[],[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]), // deepest element not an array - false); - - // same multidimensional - equal(QUnit.equiv( - [1,2,3,4,5,6,7,8,9, [ - 1,2,3,4,5,6,7,8,9, [ - 1,2,3,4,5,[ - [6,7,8,9, [ - [ - 1,2,3,4,[ - 2,3,4,[ - 1,2,[ - 1,2,3,4,[ - 1,2,3,4,5,6,7,8,9,[ - 0 - ],1,2,3,4,5,6,7,8,9 - ],5,6,7,8,9 - ],4,5,6,7,8,9 - ],5,6,7,8,9 - ],5,6,7 - ] - ] - ] - ] - ]]], - [1,2,3,4,5,6,7,8,9, [ - 1,2,3,4,5,6,7,8,9, [ - 1,2,3,4,5,[ - [6,7,8,9, [ - [ - 1,2,3,4,[ - 2,3,4,[ - 1,2,[ - 1,2,3,4,[ - 1,2,3,4,5,6,7,8,9,[ - 0 - ],1,2,3,4,5,6,7,8,9 - ],5,6,7,8,9 - ],4,5,6,7,8,9 - ],5,6,7,8,9 - ],5,6,7 - ] - ] - ] - ] - ]]]), - true, "Multidimensional"); - - // different multidimensional - equal(QUnit.equiv( - [1,2,3,4,5,6,7,8,9, [ - 1,2,3,4,5,6,7,8,9, [ - 1,2,3,4,5,[ - [6,7,8,9, [ - [ - 1,2,3,4,[ - 2,3,4,[ - 1,2,[ - 1,2,3,4,[ - 1,2,3,4,5,6,7,8,9,[ - 0 - ],1,2,3,4,5,6,7,8,9 - ],5,6,7,8,9 - ],4,5,6,7,8,9 - ],5,6,7,8,9 - ],5,6,7 - ] - ] - ] - ] - ]]], - [1,2,3,4,5,6,7,8,9, [ - 1,2,3,4,5,6,7,8,9, [ - 1,2,3,4,5,[ - [6,7,8,9, [ - [ - 1,2,3,4,[ - 2,3,4,[ - 1,2,[ - '1',2,3,4,[ // string instead of number - 1,2,3,4,5,6,7,8,9,[ - 0 - ],1,2,3,4,5,6,7,8,9 - ],5,6,7,8,9 - ],4,5,6,7,8,9 - ],5,6,7,8,9 - ],5,6,7 - ] - ] - ] - ] - ]]]), - false, "Multidimensional"); - - // different multidimensional - equal(QUnit.equiv( - [1,2,3,4,5,6,7,8,9, [ - 1,2,3,4,5,6,7,8,9, [ - 1,2,3,4,5,[ - [6,7,8,9, [ - [ - 1,2,3,4,[ - 2,3,4,[ - 1,2,[ - 1,2,3,4,[ - 1,2,3,4,5,6,7,8,9,[ - 0 - ],1,2,3,4,5,6,7,8,9 - ],5,6,7,8,9 - ],4,5,6,7,8,9 - ],5,6,7,8,9 - ],5,6,7 - ] - ] - ] - ] - ]]], - [1,2,3,4,5,6,7,8,9, [ - 1,2,3,4,5,6,7,8,9, [ - 1,2,3,4,5,[ - [6,7,8,9, [ - [ - 1,2,3,4,[ - 2,3,[ // missing an element (4) - 1,2,[ - 1,2,3,4,[ - 1,2,3,4,5,6,7,8,9,[ - 0 - ],1,2,3,4,5,6,7,8,9 - ],5,6,7,8,9 - ],4,5,6,7,8,9 - ],5,6,7,8,9 - ],5,6,7 - ] - ] - ] - ] - ]]]), - false, "Multidimensional"); -}); - -test("Functions.", function() { - var f0 = function () {}; - var f1 = function () {}; - - // f2 and f3 have the same code, formatted differently - var f2 = function () {var i = 0;}; - var f3 = function () { - var i = 0 // this comment and no semicoma as difference - }; - - equal(QUnit.equiv(function() {}, function() {}), false, "Anonymous functions"); // exact source code - equal(QUnit.equiv(function() {}, function() {return true;}), false, "Anonymous functions"); - - equal(QUnit.equiv(f0, f0), true, "Function references"); // same references - equal(QUnit.equiv(f0, f1), false, "Function references"); // exact source code, different references - equal(QUnit.equiv(f2, f3), false, "Function references"); // equivalent source code, different references - equal(QUnit.equiv(f1, f2), false, "Function references"); // different source code, different references - equal(QUnit.equiv(function() {}, true), false); - equal(QUnit.equiv(function() {}, undefined), false); - equal(QUnit.equiv(function() {}, null), false); - equal(QUnit.equiv(function() {}, {}), false); -}); - - -test("Date instances.", function() { - // Date, we don't need to test Date.parse() because it returns a number. - // Only test the Date instances by setting them a fix date. - // The date use is midnight January 1, 1970 - - var d1 = new Date(); - d1.setTime(0); // fix the date - - var d2 = new Date(); - d2.setTime(0); // fix the date - - var d3 = new Date(); // The very now - - // Anyway their types differs, just in case the code fails in the order in which it deals with date - equal(QUnit.equiv(d1, 0), false); // d1.valueOf() returns 0, but d1 and 0 are different - // test same values date and different instances equality - equal(QUnit.equiv(d1, d2), true); - // test different date and different instances difference - equal(QUnit.equiv(d1, d3), false); -}); - - -test("RegExp.", function() { - // Must test cases that imply those traps: - // var a = /./; - // a instanceof Object; // Oops - // a instanceof RegExp; // Oops - // typeof a === "function"; // Oops, false in IE and Opera, true in FF and Safari ("object") - - // Tests same regex with same modifiers in different order - var r = /foo/; - var r5 = /foo/gim; - var r6 = /foo/gmi; - var r7 = /foo/igm; - var r8 = /foo/img; - var r9 = /foo/mig; - var r10 = /foo/mgi; - var ri1 = /foo/i; - var ri2 = /foo/i; - var rm1 = /foo/m; - var rm2 = /foo/m; - var rg1 = /foo/g; - var rg2 = /foo/g; - - equal(QUnit.equiv(r5, r6), true, "Modifier order"); - equal(QUnit.equiv(r5, r7), true, "Modifier order"); - equal(QUnit.equiv(r5, r8), true, "Modifier order"); - equal(QUnit.equiv(r5, r9), true, "Modifier order"); - equal(QUnit.equiv(r5, r10), true, "Modifier order"); - equal(QUnit.equiv(r, r5), false, "Modifier"); - - equal(QUnit.equiv(ri1, ri2), true, "Modifier"); - equal(QUnit.equiv(r, ri1), false, "Modifier"); - equal(QUnit.equiv(ri1, rm1), false, "Modifier"); - equal(QUnit.equiv(r, rm1), false, "Modifier"); - equal(QUnit.equiv(rm1, ri1), false, "Modifier"); - equal(QUnit.equiv(rm1, rm2), true, "Modifier"); - equal(QUnit.equiv(rg1, rm1), false, "Modifier"); - equal(QUnit.equiv(rm1, rg1), false, "Modifier"); - equal(QUnit.equiv(rg1, rg2), true, "Modifier"); - - // Different regex, same modifiers - var r11 = /[a-z]/gi; - var r13 = /[0-9]/gi; // oops! different - equal(QUnit.equiv(r11, r13), false, "Regex pattern"); - - var r14 = /0/ig; - var r15 = /"0"/ig; // oops! different - equal(QUnit.equiv(r14, r15), false, "Regex pattern"); - - var r1 = /[\n\r\u2028\u2029]/g; - var r2 = /[\n\r\u2028\u2029]/g; - var r3 = /[\n\r\u2028\u2028]/g; // differs from r1 - var r4 = /[\n\r\u2028\u2029]/; // differs from r1 - - equal(QUnit.equiv(r1, r2), true, "Regex pattern"); - equal(QUnit.equiv(r1, r3), false, "Regex pattern"); - equal(QUnit.equiv(r1, r4), false, "Regex pattern"); - - // More complex regex - var regex1 = "^[-_.a-z0-9]+@([-_a-z0-9]+\\.)+([A-Za-z][A-Za-z]|[A-Za-z][A-Za-z][A-Za-z])|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$"; - var regex2 = "^[-_.a-z0-9]+@([-_a-z0-9]+\\.)+([A-Za-z][A-Za-z]|[A-Za-z][A-Za-z][A-Za-z])|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$"; - // regex 3 is different: '.' not escaped - var regex3 = "^[-_.a-z0-9]+@([-_a-z0-9]+.)+([A-Za-z][A-Za-z]|[A-Za-z][A-Za-z][A-Za-z])|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$"; - - var r21 = new RegExp(regex1); - var r22 = new RegExp(regex2); - var r23 = new RegExp(regex3); // diff from r21, not same pattern - var r23a = new RegExp(regex3, "gi"); // diff from r23, not same modifier - var r24a = new RegExp(regex3, "ig"); // same as r23a - - equal(QUnit.equiv(r21, r22), true, "Complex Regex"); - equal(QUnit.equiv(r21, r23), false, "Complex Regex"); - equal(QUnit.equiv(r23, r23a), false, "Complex Regex"); - equal(QUnit.equiv(r23a, r24a), true, "Complex Regex"); - - // typeof r1 is "function" in some browsers and "object" in others so we must cover this test - var re = / /; - equal(QUnit.equiv(re, function () {}), false, "Regex internal"); - equal(QUnit.equiv(re, {}), false, "Regex internal"); -}); - - -test("Complex Objects.", function() { - - function fn1() { - return "fn1"; - } - function fn2() { - return "fn2"; - } - - // Try to invert the order of some properties to make sure it is covered. - // It can failed when properties are compared between unsorted arrays. - equal(QUnit.equiv( - { - a: 1, - b: null, - c: [{}], - d: { - a: 3.14159, - b: false, - c: { - e: fn1, - f: [[[]]], - g: { - j: { - k: { - n: { - r: "r", - s: [1,2,3], - t: undefined, - u: 0, - v: { - w: { - x: { - y: "Yahoo!", - z: null - } - } - } - }, - q: [], - p: 1/0, - o: 99 - }, - l: undefined, - m: null - } - }, - d: 0, - i: true, - h: "false" - } - }, - e: undefined, - g: "", - h: "h", - f: {}, - i: [] - }, - { - a: 1, - b: null, - c: [{}], - d: { - b: false, - a: 3.14159, - c: { - d: 0, - e: fn1, - f: [[[]]], - g: { - j: { - k: { - n: { - r: "r", - t: undefined, - u: 0, - s: [1,2,3], - v: { - w: { - x: { - z: null, - y: "Yahoo!" - } - } - } - }, - o: 99, - p: 1/0, - q: [] - }, - l: undefined, - m: null - } - }, - i: true, - h: "false" - } - }, - e: undefined, - g: "", - f: {}, - h: "h", - i: [] - } - ), true); - - equal(QUnit.equiv( - { - a: 1, - b: null, - c: [{}], - d: { - a: 3.14159, - b: false, - c: { - d: 0, - e: fn1, - f: [[[]]], - g: { - j: { - k: { - n: { - //r: "r", // different: missing a property - s: [1,2,3], - t: undefined, - u: 0, - v: { - w: { - x: { - y: "Yahoo!", - z: null - } - } - } - }, - o: 99, - p: 1/0, - q: [] - }, - l: undefined, - m: null - } - }, - h: "false", - i: true - } - }, - e: undefined, - f: {}, - g: "", - h: "h", - i: [] - }, - { - a: 1, - b: null, - c: [{}], - d: { - a: 3.14159, - b: false, - c: { - d: 0, - e: fn1, - f: [[[]]], - g: { - j: { - k: { - n: { - r: "r", - s: [1,2,3], - t: undefined, - u: 0, - v: { - w: { - x: { - y: "Yahoo!", - z: null - } - } - } - }, - o: 99, - p: 1/0, - q: [] - }, - l: undefined, - m: null - } - }, - h: "false", - i: true - } - }, - e: undefined, - f: {}, - g: "", - h: "h", - i: [] - } - ), false); - - equal(QUnit.equiv( - { - a: 1, - b: null, - c: [{}], - d: { - a: 3.14159, - b: false, - c: { - d: 0, - e: fn1, - f: [[[]]], - g: { - j: { - k: { - n: { - r: "r", - s: [1,2,3], - t: undefined, - u: 0, - v: { - w: { - x: { - y: "Yahoo!", - z: null - } - } - } - }, - o: 99, - p: 1/0, - q: [] - }, - l: undefined, - m: null - } - }, - h: "false", - i: true - } - }, - e: undefined, - f: {}, - g: "", - h: "h", - i: [] - }, - { - a: 1, - b: null, - c: [{}], - d: { - a: 3.14159, - b: false, - c: { - d: 0, - e: fn1, - f: [[[]]], - g: { - j: { - k: { - n: { - r: "r", - s: [1,2,3], - //t: undefined, // different: missing a property with an undefined value - u: 0, - v: { - w: { - x: { - y: "Yahoo!", - z: null - } - } - } - }, - o: 99, - p: 1/0, - q: [] - }, - l: undefined, - m: null - } - }, - h: "false", - i: true - } - }, - e: undefined, - f: {}, - g: "", - h: "h", - i: [] - } - ), false); - - equal(QUnit.equiv( - { - a: 1, - b: null, - c: [{}], - d: { - a: 3.14159, - b: false, - c: { - d: 0, - e: fn1, - f: [[[]]], - g: { - j: { - k: { - n: { - r: "r", - s: [1,2,3], - t: undefined, - u: 0, - v: { - w: { - x: { - y: "Yahoo!", - z: null - } - } - } - }, - o: 99, - p: 1/0, - q: [] - }, - l: undefined, - m: null - } - }, - h: "false", - i: true - } - }, - e: undefined, - f: {}, - g: "", - h: "h", - i: [] - }, - { - a: 1, - b: null, - c: [{}], - d: { - a: 3.14159, - b: false, - c: { - d: 0, - e: fn1, - f: [[[]]], - g: { - j: { - k: { - n: { - r: "r", - s: [1,2,3], - t: undefined, - u: 0, - v: { - w: { - x: { - y: "Yahoo!", - z: null - } - } - } - }, - o: 99, - p: 1/0, - q: {} // different was [] - }, - l: undefined, - m: null - } - }, - h: "false", - i: true - } - }, - e: undefined, - f: {}, - g: "", - h: "h", - i: [] - } - ), false); - - var same1 = { - a: [ - "string", null, 0, "1", 1, { - prop: null, - foo: [1,2,null,{}, [], [1,2,3]], - bar: undefined - }, 3, "Hey!", "Κάνε πάντα γνωÏ�ίζουμε ας των, μηχανής επιδιόÏ�θωσης επιδιοÏ�θώσεις ÏŽÏ‚ μια. Κλπ ας" - ], - unicode: "è€� 汉语中存在 港澳和海外的å�Žäººåœˆä¸­ 贵州 我去了书店 现在尚有争", - b: "b", - c: fn1 - }; - - var same2 = { - a: [ - "string", null, 0, "1", 1, { - prop: null, - foo: [1,2,null,{}, [], [1,2,3]], - bar: undefined - }, 3, "Hey!", "Κάνε πάντα γνωÏ�ίζουμε ας των, μηχανής επιδιόÏ�θωσης επιδιοÏ�θώσεις ÏŽÏ‚ μια. Κλπ ας" - ], - unicode: "è€� 汉语中存在 港澳和海外的å�Žäººåœˆä¸­ 贵州 我去了书店 现在尚有争", - b: "b", - c: fn1 - }; - - var diff1 = { - a: [ - "string", null, 0, "1", 1, { - prop: null, - foo: [1,2,null,{}, [], [1,2,3,4]], // different: 4 was add to the array - bar: undefined - }, 3, "Hey!", "Κάνε πάντα γνωÏ�ίζουμε ας των, μηχανής επιδιόÏ�θωσης επιδιοÏ�θώσεις ÏŽÏ‚ μια. Κλπ ας" - ], - unicode: "è€� 汉语中存在 港澳和海外的å�Žäººåœˆä¸­ 贵州 我去了书店 现在尚有争", - b: "b", - c: fn1 - }; - - var diff2 = { - a: [ - "string", null, 0, "1", 1, { - prop: null, - foo: [1,2,null,{}, [], [1,2,3]], - newprop: undefined, // different: newprop was added - bar: undefined - }, 3, "Hey!", "Κάνε πάντα γνωÏ�ίζουμε ας των, μηχανής επιδιόÏ�θωσης επιδιοÏ�θώσεις ÏŽÏ‚ μια. Κλπ ας" - ], - unicode: "è€� 汉语中存在 港澳和海外的å�Žäººåœˆä¸­ 贵州 我去了书店 现在尚有争", - b: "b", - c: fn1 - }; - - var diff3 = { - a: [ - "string", null, 0, "1", 1, { - prop: null, - foo: [1,2,null,{}, [], [1,2,3]], - bar: undefined - }, 3, "Hey!", "Κάνε πάντα γνωÏ�ίζουμε ας των, μηχανής επιδιόÏ�θωσης επιδιοÏ�θώσεις ÏŽÏ‚ μια. Κλπ α" // different: missing last char - ], - unicode: "è€� 汉语中存在 港澳和海外的å�Žäººåœˆä¸­ 贵州 我去了书店 现在尚有争", - b: "b", - c: fn1 - }; - - var diff4 = { - a: [ - "string", null, 0, "1", 1, { - prop: null, - foo: [1,2,undefined,{}, [], [1,2,3]], // different: undefined instead of null - bar: undefined - }, 3, "Hey!", "Κάνε πάντα γνωÏ�ίζουμε ας των, μηχανής επιδιόÏ�θωσης επιδιοÏ�θώσεις ÏŽÏ‚ μια. Κλπ ας" - ], - unicode: "è€� 汉语中存在 港澳和海外的å�Žäººåœˆä¸­ 贵州 我去了书店 现在尚有争", - b: "b", - c: fn1 - }; - - var diff5 = { - a: [ - "string", null, 0, "1", 1, { - prop: null, - foo: [1,2,null,{}, [], [1,2,3]], - bat: undefined // different: property name not "bar" - }, 3, "Hey!", "Κάνε πάντα γνωÏ�ίζουμε ας των, μηχανής επιδιόÏ�θωσης επιδιοÏ�θώσεις ÏŽÏ‚ μια. Κλπ ας" - ], - unicode: "è€� 汉语中存在 港澳和海外的å�Žäººåœˆä¸­ 贵州 我去了书店 现在尚有争", - b: "b", - c: fn1 - }; - - equal(QUnit.equiv(same1, same2), true); - equal(QUnit.equiv(same2, same1), true); - equal(QUnit.equiv(same2, diff1), false); - equal(QUnit.equiv(diff1, same2), false); - - equal(QUnit.equiv(same1, diff1), false); - equal(QUnit.equiv(same1, diff2), false); - equal(QUnit.equiv(same1, diff3), false); - equal(QUnit.equiv(same1, diff3), false); - equal(QUnit.equiv(same1, diff4), false); - equal(QUnit.equiv(same1, diff5), false); - equal(QUnit.equiv(diff5, diff1), false); -}); - - -test("Complex Arrays.", function() { - - function fn() { - } - - equal(QUnit.equiv( - [1, 2, 3, true, {}, null, [ - { - a: ["", '1', 0] - }, - 5, 6, 7 - ], "foo"], - [1, 2, 3, true, {}, null, [ - { - a: ["", '1', 0] - }, - 5, 6, 7 - ], "foo"]), - true); - - equal(QUnit.equiv( - [1, 2, 3, true, {}, null, [ - { - a: ["", '1', 0] - }, - 5, 6, 7 - ], "foo"], - [1, 2, 3, true, {}, null, [ - { - b: ["", '1', 0] // not same property name - }, - 5, 6, 7 - ], "foo"]), - false); - - var a = [{ - b: fn, - c: false, - "do": "reserved word", - "for": { - ar: [3,5,9,"hey!", [], { - ar: [1,[ - 3,4,6,9, null, [], [] - ]], - e: fn, - f: undefined - }] - }, - e: 0.43445 - }, 5, "string", 0, fn, false, null, undefined, 0, [ - 4,5,6,7,8,9,11,22,33,44,55,"66", null, [], [[[[[3]]]], "3"], {}, 1/0 - ], [], [[[], "foo", null, { - n: 1/0, - z: { - a: [3,4,5,6,"yep!", undefined, undefined], - b: {} - } - }, {}]]]; - - equal(QUnit.equiv(a, - [{ - b: fn, - c: false, - "do": "reserved word", - "for": { - ar: [3,5,9,"hey!", [], { - ar: [1,[ - 3,4,6,9, null, [], [] - ]], - e: fn, - f: undefined - }] - }, - e: 0.43445 - }, 5, "string", 0, fn, false, null, undefined, 0, [ - 4,5,6,7,8,9,11,22,33,44,55,"66", null, [], [[[[[3]]]], "3"], {}, 1/0 - ], [], [[[], "foo", null, { - n: 1/0, - z: { - a: [3,4,5,6,"yep!", undefined, undefined], - b: {} - } - }, {}]]]), true); - - equal(QUnit.equiv(a, - [{ - b: fn, - c: false, - "do": "reserved word", - "for": { - ar: [3,5,9,"hey!", [], { - ar: [1,[ - 3,4,6,9, null, [], [] - ]], - e: fn, - f: undefined - }] - }, - e: 0.43445 - }, 5, "string", 0, fn, false, null, undefined, 0, [ - 4,5,6,7,8,9,11,22,33,44,55,"66", null, [], [[[[[2]]]], "3"], {}, 1/0 // different: [[[[[2]]]]] instead of [[[[[3]]]]] - ], [], [[[], "foo", null, { - n: 1/0, - z: { - a: [3,4,5,6,"yep!", undefined, undefined], - b: {} - } - }, {}]]]), false); - - equal(QUnit.equiv(a, - [{ - b: fn, - c: false, - "do": "reserved word", - "for": { - ar: [3,5,9,"hey!", [], { - ar: [1,[ - 3,4,6,9, null, [], [] - ]], - e: fn, - f: undefined - }] - }, - e: 0.43445 - }, 5, "string", 0, fn, false, null, undefined, 0, [ - 4,5,6,7,8,9,11,22,33,44,55,"66", null, [], [[[[[3]]]], "3"], {}, 1/0 - ], [], [[[], "foo", null, { - n: -1/0, // different, -Infinity instead of Infinity - z: { - a: [3,4,5,6,"yep!", undefined, undefined], - b: {} - } - }, {}]]]), false); - - equal(QUnit.equiv(a, - [{ - b: fn, - c: false, - "do": "reserved word", - "for": { - ar: [3,5,9,"hey!", [], { - ar: [1,[ - 3,4,6,9, null, [], [] - ]], - e: fn, - f: undefined - }] - }, - e: 0.43445 - }, 5, "string", 0, fn, false, null, undefined, 0, [ - 4,5,6,7,8,9,11,22,33,44,55,"66", null, [], [[[[[3]]]], "3"], {}, 1/0 - ], [], [[[], "foo", { // different: null is missing - n: 1/0, - z: { - a: [3,4,5,6,"yep!", undefined, undefined], - b: {} - } - }, {}]]]), false); - - equal(QUnit.equiv(a, - [{ - b: fn, - c: false, - "do": "reserved word", - "for": { - ar: [3,5,9,"hey!", [], { - ar: [1,[ - 3,4,6,9, null, [], [] - ]], - e: fn - // different: missing property f: undefined - }] - }, - e: 0.43445 - }, 5, "string", 0, fn, false, null, undefined, 0, [ - 4,5,6,7,8,9,11,22,33,44,55,"66", null, [], [[[[[3]]]], "3"], {}, 1/0 - ], [], [[[], "foo", null, { - n: 1/0, - z: { - a: [3,4,5,6,"yep!", undefined, undefined], - b: {} - } - }, {}]]]), false); -}); - - -test("Prototypal inheritance", function() { - function Gizmo(id) { - this.id = id; - } - - function Hoozit(id) { - this.id = id; - } - Hoozit.prototype = new Gizmo(); - - var gizmo = new Gizmo("ok"); - var hoozit = new Hoozit("ok"); - - // Try this test many times after test on instances that hold function - // to make sure that our code does not mess with last object constructor memoization. - equal(QUnit.equiv(function () {}, function () {}), false); - - // Hoozit inherit from Gizmo - // hoozit instanceof Hoozit; // true - // hoozit instanceof Gizmo; // true - equal(QUnit.equiv(hoozit, gizmo), true); - - Gizmo.prototype.bar = true; // not a function just in case we skip them - - // Hoozit inherit from Gizmo - // They are equivalent - equal(QUnit.equiv(hoozit, gizmo), true); - - // Make sure this is still true !important - // The reason for this is that I forgot to reset the last - // caller to where it were called from. - equal(QUnit.equiv(function () {}, function () {}), false); - - // Make sure this is still true !important - equal(QUnit.equiv(hoozit, gizmo), true); - - Hoozit.prototype.foo = true; // not a function just in case we skip them - - // Gizmo does not inherit from Hoozit - // gizmo instanceof Gizmo; // true - // gizmo instanceof Hoozit; // false - // They are not equivalent - equal(QUnit.equiv(hoozit, gizmo), false); - - // Make sure this is still true !important - equal(QUnit.equiv(function () {}, function () {}), false); -}); - - -test("Instances", function() { - function A() {} - var a1 = new A(); - var a2 = new A(); - - function B() { - this.fn = function () {}; - } - var b1 = new B(); - var b2 = new B(); - - equal(QUnit.equiv(a1, a2), true, "Same property, same constructor"); - - // b1.fn and b2.fn are functions but they are different references - // But we decided to skip function for instances. - equal(QUnit.equiv(b1, b2), true, "Same property, same constructor"); - equal(QUnit.equiv(a1, b1), false, "Same properties but different constructor"); // failed - - function Car(year) { - var privateVar = 0; - this.year = year; - this.isOld = function() { - return year > 10; - }; - } - - function Human(year) { - var privateVar = 1; - this.year = year; - this.isOld = function() { - return year > 80; - }; - } - - var car = new Car(30); - var carSame = new Car(30); - var carDiff = new Car(10); - var human = new Human(30); - - var diff = { - year: 30 - }; - - var same = { - year: 30, - isOld: function () {} - }; - - equal(QUnit.equiv(car, car), true); - equal(QUnit.equiv(car, carDiff), false); - equal(QUnit.equiv(car, carSame), true); - equal(QUnit.equiv(car, human), false); -}); - - -test("Complex Instances Nesting (with function value in literals and/or in nested instances)", function() { - function A(fn) { - this.a = {}; - this.fn = fn; - this.b = {a: []}; - this.o = {}; - this.fn1 = fn; - } - function B(fn) { - this.fn = fn; - this.fn1 = function () {}; - this.a = new A(function () {}); - } - - function fnOutside() { - } - - function C(fn) { - function fnInside() { - } - this.x = 10; - this.fn = fn; - this.fn1 = function () {}; - this.fn2 = fnInside; - this.fn3 = { - a: true, - b: fnOutside // ok make reference to a function in all instances scope - }; - this.o1 = {}; - - // This function will be ignored. - // Even if it is not visible for all instances (e.g. locked in a closures), - // it is from a property that makes part of an instance (e.g. from the C constructor) - this.b1 = new B(function () {}); - this.b2 = new B({ - x: { - b2: new B(function() {}) - } - }); - } - - function D(fn) { - function fnInside() { - } - this.x = 10; - this.fn = fn; - this.fn1 = function () {}; - this.fn2 = fnInside; - this.fn3 = { - a: true, - b: fnOutside, // ok make reference to a function in all instances scope - - // This function won't be ingored. - // It isn't visible for all C insances - // and it is not in a property of an instance. (in an Object instances e.g. the object literal) - c: fnInside - }; - this.o1 = {}; - - // This function will be ignored. - // Even if it is not visible for all instances (e.g. locked in a closures), - // it is from a property that makes part of an instance (e.g. from the C constructor) - this.b1 = new B(function () {}); - this.b2 = new B({ - x: { - b2: new B(function() {}) - } - }); - } - - function E(fn) { - function fnInside() { - } - this.x = 10; - this.fn = fn; - this.fn1 = function () {}; - this.fn2 = fnInside; - this.fn3 = { - a: true, - b: fnOutside // ok make reference to a function in all instances scope - }; - this.o1 = {}; - - // This function will be ignored. - // Even if it is not visible for all instances (e.g. locked in a closures), - // it is from a property that makes part of an instance (e.g. from the C constructor) - this.b1 = new B(function () {}); - this.b2 = new B({ - x: { - b1: new B({a: function() {}}), - b2: new B(function() {}) - } - }); - } - - - var a1 = new A(function () {}); - var a2 = new A(function () {}); - equal(QUnit.equiv(a1, a2), true); - - equal(QUnit.equiv(a1, a2), true); // different instances - - var b1 = new B(function () {}); - var b2 = new B(function () {}); - equal(QUnit.equiv(b1, b2), true); - - var c1 = new C(function () {}); - var c2 = new C(function () {}); - equal(QUnit.equiv(c1, c2), true); - - var d1 = new D(function () {}); - var d2 = new D(function () {}); - equal(QUnit.equiv(d1, d2), false); - - var e1 = new E(function () {}); - var e2 = new E(function () {}); - equal(QUnit.equiv(e1, e2), false); - -}); - - -test('object with references to self wont loop', function(){ - var circularA = { - abc:null - }, circularB = { - abc:null - }; - circularA.abc = circularA; - circularB.abc = circularB; - equal(QUnit.equiv(circularA, circularB), true, "Should not repeat test on object (ambigous test)"); - - circularA.def = 1; - circularB.def = 1; - equal(QUnit.equiv(circularA, circularB), true, "Should not repeat test on object (ambigous test)"); - - circularA.def = 1; - circularB.def = 0; - equal(QUnit.equiv(circularA, circularB), false, "Should not repeat test on object (unambigous test)"); -}); - -test('array with references to self wont loop', function(){ - var circularA = [], - circularB = []; - circularA.push(circularA); - circularB.push(circularB); - equal(QUnit.equiv(circularA, circularB), true, "Should not repeat test on array (ambigous test)"); - - circularA.push( 'abc' ); - circularB.push( 'abc' ); - equal(QUnit.equiv(circularA, circularB), true, "Should not repeat test on array (ambigous test)"); - - circularA.push( 'hello' ); - circularB.push( 'goodbye' ); - equal(QUnit.equiv(circularA, circularB), false, "Should not repeat test on array (unambigous test)"); -}); - -test('mixed object/array with references to self wont loop', function(){ - var circularA = [{abc:null}], - circularB = [{abc:null}]; - circularA[0].abc = circularA; - circularB[0].abc = circularB; - - circularA.push(circularA); - circularB.push(circularB); - equal(QUnit.equiv(circularA, circularB), true, "Should not repeat test on object/array (ambigous test)"); - - circularA[0].def = 1; - circularB[0].def = 1; - equal(QUnit.equiv(circularA, circularB), true, "Should not repeat test on object/array (ambigous test)"); - - circularA[0].def = 1; - circularB[0].def = 0; - equal(QUnit.equiv(circularA, circularB), false, "Should not repeat test on object/array (unambigous test)"); -}); - -test("Test that must be done at the end because they extend some primitive's prototype", function() { - // Try that a function looks like our regular expression. - // This tests if we check that a and b are really both instance of RegExp - Function.prototype.global = true; - Function.prototype.multiline = true; - Function.prototype.ignoreCase = false; - Function.prototype.source = "my regex"; - var re = /my regex/gm; - equal(QUnit.equiv(re, function () {}), false, "A function that looks that a regex isn't a regex"); - // This test will ensures it works in both ways, and ALSO especially that we can make differences - // between RegExp and Function constructor because typeof on a RegExpt instance is "function" - equal(QUnit.equiv(function () {}, re), false, "Same conversely, but ensures that function and regexp are distinct because their constructor are different"); -}); diff --git a/tests/qunit/node_modules/qunit/support/qunit/test/headless.html b/tests/qunit/node_modules/qunit/support/qunit/test/headless.html deleted file mode 100644 index dae6217..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/test/headless.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - QUnit Test Suite - - - - - - - -
    test markup
    - - diff --git a/tests/qunit/node_modules/qunit/support/qunit/test/index.html b/tests/qunit/node_modules/qunit/support/qunit/test/index.html deleted file mode 100644 index 50bc978..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/test/index.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - QUnit Test Suite - - - - - - - -
    -
    test markup
    - - diff --git a/tests/qunit/node_modules/qunit/support/qunit/test/logs.html b/tests/qunit/node_modules/qunit/support/qunit/test/logs.html deleted file mode 100644 index ed03dad..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/test/logs.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - QUnit Test Suite - - - - - -
    -
    test markup
    - - diff --git a/tests/qunit/node_modules/qunit/support/qunit/test/logs.js b/tests/qunit/node_modules/qunit/support/qunit/test/logs.js deleted file mode 100644 index 1efd058..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/test/logs.js +++ /dev/null @@ -1,180 +0,0 @@ -// TODO disable reordering for this suite! - - -var begin = 0, - moduleStart = 0, - moduleDone = 0, - testStart = 0, - testDone = 0, - log = 0, - moduleContext, - moduleDoneContext, - testContext, - testDoneContext, - logContext; - -QUnit.begin(function() { - begin++; -}); -QUnit.done(function() { -}); -QUnit.moduleStart(function(context) { - moduleStart++; - moduleContext = context; -}); -QUnit.moduleDone(function(context) { - moduleDone++; - moduleDoneContext = context; -}); -QUnit.testStart(function(context) { - testStart++; - testContext = context; -}); -QUnit.testDone(function(context) { - testDone++; - testDoneContext = context; -}); -QUnit.log(function(context) { - log++; - logContext = context; -}); - -var logs = ["begin", "testStart", "testDone", "log", "moduleStart", "moduleDone", "done"]; -for (var i = 0; i < logs.length; i++) { - (function() { - var log = logs[i]; - QUnit[log](function() { - console.log(log, arguments); - }); - })(); -} - -module("logs1"); - -test("test1", 13, function() { - equal(begin, 1); - equal(moduleStart, 1); - equal(testStart, 1); - equal(testDone, 0); - equal(moduleDone, 0); - - deepEqual(logContext, { - result: true, - message: undefined, - actual: 0, - expected: 0 - }); - equal("foo", "foo", "msg"); - deepEqual(logContext, { - result: true, - message: "msg", - actual: "foo", - expected: "foo" - }); - strictEqual(testDoneContext, undefined); - deepEqual(testContext, { - module: "logs1", - name: "test1" - }); - strictEqual(moduleDoneContext, undefined); - deepEqual(moduleContext, { - name: "logs1" - }); - - equal(log, 12); -}); -test("test2", 10, function() { - equal(begin, 1); - equal(moduleStart, 1); - equal(testStart, 2); - equal(testDone, 1); - equal(moduleDone, 0); - - deepEqual(testDoneContext, { - module: "logs1", - name: "test1", - failed: 0, - passed: 13, - total: 13 - }); - deepEqual(testContext, { - module: "logs1", - name: "test2" - }); - strictEqual(moduleDoneContext, undefined); - deepEqual(moduleContext, { - name: "logs1" - }); - - equal(log, 22); -}); - -module("logs2"); - -test("test1", 9, function() { - equal(begin, 1); - equal(moduleStart, 2); - equal(testStart, 3); - equal(testDone, 2); - equal(moduleDone, 1); - - deepEqual(testContext, { - module: "logs2", - name: "test1" - }); - deepEqual(moduleDoneContext, { - name: "logs1", - failed: 0, - passed: 23, - total: 23 - }); - deepEqual(moduleContext, { - name: "logs2" - }); - - equal(log, 31); -}); -test("test2", 8, function() { - equal(begin, 1); - equal(moduleStart, 2); - equal(testStart, 4); - equal(testDone, 3); - equal(moduleDone, 1); - - deepEqual(testContext, { - module: "logs2", - name: "test2" - }); - deepEqual(moduleContext, { - name: "logs2" - }); - - equal(log, 39); -}); - -var testAutorun = true; - -QUnit.done(function() { - - if (!testAutorun) { - return; - } - - testAutorun = false; - - module("autorun"); - - test("reset", 0, function() {}); - - moduleStart = moduleDone = 0; - - test("first", function(){ - equal(moduleStart, 1, "test started"); - equal(moduleDone, 0, "test in progress"); - }); - - test("second", function(){ - equal(moduleStart, 2, "test started"); - equal(moduleDone, 1, "test in progress"); - }); -}); diff --git a/tests/qunit/node_modules/qunit/support/qunit/test/narwhal-test.js b/tests/qunit/node_modules/qunit/support/qunit/test/narwhal-test.js deleted file mode 100644 index e8c5131..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/test/narwhal-test.js +++ /dev/null @@ -1,22 +0,0 @@ -// run with -// node test/node-test.js -var QUnit = require("../qunit/qunit"); -QUnit.log(function(details) { - if (!details.result) { - var output = "FAILED: " + (details.message ? details.message + ", " : ""); - if (details.actual) { - output += "expected: " + details.expected + ", actual: " + details.actual; - } - if (details.source) { - output += ", " + details.source; - } - print(output); - } else { - print("ok!"); - } -}); -QUnit.test("yo", function() { - QUnit.equal(true, false); - QUnit.equal(true, false, "gotta fail"); - x.y.z; -}); \ No newline at end of file diff --git a/tests/qunit/node_modules/qunit/support/qunit/test/node-test.js b/tests/qunit/node_modules/qunit/support/qunit/test/node-test.js deleted file mode 100644 index 74aa4d7..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/test/node-test.js +++ /dev/null @@ -1,20 +0,0 @@ -// run with -// node test/node-test.js -var QUnit = require("../qunit/qunit"); -QUnit.log(function(details) { - if (!details.result) { - var output = "FAILED: " + (details.message ? details.message + ", " : ""); - if (details.actual) { - output += "expected: " + details.expected + ", actual: " + details.actual; - } - if (details.source) { - output += ", " + details.source; - } - console.log(output); - } -}); -QUnit.test("yo", function() { - QUnit.equal(true, false); - QUnit.equal(true, false, "gotta fail"); - x.y.z; -}); \ No newline at end of file diff --git a/tests/qunit/node_modules/qunit/support/qunit/test/swarminject.js b/tests/qunit/node_modules/qunit/support/qunit/test/swarminject.js deleted file mode 100644 index db69326..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/test/swarminject.js +++ /dev/null @@ -1,9 +0,0 @@ -// load testswarm agent -(function() { - var url = window.location.search; - url = decodeURIComponent( url.slice( url.indexOf("swarmURL=") + 9 ) ); - if ( !url || url.indexOf("http") !== 0 ) { - return; - } - document.write(""); -})(); diff --git a/tests/qunit/node_modules/qunit/support/qunit/test/test.js b/tests/qunit/node_modules/qunit/support/qunit/test/test.js deleted file mode 100644 index 37e8b7a..0000000 --- a/tests/qunit/node_modules/qunit/support/qunit/test/test.js +++ /dev/null @@ -1,593 +0,0 @@ -test("module without setup/teardown (default)", function() { - expect(1); - ok(true); -}); - -test("expect in test", 3, function() { - ok(true); - ok(true); - ok(true); -}); - -test("expect in test", 1, function() { - ok(true); -}); - -QUnit.module("assertion helpers"); - -QUnit.test( "QUnit.assert compatibility", function( assert ) { - QUnit.expect(4); - - assert.ok( true, "Calling method on `assert` argument to test() callback" ); - - // Should also work, although not documented - QUnit.assert.ok( true, "Calling method on QUnit.assert object" ); - - // Test compatibility aliases - QUnit.ok( true, "Calling aliased method in QUnit root object" ); - ok( true, "Calling aliased function in global namespace" ); -}); - -module("setup test", { - setup: function() { - ok(true); - } -}); - -test("module with setup", function() { - expect(2); - ok(true); -}); - -test("module with setup, expect in test call", 2, function() { - ok(true); -}); - -var state; - -module("setup/teardown test", { - setup: function() { - state = true; - ok(true); - x = 1; - }, - teardown: function() { - ok(true); - // can introduce and delete globals in setup/teardown - // without noglobals sounding the alarm - delete x; - } -}); - -test("module with setup/teardown", function() { - expect(3); - ok(true); -}); - -module("setup/teardown test 2"); - -test("module without setup/teardown", function() { - expect(1); - ok(true); -}); - - - -var orgDate; - -module("Date test", { - setup: function() { - orgDate = Date; - Date = function () { - ok( false, 'QUnit should internally be independant from Date-related manipulation and testing' ); - return new orgDate(); - }; - }, - teardown: function() { - Date = orgDate; - } -}); - -test("sample test for Date test", function () { - expect(1); - ok(true); -}); - -if (typeof setTimeout !== 'undefined') { -state = 'fail'; - -module("teardown and stop", { - teardown: function() { - equal(state, "done", "Test teardown."); - } -}); - -test("teardown must be called after test ended", function() { - expect(1); - stop(); - setTimeout(function() { - state = "done"; - start(); - }, 13); -}); - -test("parameter passed to stop increments semaphore n times", function() { - expect(1); - stop(3); - setTimeout(function() { - state = "not enough starts"; - start(), start(); - }, 13); - setTimeout(function() { - state = "done"; - start(); - }, 15); -}); - -test("parameter passed to start decrements semaphore n times", function() { - expect(1); - stop(), stop(), stop(); - setTimeout(function() { - state = "done"; - start(3); - }, 18); -}); - -module("async setup test", { - setup: function() { - stop(); - setTimeout(function(){ - ok(true); - start(); - }, 500); - } -}); - -asyncTest("module with async setup", function() { - expect(2); - ok(true); - start(); -}); - -module("async teardown test", { - teardown: function() { - stop(); - setTimeout(function(){ - ok(true); - start(); - }, 500); - } -}); - -asyncTest("module with async teardown", function() { - expect(2); - ok(true); - start(); -}); - -module("asyncTest"); - -asyncTest("asyncTest", function() { - expect(2); - ok(true); - setTimeout(function() { - state = "done"; - ok(true); - start(); - }, 13); -}); - -asyncTest("asyncTest", 2, function() { - ok(true); - setTimeout(function() { - state = "done"; - ok(true); - start(); - }, 13); -}); - -test("sync", 2, function() { - stop(); - setTimeout(function() { - ok(true); - start(); - }, 13); - stop(); - setTimeout(function() { - ok(true); - start(); - }, 125); -}); - -test("test synchronous calls to stop", 2, function() { - stop(); - setTimeout(function(){ - ok(true, 'first'); - start(); - stop(); - setTimeout(function(){ - ok(true, 'second'); - start(); - }, 150); - }, 150); -}); -} - -module("save scope", { - setup: function() { - this.foo = "bar"; - }, - teardown: function() { - deepEqual(this.foo, "bar"); - } -}); -test("scope check", function() { - expect(2); - deepEqual(this.foo, "bar"); -}); - -module("simple testEnvironment setup", { - foo: "bar", - bugid: "#5311" // example of meta-data -}); -test("scope check", function() { - deepEqual(this.foo, "bar"); -}); -test("modify testEnvironment",function() { - expect(0); - this.foo="hamster"; -}); -test("testEnvironment reset for next test",function() { - deepEqual(this.foo, "bar"); -}); - -module("testEnvironment with object", { - options:{ - recipe:"soup", - ingredients:["hamster","onions"] - } -}); -test("scope check", function() { - deepEqual(this.options, {recipe:"soup",ingredients:["hamster","onions"]}) ; -}); -test("modify testEnvironment",function() { - expect(0); - // since we do a shallow copy, the testEnvironment can be modified - this.options.ingredients.push("carrots"); -}); -test("testEnvironment reset for next test",function() { - deepEqual(this.options, {recipe:"soup",ingredients:["hamster","onions","carrots"]}, "Is this a bug or a feature? Could do a deep copy") ; -}); - - -module("testEnvironment tests"); - -function makeurl() { - var testEnv = QUnit.current_testEnvironment; - var url = testEnv.url || 'http://example.com/search'; - var q = testEnv.q || 'a search test'; - return url + '?q='+encodeURIComponent(q); -} - -test("makeurl working",function() { - equal( QUnit.current_testEnvironment, this, 'The current testEnvironment is global'); - equal( makeurl(), 'http://example.com/search?q=a%20search%20test', 'makeurl returns a default url if nothing specified in the testEnvironment'); -}); - -module("testEnvironment with makeurl settings", { - url: 'http://google.com/', - q: 'another_search_test' -}); -test("makeurl working with settings from testEnvironment", function() { - equal( makeurl(), 'http://google.com/?q=another_search_test', 'rather than passing arguments, we use test metadata to from the url'); -}); - -module("jsDump"); -test("jsDump output", function() { - equal( QUnit.jsDump.parse([1, 2]), "[\n 1,\n 2\n]" ); - equal( QUnit.jsDump.parse({top: 5, left: 0}), "{\n \"left\": 0,\n \"top\": 5\n}" ); - if (typeof document !== 'undefined' && document.getElementById("qunit-header")) { - equal( QUnit.jsDump.parse(document.getElementById("qunit-header")), "

    " ); - equal( QUnit.jsDump.parse(document.getElementsByTagName("h1")), "[\n

    \n]" ); - } -}); - -module("assertions"); -test("raises",function() { - function CustomError( message ) { - this.message = message; - } - - CustomError.prototype.toString = function() { - return this.message; - }; - - throws( - function() { - throw "my error" - } - ); - - throws( - function() { - throw "my error" - }, - "simple string throw, no 'expected' value given" - ); - - throws( - function() { - throw new CustomError(); - }, - CustomError, - 'thrown error is an instance of CustomError' - ); - - throws( - function() { - throw new CustomError("some error description"); - }, - /description/, - "use a regex to match against the stringified error" - ); - - throws( - function() { - throw new CustomError("some error description"); - }, - function( err ) { - if ( (err instanceof CustomError) && /description/.test(err) ) { - return true; - } - }, - "custom validation function" - ); - - throws( - function() { - ( window.execScript || function( data ) { - window["eval"].call( window, data ); - })( "throw 'error'" ); - }, - 'globally-executed errors caught' - ); - - this.CustomError = CustomError; - - throws( - function() { - throw new this.CustomError("some error description"); - }, - /description/, - "throw error from property of 'this' context" - ); - - raises( - function() { - throw "error" - }, - "simple throw, asserting with deprecated raises() function" - ); - -}); - -if (typeof document !== "undefined") { - -module("fixture"); -test("setup", function() { - expect(0); - document.getElementById("qunit-fixture").innerHTML = "foobar"; -}); -test("basics", function() { - equal( document.getElementById("qunit-fixture").innerHTML, "test markup", "automatically reset" ); -}); - -test("running test name displayed", function() { - expect(2); - - var displaying = document.getElementById("qunit-testresult"); - - ok( /running test name displayed/.test(displaying.innerHTML), "Expect test name to be found in displayed text" ); - ok( /fixture/.test(displaying.innerHTML), "Expect module name to be found in displayed text" ); -}); - -} - -module("custom assertions"); -(function() { - function mod2(value, expected, message) { - var actual = value % 2; - QUnit.push(actual == expected, actual, expected, message); - } - test("mod2", function() { - mod2(2, 0, "2 % 2 == 0"); - mod2(3, 1, "3 % 2 == 1"); - }); -})(); - - -module("recursions"); - -function Wrap(x) { - this.wrap = x; - if (x == undefined) this.first = true; -} - -function chainwrap(depth, first, prev) { - depth = depth || 0; - var last = prev || new Wrap(); - first = first || last; - - if (depth == 1) { - first.wrap = last; - } - if (depth > 1) { - last = chainwrap(depth-1, first, new Wrap(last)); - } - - return last; -} - -test("check jsDump recursion", function() { - expect(4); - - var noref = chainwrap(0); - var nodump = QUnit.jsDump.parse(noref); - equal(nodump, '{\n "first": true,\n "wrap": undefined\n}'); - - var selfref = chainwrap(1); - var selfdump = QUnit.jsDump.parse(selfref); - equal(selfdump, '{\n "first": true,\n "wrap": recursion(-1)\n}'); - - var parentref = chainwrap(2); - var parentdump = QUnit.jsDump.parse(parentref); - equal(parentdump, '{\n "wrap": {\n "first": true,\n "wrap": recursion(-2)\n }\n}'); - - var circref = chainwrap(10); - var circdump = QUnit.jsDump.parse(circref); - ok(new RegExp("recursion\\(-10\\)").test(circdump), "(" +circdump + ") should show -10 recursion level"); -}); - -test("check (deep-)equal recursion", function() { - var noRecursion = chainwrap(0); - equal(noRecursion, noRecursion, "I should be equal to me."); - deepEqual(noRecursion, noRecursion, "... and so in depth."); - - var selfref = chainwrap(1); - equal(selfref, selfref, "Even so if I nest myself."); - deepEqual(selfref, selfref, "... into the depth."); - - var circref = chainwrap(10); - equal(circref, circref, "Or hide that through some levels of indirection."); - deepEqual(circref, circref, "... and checked on all levels!"); -}); - - -test('Circular reference with arrays', function() { - - // pure array self-ref - var arr = []; - arr.push(arr); - - var arrdump = QUnit.jsDump.parse(arr); - - equal(arrdump, '[\n recursion(-1)\n]'); - equal(arr, arr[0], 'no endless stack when trying to dump arrays with circular ref'); - - - // mix obj-arr circular ref - var obj = {}; - var childarr = [obj]; - obj.childarr = childarr; - - var objdump = QUnit.jsDump.parse(obj); - var childarrdump = QUnit.jsDump.parse(childarr); - - equal(objdump, '{\n "childarr": [\n recursion(-2)\n ]\n}'); - equal(childarrdump, '[\n {\n "childarr": recursion(-2)\n }\n]'); - - equal(obj.childarr, childarr, 'no endless stack when trying to dump array/object mix with circular ref'); - equal(childarr[0], obj, 'no endless stack when trying to dump array/object mix with circular ref'); - -}); - - -test('Circular reference - test reported by soniciq in #105', function() { - var MyObject = function() {}; - MyObject.prototype.parent = function(obj) { - if (obj === undefined) { return this._parent; } - this._parent = obj; - }; - MyObject.prototype.children = function(obj) { - if (obj === undefined) { return this._children; } - this._children = obj; - }; - - var a = new MyObject(), - b = new MyObject(); - - var barr = [b]; - a.children(barr); - b.parent(a); - - equal(a.children(), barr); - deepEqual(a.children(), [b]); -}); - -(function() { - var reset = QUnit.reset; - module("reset"); - test("reset runs assertions", function() { - expect(0); - QUnit.reset = function() { - ok( false, "reset should not modify test status" ); - reset.apply( this, arguments ); - }; - }); - test("reset runs assertions, cleanup", function() { - expect(0); - QUnit.reset = reset; - }); -})(); - -if (typeof setTimeout !== 'undefined') { -function testAfterDone(){ - var testName = "ensure has correct number of assertions"; - - function secondAfterDoneTest(){ - QUnit.config.done = []; - //QUnit.done = function(){}; - //because when this does happen, the assertion count parameter doesn't actually - //work we use this test to check the assertion count. - module("check previous test's assertion counts"); - test('count previous two test\'s assertions', function(){ - var spans = document.getElementsByTagName('span'), - tests = [], - countNodes; - - //find these two tests - for (var i = 0; i < spans.length; i++) { - if (spans[i].innerHTML.indexOf(testName) !== -1) { - tests.push(spans[i]); - } - } - - //walk dom to counts - countNodes = tests[0].nextSibling.nextSibling.getElementsByTagName('b'); - equal(countNodes[1].innerHTML, "99"); - countNodes = tests[1].nextSibling.nextSibling.getElementsByTagName('b'); - equal(countNodes[1].innerHTML, "99"); - }); - } - QUnit.config.done = []; - QUnit.done(secondAfterDoneTest); - - module("Synchronous test after load of page"); - - asyncTest('Async test', function(){ - start(); - for (var i = 1; i < 100; i++) { - ok(i); - } - }); - - test(testName, 99, function(){ - for (var i = 1; i < 100; i++) { - ok(i); - } - }); - - //we need two of these types of tests in order to ensure that assertions - //don't move between tests. - test(testName + ' 2', 99, function(){ - for (var i = 1; i < 100; i++) { - ok(i); - } - }); - - -} - -QUnit.done(testAfterDone); - -} diff --git a/tests/qunit/node_modules/qunit/test/fixtures/async-code.js b/tests/qunit/node_modules/qunit/test/fixtures/async-code.js deleted file mode 100644 index 6e4d4c0..0000000 --- a/tests/qunit/node_modules/qunit/test/fixtures/async-code.js +++ /dev/null @@ -1 +0,0 @@ -exports.blubb = 123; \ No newline at end of file diff --git a/tests/qunit/node_modules/qunit/test/fixtures/async-test.js b/tests/qunit/node_modules/qunit/test/fixtures/async-test.js deleted file mode 100644 index 66f5bd8..0000000 --- a/tests/qunit/node_modules/qunit/test/fixtures/async-test.js +++ /dev/null @@ -1,27 +0,0 @@ -test('1', 1, function (){ - ok(true, "tests intermixing sync and async tests #1") -}); - -test('a', 2, function(){ - stop(); - - setTimeout(function() { - ok(true, 'test a1'); - ok(true, 'test a2'); - start(); - }, 10000); -}) - -test('2', 1, function (){ - ok(true, "tests intermixing sync and async tests #2") -}); - -test('b', 2, function(){ - stop(); - - setTimeout(function() { - ok(true, 'test b1'); - ok(true, 'test b2'); - start(); - }, 10); -}) diff --git a/tests/qunit/node_modules/qunit/test/fixtures/child-code-global.js b/tests/qunit/node_modules/qunit/test/fixtures/child-code-global.js deleted file mode 100644 index eac7d7e..0000000 --- a/tests/qunit/node_modules/qunit/test/fixtures/child-code-global.js +++ /dev/null @@ -1,3 +0,0 @@ -exports.whereFrom = function() { - return "I was required as global"; -}; diff --git a/tests/qunit/node_modules/qunit/test/fixtures/child-code-namespace.js b/tests/qunit/node_modules/qunit/test/fixtures/child-code-namespace.js deleted file mode 100644 index 8cee7cd..0000000 --- a/tests/qunit/node_modules/qunit/test/fixtures/child-code-namespace.js +++ /dev/null @@ -1,3 +0,0 @@ -exports.whereFrom = function() { - return "I was required as a namespace object"; -}; \ No newline at end of file diff --git a/tests/qunit/node_modules/qunit/test/fixtures/child-tests-global.js b/tests/qunit/node_modules/qunit/test/fixtures/child-tests-global.js deleted file mode 100644 index 8a206e6..0000000 --- a/tests/qunit/node_modules/qunit/test/fixtures/child-tests-global.js +++ /dev/null @@ -1,5 +0,0 @@ - -test("Dependency file required as global", function() { - equal(typeof whereFrom, "function"); - equal(whereFrom(), "I was required as global"); -}); diff --git a/tests/qunit/node_modules/qunit/test/fixtures/child-tests-namespace.js b/tests/qunit/node_modules/qunit/test/fixtures/child-tests-namespace.js deleted file mode 100644 index 9857ed1..0000000 --- a/tests/qunit/node_modules/qunit/test/fixtures/child-tests-namespace.js +++ /dev/null @@ -1,5 +0,0 @@ -test("Dependency file required as a namespace object", function() { - strictEqual(typeof testns != "undefined", true); - equal(typeof testns.whereFrom, "function", "right method attached to right object"); - equal(testns.whereFrom(), "I was required as a namespace object"); -}); diff --git a/tests/qunit/node_modules/qunit/test/fixtures/testrunner-code.js b/tests/qunit/node_modules/qunit/test/fixtures/testrunner-code.js deleted file mode 100644 index 4b3bfb9..0000000 --- a/tests/qunit/node_modules/qunit/test/fixtures/testrunner-code.js +++ /dev/null @@ -1,9 +0,0 @@ -exports.myMethod = function() { - return 123; -}; - -exports.myAsyncMethod = function(callback) { - setTimeout(function() { - callback(123); - }, 100); -}; \ No newline at end of file diff --git a/tests/qunit/node_modules/qunit/test/fixtures/testrunner-tests.js b/tests/qunit/node_modules/qunit/test/fixtures/testrunner-tests.js deleted file mode 100644 index 4a44675..0000000 --- a/tests/qunit/node_modules/qunit/test/fixtures/testrunner-tests.js +++ /dev/null @@ -1,29 +0,0 @@ -test('myMethod test', function() { - equal(myMethod(), 123, 'myMethod returns right result'); - equal(myMethod(), 321, 'this should trigger an error'); -}) - -test('myAsyncMethod test', function() { - ok(true, 'myAsyncMethod started'); - - stop(); - expect(3); - - myAsyncMethod(function(data) { - equal(data, 123, 'myAsyncMethod returns right result'); - equal(data, 321, 'this should trigger an error'); - start(); - }); -}) - -test('circular reference', function() { - equal(global, global, 'test global'); -}); - -test('use original Date', function() { - var timekeeper = require('timekeeper'); - - timekeeper.travel(Date.now() - 1000000); - - ok(true, 'date modified'); -}); diff --git a/tests/qunit/node_modules/qunit/test/fixtures/uncaught-exception-code.js b/tests/qunit/node_modules/qunit/test/fixtures/uncaught-exception-code.js deleted file mode 100644 index e69de29..0000000 diff --git a/tests/qunit/node_modules/qunit/test/fixtures/uncaught-exception-test.js b/tests/qunit/node_modules/qunit/test/fixtures/uncaught-exception-test.js deleted file mode 100644 index 4ee786b..0000000 --- a/tests/qunit/node_modules/qunit/test/fixtures/uncaught-exception-test.js +++ /dev/null @@ -1 +0,0 @@ -throw new Error('Some error.') diff --git a/tests/qunit/node_modules/qunit/test/testrunner.js b/tests/qunit/node_modules/qunit/test/testrunner.js deleted file mode 100644 index 38f7339..0000000 --- a/tests/qunit/node_modules/qunit/test/testrunner.js +++ /dev/null @@ -1,152 +0,0 @@ -var a = require('assert'), - chainer = require('chainer'), - _ = require('underscore'); - -var tr = require('../lib/testrunner'), - log = require('../lib/log'); - -var fixtures = __dirname + '/fixtures', - chain = chainer(); - -tr.options.log = { - // log assertions overview - // assertions: true, - // log expected and actual values for failed tests - // errors: true, - // log tests overview - // tests: true, - // log summary - // summary: true, - // log global summary (all files) - // globalSummary: true, - // log currently testing code file - testing: true -}; - -// reset log stats every time .next is called -chain.next = function() { - log.reset(); - return chainer.prototype.next.apply(this, arguments); -}; - -chain.add('base testrunner', function() { - tr.run({ - code: fixtures + '/testrunner-code.js', - tests: fixtures + '/testrunner-tests.js', - }, function(err, res) { - var stat = { - files: 1, - tests: 4, - assertions: 7, - failed: 2, - passed: 5 - }; - - a.equal(err, null, 'no errors'); - a.ok(res.runtime > 0, 'Date was modified'); - delete res.runtime; - a.deepEqual(stat, res, 'base testrunner test'); - chain.next(); - }); -}); - -chain.add('attach code to global', function() { - tr.run({ - code: fixtures + '/child-code-global.js', - tests: fixtures + '/child-tests-global.js', - }, function(err, res) { - var stat = { - files: 1, - tests: 1, - assertions: 2, - failed: 0, - passed: 2 - }; - - delete res.runtime; - a.equal(err, null, 'no errors'); - a.deepEqual(stat, res, 'attaching code to global works'); - chain.next(); - }); -}); - -chain.add('attach deps to global', function() { - tr.run({ - deps: fixtures + '/child-code-global.js', - code: fixtures + '/testrunner-code.js', - tests: fixtures + '/child-tests-global.js', - }, function(err, res) { - var stat = { - files: 1, - tests: 1, - assertions: 2, - failed: 0, - passed: 2 - }; - - delete res.runtime; - a.equal(err, null, 'no errors'); - a.deepEqual(stat, res, 'attaching dependencies to global works'); - chain.next(); - }); -}); - -chain.add('attach code to a namespace', function() { - tr.run({ - code: { - path: fixtures + '/child-code-namespace.js', - namespace: 'testns' - }, - tests: fixtures + '/child-tests-namespace.js', - }, function(err, res) { - var stat = { - files: 1, - tests: 1, - assertions: 3, - failed: 0, - passed: 3 - }; - - delete res.runtime; - a.equal(err, null, 'no errors'); - a.deepEqual(stat, res, 'attaching code to specified namespace works'); - chain.next(); - }); -}); - -chain.add('async testing logs', function() { - tr.run({ - code: fixtures + '/async-code.js', - tests: fixtures + '/async-test.js', - }, function(err, res) { - var stat = { - files: 1, - tests: 4, - assertions: 6, - failed: 0, - passed: 6 - }; - - delete res.runtime; - a.equal(err, null, 'no errors'); - a.deepEqual(stat, res, 'async code testing works'); - chain.next(); - }); -}); - -chain.add('uncaught exception', function() { - tr.run({ - code: fixtures + '/uncaught-exception-code.js', - tests: fixtures + '/uncaught-exception-test.js', - }, function(err, res) { - a.ok(err instanceof Error, 'error was forwarded') - chain.next(); - }); -}); - -chain.add(function() { - console.log('\nAll tests ok.'); -}); - -chain.start(); - diff --git a/tests/qunit/qunit.css b/tests/qunit/qunit.css deleted file mode 100644 index e5aa7fe..0000000 --- a/tests/qunit/qunit.css +++ /dev/null @@ -1,244 +0,0 @@ -/** - * QUnit v1.11.0pre-5542510a63bae14cbffc571033369aa9962ec946 2012-12-19 - A JavaScript Unit Testing Framework - * - * http://qunitjs.com - * - * Copyright 2012 jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - */ - -/** Font Family and Sizes */ - -#qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult { - font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif; -} - -#qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; } -#qunit-tests { font-size: smaller; } - - -/** Resets */ - -#qunit-tests, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult, #qunit-modulefilter { - margin: 0; - padding: 0; -} - - -/** Header */ - -#qunit-header { - padding: 0.5em 0 0.5em 1em; - - color: #8699a4; - background-color: #0d3349; - - font-size: 1.5em; - line-height: 1em; - font-weight: normal; - - border-radius: 5px 5px 0 0; - -moz-border-radius: 5px 5px 0 0; - -webkit-border-top-right-radius: 5px; - -webkit-border-top-left-radius: 5px; -} - -#qunit-header a { - text-decoration: none; - color: #c2ccd1; -} - -#qunit-header a:hover, -#qunit-header a:focus { - color: #fff; -} - -#qunit-testrunner-toolbar label { - display: inline-block; - padding: 0 .5em 0 .1em; -} - -#qunit-banner { - height: 5px; -} - -#qunit-testrunner-toolbar { - padding: 0.5em 0 0.5em 2em; - color: #5E740B; - background-color: #eee; - overflow: hidden; -} - -#qunit-userAgent { - padding: 0.5em 0 0.5em 2.5em; - background-color: #2b81af; - color: #fff; - text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px; -} - -#qunit-modulefilter-container { - float: right; -} - -/** Tests: Pass/Fail */ - -#qunit-tests { - list-style-position: inside; -} - -#qunit-tests li { - padding: 0.4em 0.5em 0.4em 2.5em; - border-bottom: 1px solid #fff; - list-style-position: inside; -} - -#qunit-tests.hidepass li.pass, #qunit-tests.hidepass li.running { - display: none; -} - -#qunit-tests li strong { - cursor: pointer; -} - -#qunit-tests li a { - padding: 0.5em; - color: #c2ccd1; - text-decoration: none; -} -#qunit-tests li a:hover, -#qunit-tests li a:focus { - color: #000; -} - -#qunit-tests li .runtime { - float: right; - font-size: smaller; -} - -.qunit-assert-list { - margin-top: 0.5em; - padding: 0.5em; - - background-color: #fff; - - border-radius: 5px; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; -} - -.qunit-collapsed { - display: none; -} - -#qunit-tests table { - border-collapse: collapse; - margin-top: .2em; -} - -#qunit-tests th { - text-align: right; - vertical-align: top; - padding: 0 .5em 0 0; -} - -#qunit-tests td { - vertical-align: top; -} - -#qunit-tests pre { - margin: 0; - white-space: pre-wrap; - word-wrap: break-word; -} - -#qunit-tests del { - background-color: #e0f2be; - color: #374e0c; - text-decoration: none; -} - -#qunit-tests ins { - background-color: #ffcaca; - color: #500; - text-decoration: none; -} - -/*** Test Counts */ - -#qunit-tests b.counts { color: black; } -#qunit-tests b.passed { color: #5E740B; } -#qunit-tests b.failed { color: #710909; } - -#qunit-tests li li { - padding: 5px; - background-color: #fff; - border-bottom: none; - list-style-position: inside; -} - -/*** Passing Styles */ - -#qunit-tests li li.pass { - color: #3c510c; - background-color: #fff; - border-left: 10px solid #C6E746; -} - -#qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; } -#qunit-tests .pass .test-name { color: #366097; } - -#qunit-tests .pass .test-actual, -#qunit-tests .pass .test-expected { color: #999999; } - -#qunit-banner.qunit-pass { background-color: #C6E746; } - -/*** Failing Styles */ - -#qunit-tests li li.fail { - color: #710909; - background-color: #fff; - border-left: 10px solid #EE5757; - white-space: pre; -} - -#qunit-tests > li:last-child { - border-radius: 0 0 5px 5px; - -moz-border-radius: 0 0 5px 5px; - -webkit-border-bottom-right-radius: 5px; - -webkit-border-bottom-left-radius: 5px; -} - -#qunit-tests .fail { color: #000000; background-color: #EE5757; } -#qunit-tests .fail .test-name, -#qunit-tests .fail .module-name { color: #000000; } - -#qunit-tests .fail .test-actual { color: #EE5757; } -#qunit-tests .fail .test-expected { color: green; } - -#qunit-banner.qunit-fail { background-color: #EE5757; } - - -/** Result */ - -#qunit-testresult { - padding: 0.5em 0.5em 0.5em 2.5em; - - color: #2b81af; - background-color: #D2E0E6; - - border-bottom: 1px solid white; -} -#qunit-testresult .module-name { - font-weight: bold; -} - -/** Fixture */ - -#qunit-fixture { - position: absolute; - top: -10000px; - left: -10000px; - width: 1000px; - height: 1000px; -} \ No newline at end of file diff --git a/tests/qunit/qunit.js b/tests/qunit/qunit.js deleted file mode 100644 index 42cf815..0000000 --- a/tests/qunit/qunit.js +++ /dev/null @@ -1,1977 +0,0 @@ -/** - * QUnit v1.10.0 - A JavaScript Unit Testing Framework - * - * http://qunitjs.com - * - * Copyright 2012 jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license - */ - -(function( window ) { - -var QUnit, - config, - onErrorFnPrev, - testId = 0, - fileName = (sourceFromStacktrace( 0 ) || "" ).replace(/(:\d+)+\)?/, "").replace(/.+\//, ""), - toString = Object.prototype.toString, - hasOwn = Object.prototype.hasOwnProperty, - // Keep a local reference to Date (GH-283) - Date = window.Date, - defined = { - setTimeout: typeof window.setTimeout !== "undefined", - sessionStorage: (function() { - var x = "qunit-test-string"; - try { - sessionStorage.setItem( x, x ); - sessionStorage.removeItem( x ); - return true; - } catch( e ) { - return false; - } - }()) -}; - -function Test( settings ) { - extend( this, settings ); - this.assertions = []; - this.testNumber = ++Test.count; -} - -Test.count = 0; - -Test.prototype = { - init: function() { - var a, b, li, - tests = id( "qunit-tests" ); - - if ( tests ) { - b = document.createElement( "strong" ); - b.innerHTML = this.name; - - // `a` initialized at top of scope - a = document.createElement( "a" ); - a.innerHTML = "Rerun"; - a.href = QUnit.url({ testNumber: this.testNumber }); - - li = document.createElement( "li" ); - li.appendChild( b ); - li.appendChild( a ); - li.className = "running"; - li.id = this.id = "qunit-test-output" + testId++; - - tests.appendChild( li ); - } - }, - setup: function() { - if ( this.module !== config.previousModule ) { - if ( config.previousModule ) { - runLoggingCallbacks( "moduleDone", QUnit, { - name: config.previousModule, - failed: config.moduleStats.bad, - passed: config.moduleStats.all - config.moduleStats.bad, - total: config.moduleStats.all - }); - } - config.previousModule = this.module; - config.moduleStats = { all: 0, bad: 0 }; - runLoggingCallbacks( "moduleStart", QUnit, { - name: this.module - }); - } else if ( config.autorun ) { - runLoggingCallbacks( "moduleStart", QUnit, { - name: this.module - }); - } - - config.current = this; - - this.testEnvironment = extend({ - setup: function() {}, - teardown: function() {} - }, this.moduleTestEnvironment ); - - runLoggingCallbacks( "testStart", QUnit, { - name: this.testName, - module: this.module - }); - - // allow utility functions to access the current test environment - // TODO why?? - QUnit.current_testEnvironment = this.testEnvironment; - - if ( !config.pollution ) { - saveGlobal(); - } - if ( config.notrycatch ) { - this.testEnvironment.setup.call( this.testEnvironment ); - return; - } - try { - this.testEnvironment.setup.call( this.testEnvironment ); - } catch( e ) { - QUnit.pushFailure( "Setup failed on " + this.testName + ": " + e.message, extractStacktrace( e, 1 ) ); - } - }, - run: function() { - config.current = this; - - var running = id( "qunit-testresult" ); - - if ( running ) { - running.innerHTML = "Running:
    " + this.name; - } - - if ( this.async ) { - QUnit.stop(); - } - - if ( config.notrycatch ) { - this.callback.call( this.testEnvironment, QUnit.assert ); - return; - } - - try { - this.callback.call( this.testEnvironment, QUnit.assert ); - } catch( e ) { - QUnit.pushFailure( "Died on test #" + (this.assertions.length + 1) + " " + this.stack + ": " + e.message, extractStacktrace( e, 0 ) ); - // else next test will carry the responsibility - saveGlobal(); - - // Restart the tests if they're blocking - if ( config.blocking ) { - QUnit.start(); - } - } - }, - teardown: function() { - config.current = this; - if ( config.notrycatch ) { - this.testEnvironment.teardown.call( this.testEnvironment ); - return; - } else { - try { - this.testEnvironment.teardown.call( this.testEnvironment ); - } catch( e ) { - QUnit.pushFailure( "Teardown failed on " + this.testName + ": " + e.message, extractStacktrace( e, 1 ) ); - } - } - checkPollution(); - }, - finish: function() { - config.current = this; - if ( config.requireExpects && this.expected == null ) { - QUnit.pushFailure( "Expected number of assertions to be defined, but expect() was not called.", this.stack ); - } else if ( this.expected != null && this.expected != this.assertions.length ) { - QUnit.pushFailure( "Expected " + this.expected + " assertions, but " + this.assertions.length + " were run", this.stack ); - } else if ( this.expected == null && !this.assertions.length ) { - QUnit.pushFailure( "Expected at least one assertion, but none were run - call expect(0) to accept zero assertions.", this.stack ); - } - - var assertion, a, b, i, li, ol, - test = this, - good = 0, - bad = 0, - tests = id( "qunit-tests" ); - - config.stats.all += this.assertions.length; - config.moduleStats.all += this.assertions.length; - - if ( tests ) { - ol = document.createElement( "ol" ); - - for ( i = 0; i < this.assertions.length; i++ ) { - assertion = this.assertions[i]; - - li = document.createElement( "li" ); - li.className = assertion.result ? "pass" : "fail"; - li.innerHTML = assertion.message || ( assertion.result ? "okay" : "failed" ); - ol.appendChild( li ); - - if ( assertion.result ) { - good++; - } else { - bad++; - config.stats.bad++; - config.moduleStats.bad++; - } - } - - // store result when possible - if ( QUnit.config.reorder && defined.sessionStorage ) { - if ( bad ) { - sessionStorage.setItem( "qunit-test-" + this.module + "-" + this.testName, bad ); - } else { - sessionStorage.removeItem( "qunit-test-" + this.module + "-" + this.testName ); - } - } - - if ( bad === 0 ) { - ol.style.display = "none"; - } - - // `b` initialized at top of scope - b = document.createElement( "strong" ); - b.innerHTML = this.name + " (" + bad + ", " + good + ", " + this.assertions.length + ")"; - - addEvent(b, "click", function() { - var next = b.nextSibling.nextSibling, - display = next.style.display; - next.style.display = display === "none" ? "block" : "none"; - }); - - addEvent(b, "dblclick", function( e ) { - var target = e && e.target ? e.target : window.event.srcElement; - if ( target.nodeName.toLowerCase() == "span" || target.nodeName.toLowerCase() == "b" ) { - target = target.parentNode; - } - if ( window.location && target.nodeName.toLowerCase() === "strong" ) { - window.location = QUnit.url({ testNumber: test.testNumber }); - } - }); - - // `li` initialized at top of scope - li = id( this.id ); - li.className = bad ? "fail" : "pass"; - li.removeChild( li.firstChild ); - a = li.firstChild; - li.appendChild( b ); - li.appendChild ( a ); - li.appendChild( ol ); - - } else { - for ( i = 0; i < this.assertions.length; i++ ) { - if ( !this.assertions[i].result ) { - bad++; - config.stats.bad++; - config.moduleStats.bad++; - } - } - } - - runLoggingCallbacks( "testDone", QUnit, { - name: this.testName, - module: this.module, - failed: bad, - passed: this.assertions.length - bad, - total: this.assertions.length - }); - - QUnit.reset(); - - config.current = undefined; - }, - - queue: function() { - var bad, - test = this; - - synchronize(function() { - test.init(); - }); - function run() { - // each of these can by async - synchronize(function() { - test.setup(); - }); - synchronize(function() { - test.run(); - }); - synchronize(function() { - test.teardown(); - }); - synchronize(function() { - test.finish(); - }); - } - - // `bad` initialized at top of scope - // defer when previous test run passed, if storage is available - bad = QUnit.config.reorder && defined.sessionStorage && - +sessionStorage.getItem( "qunit-test-" + this.module + "-" + this.testName ); - - if ( bad ) { - run(); - } else { - synchronize( run, true ); - } - } -}; - -// Root QUnit object. -// `QUnit` initialized at top of scope -QUnit = { - - // call on start of module test to prepend name to all tests - module: function( name, testEnvironment ) { - config.currentModule = name; - config.currentModuleTestEnvironment = testEnvironment; - config.modules[name] = true; - }, - - asyncTest: function( testName, expected, callback ) { - if ( arguments.length === 2 ) { - callback = expected; - expected = null; - } - - QUnit.test( testName, expected, callback, true ); - }, - - test: function( testName, expected, callback, async ) { - var test, - name = "" + escapeInnerText( testName ) + ""; - - if ( arguments.length === 2 ) { - callback = expected; - expected = null; - } - - if ( config.currentModule ) { - name = "" + config.currentModule + ": " + name; - } - - test = new Test({ - name: name, - testName: testName, - expected: expected, - async: async, - callback: callback, - module: config.currentModule, - moduleTestEnvironment: config.currentModuleTestEnvironment, - stack: sourceFromStacktrace( 2 ) - }); - - if ( !validTest( test ) ) { - return; - } - - test.queue(); - }, - - // Specify the number of expected assertions to gurantee that failed test (no assertions are run at all) don't slip through. - expect: function( asserts ) { - if (arguments.length === 1) { - config.current.expected = asserts; - } else { - return config.current.expected; - } - }, - - start: function( count ) { - config.semaphore -= count || 1; - // don't start until equal number of stop-calls - if ( config.semaphore > 0 ) { - return; - } - // ignore if start is called more often then stop - if ( config.semaphore < 0 ) { - config.semaphore = 0; - } - // A slight delay, to avoid any current callbacks - if ( defined.setTimeout ) { - window.setTimeout(function() { - if ( config.semaphore > 0 ) { - return; - } - if ( config.timeout ) { - clearTimeout( config.timeout ); - } - - config.blocking = false; - process( true ); - }, 13); - } else { - config.blocking = false; - process( true ); - } - }, - - stop: function( count ) { - config.semaphore += count || 1; - config.blocking = true; - - if ( config.testTimeout && defined.setTimeout ) { - clearTimeout( config.timeout ); - config.timeout = window.setTimeout(function() { - QUnit.ok( false, "Test timed out" ); - config.semaphore = 1; - QUnit.start(); - }, config.testTimeout ); - } - } -}; - -// Asssert helpers -// All of these must call either QUnit.push() or manually do: -// - runLoggingCallbacks( "log", .. ); -// - config.current.assertions.push({ .. }); -QUnit.assert = { - /** - * Asserts rough true-ish result. - * @name ok - * @function - * @example ok( "asdfasdf".length > 5, "There must be at least 5 chars" ); - */ - ok: function( result, msg ) { - if ( !config.current ) { - throw new Error( "ok() assertion outside test context, was " + sourceFromStacktrace(2) ); - } - result = !!result; - - var source, - details = { - module: config.current.module, - name: config.current.testName, - result: result, - message: msg - }; - - msg = escapeInnerText( msg || (result ? "okay" : "failed" ) ); - msg = "" + msg + ""; - - if ( !result ) { - source = sourceFromStacktrace( 2 ); - if ( source ) { - details.source = source; - msg += "
    Source:
    " + escapeInnerText( source ) + "
    "; - } - } - runLoggingCallbacks( "log", QUnit, details ); - config.current.assertions.push({ - result: result, - message: msg - }); - }, - - /** - * Assert that the first two arguments are equal, with an optional message. - * Prints out both actual and expected values. - * @name equal - * @function - * @example equal( format( "Received {0} bytes.", 2), "Received 2 bytes.", "format() replaces {0} with next argument" ); - */ - equal: function( actual, expected, message ) { - QUnit.push( expected == actual, actual, expected, message ); - }, - - /** - * @name notEqual - * @function - */ - notEqual: function( actual, expected, message ) { - QUnit.push( expected != actual, actual, expected, message ); - }, - - /** - * @name deepEqual - * @function - */ - deepEqual: function( actual, expected, message ) { - QUnit.push( QUnit.equiv(actual, expected), actual, expected, message ); - }, - - /** - * @name notDeepEqual - * @function - */ - notDeepEqual: function( actual, expected, message ) { - QUnit.push( !QUnit.equiv(actual, expected), actual, expected, message ); - }, - - /** - * @name strictEqual - * @function - */ - strictEqual: function( actual, expected, message ) { - QUnit.push( expected === actual, actual, expected, message ); - }, - - /** - * @name notStrictEqual - * @function - */ - notStrictEqual: function( actual, expected, message ) { - QUnit.push( expected !== actual, actual, expected, message ); - }, - - throws: function( block, expected, message ) { - var actual, - ok = false; - - // 'expected' is optional - if ( typeof expected === "string" ) { - message = expected; - expected = null; - } - - config.current.ignoreGlobalErrors = true; - try { - block.call( config.current.testEnvironment ); - } catch (e) { - actual = e; - } - config.current.ignoreGlobalErrors = false; - - if ( actual ) { - // we don't want to validate thrown error - if ( !expected ) { - ok = true; - // expected is a regexp - } else if ( QUnit.objectType( expected ) === "regexp" ) { - ok = expected.test( actual ); - // expected is a constructor - } else if ( actual instanceof expected ) { - ok = true; - // expected is a validation function which returns true is validation passed - } else if ( expected.call( {}, actual ) === true ) { - ok = true; - } - - QUnit.push( ok, actual, null, message ); - } else { - QUnit.pushFailure( message, null, 'No exception was thrown.' ); - } - } -}; - -/** - * @deprecate since 1.8.0 - * Kept assertion helpers in root for backwards compatibility - */ -extend( QUnit, QUnit.assert ); - -/** - * @deprecated since 1.9.0 - * Kept global "raises()" for backwards compatibility - */ -QUnit.raises = QUnit.assert.throws; - -/** - * @deprecated since 1.0.0, replaced with error pushes since 1.3.0 - * Kept to avoid TypeErrors for undefined methods. - */ -QUnit.equals = function() { - QUnit.push( false, false, false, "QUnit.equals has been deprecated since 2009 (e88049a0), use QUnit.equal instead" ); -}; -QUnit.same = function() { - QUnit.push( false, false, false, "QUnit.same has been deprecated since 2009 (e88049a0), use QUnit.deepEqual instead" ); -}; - -// We want access to the constructor's prototype -(function() { - function F() {} - F.prototype = QUnit; - QUnit = new F(); - // Make F QUnit's constructor so that we can add to the prototype later - QUnit.constructor = F; -}()); - -/** - * Config object: Maintain internal state - * Later exposed as QUnit.config - * `config` initialized at top of scope - */ -config = { - // The queue of tests to run - queue: [], - - // block until document ready - blocking: true, - - // when enabled, show only failing tests - // gets persisted through sessionStorage and can be changed in UI via checkbox - hidepassed: false, - - // by default, run previously failed tests first - // very useful in combination with "Hide passed tests" checked - reorder: true, - - // by default, modify document.title when suite is done - altertitle: true, - - // when enabled, all tests must call expect() - requireExpects: false, - - // add checkboxes that are persisted in the query-string - // when enabled, the id is set to `true` as a `QUnit.config` property - urlConfig: [ - { - id: "noglobals", - label: "Check for Globals", - tooltip: "Enabling this will test if any test introduces new properties on the `window` object. Stored as query-strings." - }, - { - id: "notrycatch", - label: "No try-catch", - tooltip: "Enabling this will run tests outside of a try-catch block. Makes debugging exceptions in IE reasonable. Stored as query-strings." - } - ], - - // Set of all modules. - modules: {}, - - // logging callback queues - begin: [], - done: [], - log: [], - testStart: [], - testDone: [], - moduleStart: [], - moduleDone: [] -}; - -// Initialize more QUnit.config and QUnit.urlParams -(function() { - var i, - location = window.location || { search: "", protocol: "file:" }, - params = location.search.slice( 1 ).split( "&" ), - length = params.length, - urlParams = {}, - current; - - if ( params[ 0 ] ) { - for ( i = 0; i < length; i++ ) { - current = params[ i ].split( "=" ); - current[ 0 ] = decodeURIComponent( current[ 0 ] ); - // allow just a key to turn on a flag, e.g., test.html?noglobals - current[ 1 ] = current[ 1 ] ? decodeURIComponent( current[ 1 ] ) : true; - urlParams[ current[ 0 ] ] = current[ 1 ]; - } - } - - QUnit.urlParams = urlParams; - - // String search anywhere in moduleName+testName - config.filter = urlParams.filter; - - // Exact match of the module name - config.module = urlParams.module; - - config.testNumber = parseInt( urlParams.testNumber, 10 ) || null; - - // Figure out if we're running the tests from a server or not - QUnit.isLocal = location.protocol === "file:"; -}()); - -// Export global variables, unless an 'exports' object exists, -// in that case we assume we're in CommonJS (dealt with on the bottom of the script) -if ( typeof exports === "undefined" ) { - extend( window, QUnit ); - - // Expose QUnit object - window.QUnit = QUnit; -} - -// Extend QUnit object, -// these after set here because they should not be exposed as global functions -extend( QUnit, { - config: config, - - // Initialize the configuration options - init: function() { - extend( config, { - stats: { all: 0, bad: 0 }, - moduleStats: { all: 0, bad: 0 }, - started: +new Date(), - updateRate: 1000, - blocking: false, - autostart: true, - autorun: false, - filter: "", - queue: [], - semaphore: 0 - }); - - var tests, banner, result, - qunit = id( "qunit" ); - - if ( qunit ) { - qunit.innerHTML = - "

    " + escapeInnerText( document.title ) + "

    " + - "

    " + - "
    " + - "

    " + - "
      "; - } - - tests = id( "qunit-tests" ); - banner = id( "qunit-banner" ); - result = id( "qunit-testresult" ); - - if ( tests ) { - tests.innerHTML = ""; - } - - if ( banner ) { - banner.className = ""; - } - - if ( result ) { - result.parentNode.removeChild( result ); - } - - if ( tests ) { - result = document.createElement( "p" ); - result.id = "qunit-testresult"; - result.className = "result"; - tests.parentNode.insertBefore( result, tests ); - result.innerHTML = "Running...
       "; - } - }, - - // Resets the test setup. Useful for tests that modify the DOM. - reset: function() { - var fixture = id( "qunit-fixture" ); - if ( fixture ) { - fixture.innerHTML = config.fixture; - } - }, - - // Trigger an event on an element. - // @example triggerEvent( document.body, "click" ); - triggerEvent: function( elem, type, event ) { - if ( document.createEvent ) { - event = document.createEvent( "MouseEvents" ); - event.initMouseEvent(type, true, true, elem.ownerDocument.defaultView, - 0, 0, 0, 0, 0, false, false, false, false, 0, null); - - elem.dispatchEvent( event ); - } else if ( elem.fireEvent ) { - elem.fireEvent( "on" + type ); - } - }, - - // Safe object type checking - is: function( type, obj ) { - return QUnit.objectType( obj ) == type; - }, - - objectType: function( obj ) { - if ( typeof obj === "undefined" ) { - return "undefined"; - // consider: typeof null === object - } - if ( obj === null ) { - return "null"; - } - - var type = toString.call( obj ).match(/^\[object\s(.*)\]$/)[1] || ""; - - switch ( type ) { - case "Number": - if ( isNaN(obj) ) { - return "nan"; - } - return "number"; - case "String": - case "Boolean": - case "Array": - case "Date": - case "RegExp": - case "Function": - return type.toLowerCase(); - } - if ( typeof obj === "object" ) { - return "object"; - } - return undefined; - }, - - push: function( result, actual, expected, message ) { - if ( !config.current ) { - throw new Error( "assertion outside test context, was " + sourceFromStacktrace() ); - } - - var output, source, - details = { - module: config.current.module, - name: config.current.testName, - result: result, - message: message, - actual: actual, - expected: expected - }; - - message = escapeInnerText( message ) || ( result ? "okay" : "failed" ); - message = "" + message + ""; - output = message; - - if ( !result ) { - expected = escapeInnerText( QUnit.jsDump.parse(expected) ); - actual = escapeInnerText( QUnit.jsDump.parse(actual) ); - output += ""; - - if ( actual != expected ) { - output += ""; - output += ""; - } - - source = sourceFromStacktrace(); - - if ( source ) { - details.source = source; - output += ""; - } - - output += "
      Expected:
      " + expected + "
      Result:
      " + actual + "
      Diff:
      " + QUnit.diff( expected, actual ) + "
      Source:
      " + escapeInnerText( source ) + "
      "; - } - - runLoggingCallbacks( "log", QUnit, details ); - - config.current.assertions.push({ - result: !!result, - message: output - }); - }, - - pushFailure: function( message, source, actual ) { - if ( !config.current ) { - throw new Error( "pushFailure() assertion outside test context, was " + sourceFromStacktrace(2) ); - } - - var output, - details = { - module: config.current.module, - name: config.current.testName, - result: false, - message: message - }; - - message = escapeInnerText( message ) || "error"; - message = "" + message + ""; - output = message; - - output += ""; - - if ( actual ) { - output += ""; - } - - if ( source ) { - details.source = source; - output += ""; - } - - output += "
      Result:
      " + escapeInnerText( actual ) + "
      Source:
      " + escapeInnerText( source ) + "
      "; - - runLoggingCallbacks( "log", QUnit, details ); - - config.current.assertions.push({ - result: false, - message: output - }); - }, - - url: function( params ) { - params = extend( extend( {}, QUnit.urlParams ), params ); - var key, - querystring = "?"; - - for ( key in params ) { - if ( !hasOwn.call( params, key ) ) { - continue; - } - querystring += encodeURIComponent( key ) + "=" + - encodeURIComponent( params[ key ] ) + "&"; - } - return window.location.pathname + querystring.slice( 0, -1 ); - }, - - extend: extend, - id: id, - addEvent: addEvent - // load, equiv, jsDump, diff: Attached later -}); - -/** - * @deprecated: Created for backwards compatibility with test runner that set the hook function - * into QUnit.{hook}, instead of invoking it and passing the hook function. - * QUnit.constructor is set to the empty F() above so that we can add to it's prototype here. - * Doing this allows us to tell if the following methods have been overwritten on the actual - * QUnit object. - */ -extend( QUnit.constructor.prototype, { - - // Logging callbacks; all receive a single argument with the listed properties - // run test/logs.html for any related changes - begin: registerLoggingCallback( "begin" ), - - // done: { failed, passed, total, runtime } - done: registerLoggingCallback( "done" ), - - // log: { result, actual, expected, message } - log: registerLoggingCallback( "log" ), - - // testStart: { name } - testStart: registerLoggingCallback( "testStart" ), - - // testDone: { name, failed, passed, total } - testDone: registerLoggingCallback( "testDone" ), - - // moduleStart: { name } - moduleStart: registerLoggingCallback( "moduleStart" ), - - // moduleDone: { name, failed, passed, total } - moduleDone: registerLoggingCallback( "moduleDone" ) -}); - -if ( typeof document === "undefined" || document.readyState === "complete" ) { - config.autorun = true; -} - -QUnit.load = function() { - runLoggingCallbacks( "begin", QUnit, {} ); - - // Initialize the config, saving the execution queue - var banner, filter, i, label, len, main, ol, toolbar, userAgent, val, urlConfigCheckboxes, moduleFilter, - numModules = 0, - moduleFilterHtml = "", - urlConfigHtml = "", - oldconfig = extend( {}, config ); - - QUnit.init(); - extend(config, oldconfig); - - config.blocking = false; - - len = config.urlConfig.length; - - for ( i = 0; i < len; i++ ) { - val = config.urlConfig[i]; - if ( typeof val === "string" ) { - val = { - id: val, - label: val, - tooltip: "[no tooltip available]" - }; - } - config[ val.id ] = QUnit.urlParams[ val.id ]; - urlConfigHtml += ""; - } - - moduleFilterHtml += ""; - - // `userAgent` initialized at top of scope - userAgent = id( "qunit-userAgent" ); - if ( userAgent ) { - userAgent.innerHTML = navigator.userAgent; - } - - // `banner` initialized at top of scope - banner = id( "qunit-header" ); - if ( banner ) { - banner.innerHTML = "" + banner.innerHTML + " "; - } - - // `toolbar` initialized at top of scope - toolbar = id( "qunit-testrunner-toolbar" ); - if ( toolbar ) { - // `filter` initialized at top of scope - filter = document.createElement( "input" ); - filter.type = "checkbox"; - filter.id = "qunit-filter-pass"; - - addEvent( filter, "click", function() { - var tmp, - ol = document.getElementById( "qunit-tests" ); - - if ( filter.checked ) { - ol.className = ol.className + " hidepass"; - } else { - tmp = " " + ol.className.replace( /[\n\t\r]/g, " " ) + " "; - ol.className = tmp.replace( / hidepass /, " " ); - } - if ( defined.sessionStorage ) { - if (filter.checked) { - sessionStorage.setItem( "qunit-filter-passed-tests", "true" ); - } else { - sessionStorage.removeItem( "qunit-filter-passed-tests" ); - } - } - }); - - if ( config.hidepassed || defined.sessionStorage && sessionStorage.getItem( "qunit-filter-passed-tests" ) ) { - filter.checked = true; - // `ol` initialized at top of scope - ol = document.getElementById( "qunit-tests" ); - ol.className = ol.className + " hidepass"; - } - toolbar.appendChild( filter ); - - // `label` initialized at top of scope - label = document.createElement( "label" ); - label.setAttribute( "for", "qunit-filter-pass" ); - label.setAttribute( "title", "Only show tests and assertons that fail. Stored in sessionStorage." ); - label.innerHTML = "Hide passed tests"; - toolbar.appendChild( label ); - - urlConfigCheckboxes = document.createElement( 'span' ); - urlConfigCheckboxes.innerHTML = urlConfigHtml; - addEvent( urlConfigCheckboxes, "change", function( event ) { - var params = {}; - params[ event.target.name ] = event.target.checked ? true : undefined; - window.location = QUnit.url( params ); - }); - toolbar.appendChild( urlConfigCheckboxes ); - - if (numModules > 1) { - moduleFilter = document.createElement( 'span' ); - moduleFilter.setAttribute( 'id', 'qunit-modulefilter-container' ); - moduleFilter.innerHTML = moduleFilterHtml; - addEvent( moduleFilter, "change", function() { - var selectBox = moduleFilter.getElementsByTagName("select")[0], - selectedModule = decodeURIComponent(selectBox.options[selectBox.selectedIndex].value); - - window.location = QUnit.url( { module: ( selectedModule === "" ) ? undefined : selectedModule } ); - }); - toolbar.appendChild(moduleFilter); - } - } - - // `main` initialized at top of scope - main = id( "qunit-fixture" ); - if ( main ) { - config.fixture = main.innerHTML; - } - - if ( config.autostart ) { - QUnit.start(); - } -}; - -addEvent( window, "load", QUnit.load ); - -// `onErrorFnPrev` initialized at top of scope -// Preserve other handlers -onErrorFnPrev = window.onerror; - -// Cover uncaught exceptions -// Returning true will surpress the default browser handler, -// returning false will let it run. -window.onerror = function ( error, filePath, linerNr ) { - var ret = false; - if ( onErrorFnPrev ) { - ret = onErrorFnPrev( error, filePath, linerNr ); - } - - // Treat return value as window.onerror itself does, - // Only do our handling if not surpressed. - if ( ret !== true ) { - if ( QUnit.config.current ) { - if ( QUnit.config.current.ignoreGlobalErrors ) { - return true; - } - QUnit.pushFailure( error, filePath + ":" + linerNr ); - } else { - QUnit.test( "global failure", extend( function() { - QUnit.pushFailure( error, filePath + ":" + linerNr ); - }, { validTest: validTest } ) ); - } - return false; - } - - return ret; -}; - -function done() { - config.autorun = true; - - // Log the last module results - if ( config.currentModule ) { - runLoggingCallbacks( "moduleDone", QUnit, { - name: config.currentModule, - failed: config.moduleStats.bad, - passed: config.moduleStats.all - config.moduleStats.bad, - total: config.moduleStats.all - }); - } - - var i, key, - banner = id( "qunit-banner" ), - tests = id( "qunit-tests" ), - runtime = +new Date() - config.started, - passed = config.stats.all - config.stats.bad, - html = [ - "Tests completed in ", - runtime, - " milliseconds.
      ", - "", - passed, - " tests of ", - config.stats.all, - " passed, ", - config.stats.bad, - " failed." - ].join( "" ); - - if ( banner ) { - banner.className = ( config.stats.bad ? "qunit-fail" : "qunit-pass" ); - } - - if ( tests ) { - id( "qunit-testresult" ).innerHTML = html; - } - - if ( config.altertitle && typeof document !== "undefined" && document.title ) { - // show ✖ for good, ✔ for bad suite result in title - // use escape sequences in case file gets loaded with non-utf-8-charset - document.title = [ - ( config.stats.bad ? "\u2716" : "\u2714" ), - document.title.replace( /^[\u2714\u2716] /i, "" ) - ].join( " " ); - } - - // clear own sessionStorage items if all tests passed - if ( config.reorder && defined.sessionStorage && config.stats.bad === 0 ) { - // `key` & `i` initialized at top of scope - for ( i = 0; i < sessionStorage.length; i++ ) { - key = sessionStorage.key( i++ ); - if ( key.indexOf( "qunit-test-" ) === 0 ) { - sessionStorage.removeItem( key ); - } - } - } - - // scroll back to top to show results - if ( window.scrollTo ) { - window.scrollTo(0, 0); - } - - runLoggingCallbacks( "done", QUnit, { - failed: config.stats.bad, - passed: passed, - total: config.stats.all, - runtime: runtime - }); -} - -/** @return Boolean: true if this test should be ran */ -function validTest( test ) { - var include, - filter = config.filter && config.filter.toLowerCase(), - module = config.module && config.module.toLowerCase(), - fullName = (test.module + ": " + test.testName).toLowerCase(); - - // Internally-generated tests are always valid - if ( test.callback && test.callback.validTest === validTest ) { - delete test.callback.validTest; - return true; - } - - if ( config.testNumber ) { - return test.testNumber === config.testNumber; - } - - if ( module && ( !test.module || test.module.toLowerCase() !== module ) ) { - return false; - } - - if ( !filter ) { - return true; - } - - include = filter.charAt( 0 ) !== "!"; - if ( !include ) { - filter = filter.slice( 1 ); - } - - // If the filter matches, we need to honour include - if ( fullName.indexOf( filter ) !== -1 ) { - return include; - } - - // Otherwise, do the opposite - return !include; -} - -// so far supports only Firefox, Chrome and Opera (buggy), Safari (for real exceptions) -// Later Safari and IE10 are supposed to support error.stack as well -// See also https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error/Stack -function extractStacktrace( e, offset ) { - offset = offset === undefined ? 3 : offset; - - var stack, include, i, regex; - - if ( e.stacktrace ) { - // Opera - return e.stacktrace.split( "\n" )[ offset + 3 ]; - } else if ( e.stack ) { - // Firefox, Chrome - stack = e.stack.split( "\n" ); - if (/^error$/i.test( stack[0] ) ) { - stack.shift(); - } - if ( fileName ) { - include = []; - for ( i = offset; i < stack.length; i++ ) { - if ( stack[ i ].indexOf( fileName ) != -1 ) { - break; - } - include.push( stack[ i ] ); - } - if ( include.length ) { - return include.join( "\n" ); - } - } - return stack[ offset ]; - } else if ( e.sourceURL ) { - // Safari, PhantomJS - // hopefully one day Safari provides actual stacktraces - // exclude useless self-reference for generated Error objects - if ( /qunit.js$/.test( e.sourceURL ) ) { - return; - } - // for actual exceptions, this is useful - return e.sourceURL + ":" + e.line; - } -} -function sourceFromStacktrace( offset ) { - try { - throw new Error(); - } catch ( e ) { - return extractStacktrace( e, offset ); - } -} - -function escapeInnerText( s ) { - if ( !s ) { - return ""; - } - s = s + ""; - return s.replace( /[\&<>]/g, function( s ) { - switch( s ) { - case "&": return "&"; - case "<": return "<"; - case ">": return ">"; - default: return s; - } - }); -} - -function synchronize( callback, last ) { - config.queue.push( callback ); - - if ( config.autorun && !config.blocking ) { - process( last ); - } -} - -function process( last ) { - function next() { - process( last ); - } - var start = new Date().getTime(); - config.depth = config.depth ? config.depth + 1 : 1; - - while ( config.queue.length && !config.blocking ) { - if ( !defined.setTimeout || config.updateRate <= 0 || ( ( new Date().getTime() - start ) < config.updateRate ) ) { - config.queue.shift()(); - } else { - window.setTimeout( next, 13 ); - break; - } - } - config.depth--; - if ( last && !config.blocking && !config.queue.length && config.depth === 0 ) { - done(); - } -} - -function saveGlobal() { - config.pollution = []; - - if ( config.noglobals ) { - for ( var key in window ) { - // in Opera sometimes DOM element ids show up here, ignore them - if ( !hasOwn.call( window, key ) || /^qunit-test-output/.test( key ) ) { - continue; - } - config.pollution.push( key ); - } - } -} - -function checkPollution( name ) { - var newGlobals, - deletedGlobals, - old = config.pollution; - - saveGlobal(); - - newGlobals = diff( config.pollution, old ); - if ( newGlobals.length > 0 ) { - QUnit.pushFailure( "Introduced global variable(s): " + newGlobals.join(", ") ); - } - - deletedGlobals = diff( old, config.pollution ); - if ( deletedGlobals.length > 0 ) { - QUnit.pushFailure( "Deleted global variable(s): " + deletedGlobals.join(", ") ); - } -} - -// returns a new Array with the elements that are in a but not in b -function diff( a, b ) { - var i, j, - result = a.slice(); - - for ( i = 0; i < result.length; i++ ) { - for ( j = 0; j < b.length; j++ ) { - if ( result[i] === b[j] ) { - result.splice( i, 1 ); - i--; - break; - } - } - } - return result; -} - -function extend( a, b ) { - for ( var prop in b ) { - if ( b[ prop ] === undefined ) { - delete a[ prop ]; - - // Avoid "Member not found" error in IE8 caused by setting window.constructor - } else if ( prop !== "constructor" || a !== window ) { - a[ prop ] = b[ prop ]; - } - } - - return a; -} - -function addEvent( elem, type, fn ) { - if ( elem.addEventListener ) { - elem.addEventListener( type, fn, false ); - } else if ( elem.attachEvent ) { - elem.attachEvent( "on" + type, fn ); - } else { - fn(); - } -} - -function id( name ) { - return !!( typeof document !== "undefined" && document && document.getElementById ) && - document.getElementById( name ); -} - -function registerLoggingCallback( key ) { - return function( callback ) { - config[key].push( callback ); - }; -} - -// Supports deprecated method of completely overwriting logging callbacks -function runLoggingCallbacks( key, scope, args ) { - //debugger; - var i, callbacks; - if ( QUnit.hasOwnProperty( key ) ) { - QUnit[ key ].call(scope, args ); - } else { - callbacks = config[ key ]; - for ( i = 0; i < callbacks.length; i++ ) { - callbacks[ i ].call( scope, args ); - } - } -} - -// Test for equality any JavaScript type. -// Author: Philippe Rathé -QUnit.equiv = (function() { - - // Call the o related callback with the given arguments. - function bindCallbacks( o, callbacks, args ) { - var prop = QUnit.objectType( o ); - if ( prop ) { - if ( QUnit.objectType( callbacks[ prop ] ) === "function" ) { - return callbacks[ prop ].apply( callbacks, args ); - } else { - return callbacks[ prop ]; // or undefined - } - } - } - - // the real equiv function - var innerEquiv, - // stack to decide between skip/abort functions - callers = [], - // stack to avoiding loops from circular referencing - parents = [], - - getProto = Object.getPrototypeOf || function ( obj ) { - return obj.__proto__; - }, - callbacks = (function () { - - // for string, boolean, number and null - function useStrictEquality( b, a ) { - if ( b instanceof a.constructor || a instanceof b.constructor ) { - // to catch short annotaion VS 'new' annotation of a - // declaration - // e.g. var i = 1; - // var j = new Number(1); - return a == b; - } else { - return a === b; - } - } - - return { - "string": useStrictEquality, - "boolean": useStrictEquality, - "number": useStrictEquality, - "null": useStrictEquality, - "undefined": useStrictEquality, - - "nan": function( b ) { - return isNaN( b ); - }, - - "date": function( b, a ) { - return QUnit.objectType( b ) === "date" && a.valueOf() === b.valueOf(); - }, - - "regexp": function( b, a ) { - return QUnit.objectType( b ) === "regexp" && - // the regex itself - a.source === b.source && - // and its modifers - a.global === b.global && - // (gmi) ... - a.ignoreCase === b.ignoreCase && - a.multiline === b.multiline && - a.sticky === b.sticky; - }, - - // - skip when the property is a method of an instance (OOP) - // - abort otherwise, - // initial === would have catch identical references anyway - "function": function() { - var caller = callers[callers.length - 1]; - return caller !== Object && typeof caller !== "undefined"; - }, - - "array": function( b, a ) { - var i, j, len, loop; - - // b could be an object literal here - if ( QUnit.objectType( b ) !== "array" ) { - return false; - } - - len = a.length; - if ( len !== b.length ) { - // safe and faster - return false; - } - - // track reference to avoid circular references - parents.push( a ); - for ( i = 0; i < len; i++ ) { - loop = false; - for ( j = 0; j < parents.length; j++ ) { - if ( parents[j] === a[i] ) { - loop = true;// dont rewalk array - } - } - if ( !loop && !innerEquiv(a[i], b[i]) ) { - parents.pop(); - return false; - } - } - parents.pop(); - return true; - }, - - "object": function( b, a ) { - var i, j, loop, - // Default to true - eq = true, - aProperties = [], - bProperties = []; - - // comparing constructors is more strict than using - // instanceof - if ( a.constructor !== b.constructor ) { - // Allow objects with no prototype to be equivalent to - // objects with Object as their constructor. - if ( !(( getProto(a) === null && getProto(b) === Object.prototype ) || - ( getProto(b) === null && getProto(a) === Object.prototype ) ) ) { - return false; - } - } - - // stack constructor before traversing properties - callers.push( a.constructor ); - // track reference to avoid circular references - parents.push( a ); - - for ( i in a ) { // be strict: don't ensures hasOwnProperty - // and go deep - loop = false; - for ( j = 0; j < parents.length; j++ ) { - if ( parents[j] === a[i] ) { - // don't go down the same path twice - loop = true; - } - } - aProperties.push(i); // collect a's properties - - if (!loop && !innerEquiv( a[i], b[i] ) ) { - eq = false; - break; - } - } - - callers.pop(); // unstack, we are done - parents.pop(); - - for ( i in b ) { - bProperties.push( i ); // collect b's properties - } - - // Ensures identical properties name - return eq && innerEquiv( aProperties.sort(), bProperties.sort() ); - } - }; - }()); - - innerEquiv = function() { // can take multiple arguments - var args = [].slice.apply( arguments ); - if ( args.length < 2 ) { - return true; // end transition - } - - return (function( a, b ) { - if ( a === b ) { - return true; // catch the most you can - } else if ( a === null || b === null || typeof a === "undefined" || - typeof b === "undefined" || - QUnit.objectType(a) !== QUnit.objectType(b) ) { - return false; // don't lose time with error prone cases - } else { - return bindCallbacks(a, callbacks, [ b, a ]); - } - - // apply transition with (1..n) arguments - }( args[0], args[1] ) && arguments.callee.apply( this, args.splice(1, args.length - 1 )) ); - }; - - return innerEquiv; -}()); - -/** - * jsDump Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com | - * http://flesler.blogspot.com Licensed under BSD - * (http://www.opensource.org/licenses/bsd-license.php) Date: 5/15/2008 - * - * @projectDescription Advanced and extensible data dumping for Javascript. - * @version 1.0.0 - * @author Ariel Flesler - * @link {http://flesler.blogspot.com/2008/05/jsdump-pretty-dump-of-any-javascript.html} - */ -QUnit.jsDump = (function() { - function quote( str ) { - return '"' + str.toString().replace( /"/g, '\\"' ) + '"'; - } - function literal( o ) { - return o + ""; - } - function join( pre, arr, post ) { - var s = jsDump.separator(), - base = jsDump.indent(), - inner = jsDump.indent(1); - if ( arr.join ) { - arr = arr.join( "," + s + inner ); - } - if ( !arr ) { - return pre + post; - } - return [ pre, inner + arr, base + post ].join(s); - } - function array( arr, stack ) { - var i = arr.length, ret = new Array(i); - this.up(); - while ( i-- ) { - ret[i] = this.parse( arr[i] , undefined , stack); - } - this.down(); - return join( "[", ret, "]" ); - } - - var reName = /^function (\w+)/, - jsDump = { - parse: function( obj, type, stack ) { //type is used mostly internally, you can fix a (custom)type in advance - stack = stack || [ ]; - var inStack, res, - parser = this.parsers[ type || this.typeOf(obj) ]; - - type = typeof parser; - inStack = inArray( obj, stack ); - - if ( inStack != -1 ) { - return "recursion(" + (inStack - stack.length) + ")"; - } - //else - if ( type == "function" ) { - stack.push( obj ); - res = parser.call( this, obj, stack ); - stack.pop(); - return res; - } - // else - return ( type == "string" ) ? parser : this.parsers.error; - }, - typeOf: function( obj ) { - var type; - if ( obj === null ) { - type = "null"; - } else if ( typeof obj === "undefined" ) { - type = "undefined"; - } else if ( QUnit.is( "regexp", obj) ) { - type = "regexp"; - } else if ( QUnit.is( "date", obj) ) { - type = "date"; - } else if ( QUnit.is( "function", obj) ) { - type = "function"; - } else if ( typeof obj.setInterval !== undefined && typeof obj.document !== "undefined" && typeof obj.nodeType === "undefined" ) { - type = "window"; - } else if ( obj.nodeType === 9 ) { - type = "document"; - } else if ( obj.nodeType ) { - type = "node"; - } else if ( - // native arrays - toString.call( obj ) === "[object Array]" || - // NodeList objects - ( typeof obj.length === "number" && typeof obj.item !== "undefined" && ( obj.length ? obj.item(0) === obj[0] : ( obj.item( 0 ) === null && typeof obj[0] === "undefined" ) ) ) - ) { - type = "array"; - } else { - type = typeof obj; - } - return type; - }, - separator: function() { - return this.multiline ? this.HTML ? "
      " : "\n" : this.HTML ? " " : " "; - }, - indent: function( extra ) {// extra can be a number, shortcut for increasing-calling-decreasing - if ( !this.multiline ) { - return ""; - } - var chr = this.indentChar; - if ( this.HTML ) { - chr = chr.replace( /\t/g, " " ).replace( / /g, " " ); - } - return new Array( this._depth_ + (extra||0) ).join(chr); - }, - up: function( a ) { - this._depth_ += a || 1; - }, - down: function( a ) { - this._depth_ -= a || 1; - }, - setParser: function( name, parser ) { - this.parsers[name] = parser; - }, - // The next 3 are exposed so you can use them - quote: quote, - literal: literal, - join: join, - // - _depth_: 1, - // This is the list of parsers, to modify them, use jsDump.setParser - parsers: { - window: "[Window]", - document: "[Document]", - error: "[ERROR]", //when no parser is found, shouldn"t happen - unknown: "[Unknown]", - "null": "null", - "undefined": "undefined", - "function": function( fn ) { - var ret = "function", - name = "name" in fn ? fn.name : (reName.exec(fn) || [])[1];//functions never have name in IE - - if ( name ) { - ret += " " + name; - } - ret += "( "; - - ret = [ ret, QUnit.jsDump.parse( fn, "functionArgs" ), "){" ].join( "" ); - return join( ret, QUnit.jsDump.parse(fn,"functionCode" ), "}" ); - }, - array: array, - nodelist: array, - "arguments": array, - object: function( map, stack ) { - var ret = [ ], keys, key, val, i; - QUnit.jsDump.up(); - if ( Object.keys ) { - keys = Object.keys( map ); - } else { - keys = []; - for ( key in map ) { - keys.push( key ); - } - } - keys.sort(); - for ( i = 0; i < keys.length; i++ ) { - key = keys[ i ]; - val = map[ key ]; - ret.push( QUnit.jsDump.parse( key, "key" ) + ": " + QUnit.jsDump.parse( val, undefined, stack ) ); - } - QUnit.jsDump.down(); - return join( "{", ret, "}" ); - }, - node: function( node ) { - var a, val, - open = QUnit.jsDump.HTML ? "<" : "<", - close = QUnit.jsDump.HTML ? ">" : ">", - tag = node.nodeName.toLowerCase(), - ret = open + tag; - - for ( a in QUnit.jsDump.DOMAttrs ) { - val = node[ QUnit.jsDump.DOMAttrs[a] ]; - if ( val ) { - ret += " " + a + "=" + QUnit.jsDump.parse( val, "attribute" ); - } - } - return ret + close + open + "/" + tag + close; - }, - functionArgs: function( fn ) {//function calls it internally, it's the arguments part of the function - var args, - l = fn.length; - - if ( !l ) { - return ""; - } - - args = new Array(l); - while ( l-- ) { - args[l] = String.fromCharCode(97+l);//97 is 'a' - } - return " " + args.join( ", " ) + " "; - }, - key: quote, //object calls it internally, the key part of an item in a map - functionCode: "[code]", //function calls it internally, it's the content of the function - attribute: quote, //node calls it internally, it's an html attribute value - string: quote, - date: quote, - regexp: literal, //regex - number: literal, - "boolean": literal - }, - DOMAttrs: { - //attributes to dump from nodes, name=>realName - id: "id", - name: "name", - "class": "className" - }, - HTML: false,//if true, entities are escaped ( <, >, \t, space and \n ) - indentChar: " ",//indentation unit - multiline: true //if true, items in a collection, are separated by a \n, else just a space. - }; - - return jsDump; -}()); - -// from Sizzle.js -function getText( elems ) { - var i, elem, - ret = ""; - - for ( i = 0; elems[i]; i++ ) { - elem = elems[i]; - - // Get the text from text nodes and CDATA nodes - if ( elem.nodeType === 3 || elem.nodeType === 4 ) { - ret += elem.nodeValue; - - // Traverse everything else, except comment nodes - } else if ( elem.nodeType !== 8 ) { - ret += getText( elem.childNodes ); - } - } - - return ret; -} - -// from jquery.js -function inArray( elem, array ) { - if ( array.indexOf ) { - return array.indexOf( elem ); - } - - for ( var i = 0, length = array.length; i < length; i++ ) { - if ( array[ i ] === elem ) { - return i; - } - } - - return -1; -} - -/* - * Javascript Diff Algorithm - * By John Resig (http://ejohn.org/) - * Modified by Chu Alan "sprite" - * - * Released under the MIT license. - * - * More Info: - * http://ejohn.org/projects/javascript-diff-algorithm/ - * - * Usage: QUnit.diff(expected, actual) - * - * QUnit.diff( "the quick brown fox jumped over", "the quick fox jumps over" ) == "the quick brown fox jumped jumps over" - */ -QUnit.diff = (function() { - function diff( o, n ) { - var i, - ns = {}, - os = {}; - - for ( i = 0; i < n.length; i++ ) { - if ( ns[ n[i] ] == null ) { - ns[ n[i] ] = { - rows: [], - o: null - }; - } - ns[ n[i] ].rows.push( i ); - } - - for ( i = 0; i < o.length; i++ ) { - if ( os[ o[i] ] == null ) { - os[ o[i] ] = { - rows: [], - n: null - }; - } - os[ o[i] ].rows.push( i ); - } - - for ( i in ns ) { - if ( !hasOwn.call( ns, i ) ) { - continue; - } - if ( ns[i].rows.length == 1 && typeof os[i] != "undefined" && os[i].rows.length == 1 ) { - n[ ns[i].rows[0] ] = { - text: n[ ns[i].rows[0] ], - row: os[i].rows[0] - }; - o[ os[i].rows[0] ] = { - text: o[ os[i].rows[0] ], - row: ns[i].rows[0] - }; - } - } - - for ( i = 0; i < n.length - 1; i++ ) { - if ( n[i].text != null && n[ i + 1 ].text == null && n[i].row + 1 < o.length && o[ n[i].row + 1 ].text == null && - n[ i + 1 ] == o[ n[i].row + 1 ] ) { - - n[ i + 1 ] = { - text: n[ i + 1 ], - row: n[i].row + 1 - }; - o[ n[i].row + 1 ] = { - text: o[ n[i].row + 1 ], - row: i + 1 - }; - } - } - - for ( i = n.length - 1; i > 0; i-- ) { - if ( n[i].text != null && n[ i - 1 ].text == null && n[i].row > 0 && o[ n[i].row - 1 ].text == null && - n[ i - 1 ] == o[ n[i].row - 1 ]) { - - n[ i - 1 ] = { - text: n[ i - 1 ], - row: n[i].row - 1 - }; - o[ n[i].row - 1 ] = { - text: o[ n[i].row - 1 ], - row: i - 1 - }; - } - } - - return { - o: o, - n: n - }; - } - - return function( o, n ) { - o = o.replace( /\s+$/, "" ); - n = n.replace( /\s+$/, "" ); - - var i, pre, - str = "", - out = diff( o === "" ? [] : o.split(/\s+/), n === "" ? [] : n.split(/\s+/) ), - oSpace = o.match(/\s+/g), - nSpace = n.match(/\s+/g); - - if ( oSpace == null ) { - oSpace = [ " " ]; - } - else { - oSpace.push( " " ); - } - - if ( nSpace == null ) { - nSpace = [ " " ]; - } - else { - nSpace.push( " " ); - } - - if ( out.n.length === 0 ) { - for ( i = 0; i < out.o.length; i++ ) { - str += "" + out.o[i] + oSpace[i] + ""; - } - } - else { - if ( out.n[0].text == null ) { - for ( n = 0; n < out.o.length && out.o[n].text == null; n++ ) { - str += "" + out.o[n] + oSpace[n] + ""; - } - } - - for ( i = 0; i < out.n.length; i++ ) { - if (out.n[i].text == null) { - str += "" + out.n[i] + nSpace[i] + ""; - } - else { - // `pre` initialized at top of scope - pre = ""; - - for ( n = out.n[i].row + 1; n < out.o.length && out.o[n].text == null; n++ ) { - pre += "" + out.o[n] + oSpace[n] + ""; - } - str += " " + out.n[i].text + nSpace[i] + pre; - } - } - } - - return str; - }; -}()); - -// for CommonJS enviroments, export everything -if ( typeof exports !== "undefined" ) { - extend(exports, QUnit); -} - -// get at whatever the global object is, like window in browsers -}( (function() {return this;}.call()) )); \ No newline at end of file diff --git a/tests/tests.js b/tests/tests.js deleted file mode 100644 index 8731178..0000000 --- a/tests/tests.js +++ /dev/null @@ -1,234 +0,0 @@ -test('merge', function() { - - deepEqual( - - merge({ a: 1 }, { b: 2 }), - - { a: 1, b: 2 } - - ); - - deepEqual( - - merge({ a: 1 }, { b: { c: { d: 2 } } }), - - { a: 1, b: { c: { d: 2 } } } - - ); - - deepEqual( - - merge(), {} - - ); - - deepEqual( - - merge(undefined), {} - - ); - - deepEqual( - - merge([]), {} - - ); - - deepEqual( - - merge(true), {} - - ); - - deepEqual( - - merge(null, true, [0, 1, 2], 3, { a: 1 }, function() {}, undefined, { b: 2 }), - - { a: 1, b: 2 } - - ); - -}); - -test('merge (prototype pollution attack)', function() { - - deepEqual( - - merge({}, JSON.parse('{"__proto__": {"a": true}}')), - {} - - ); - - deepEqual( - - {}.a, - - undefined - - ); - -}); - -test('merge (clone)', function() { - - var input = { - - a: 1, - b: { - - c: { - - d: 2, - - e: ['x', 'y', { z: { w: ['k'] }}] - - } - - }, - - f: null, - g: undefined, - h: true - - }, original = { - - a: 1, - b: { - - c: { - - d: 2, - - e: ['x', 'y', { z: { w: ['k'] }}] - - } - - }, - - f: null, - g: undefined, - h: true - - }, output = merge(true, input); - - input.b.c.d++; - input.b.c.e[2].z.w = null; - input.h = null; - - deepEqual(original, output); - - input = original; - - output = merge(true, input, { a: 2 }); - - deepEqual(output.a, 2); - deepEqual(input.a, 1); - -}); - -test('merge.recursive', function() { - - deepEqual( - - merge.recursive({ a: { b: 1 } }, { a : { c: 1 }}), - - { a: { b: 1, c: 1 } } - - ); - - deepEqual( - - merge.recursive({ a: { b: 1, c: 1 } }, { a : { b: 2 }}), - - { a: { b: 2, c: 1 } } - - ); - - deepEqual( - - merge.recursive({ a: { b: [1, 2, 3], c: 1 } }, { a : { b: ['a'] }}), - - { a: { b: ['a'], c: 1 } } - - ); - - deepEqual( - - merge.recursive({ a: { b: { b: 2 }, c: 1 } }, { a : { b: 2 }}), - - { a: { b: 2, c: 1 } } - - ); - -}); - -test('merge.recursive (prototype pollution attack)', function() { - - deepEqual( - - merge.recursive({}, JSON.parse('{"__proto__": {"a": true}}')), - {} - - ); - - deepEqual( - - {}.a, - - undefined - - ); - -}); - -test('merge.recursive (clone)', function() { - - var input = { a: { b: 1 } }; - - deepEqual( - - merge.recursive(true, input, { a : { c: 1 }}), - - { a: { b: 1, c: 1 } } - - ); - - deepEqual({ a: { b: 1 } }, input); - - input = { a: { b: 1, c: 1 } }; - - deepEqual( - - merge.recursive(true, input, { a : { b: 2 }}), - - { a: { b: 2, c: 1 } } - - ); - - deepEqual({ a: { b: 1, c: 1 } }, input); - - input = { a: { b: [1, 2, 3], c: 1 } }; - - deepEqual( - - merge.recursive(true, input, { a : { b: ['a'] }}), - - { a: { b: ['a'], c: 1 } } - - ); - - deepEqual({ a: { b: [1, 2, 3], c: 1 } }, input); - - input = { a: { b: { b: 2 }, c: 1 } }; - - deepEqual( - - merge.recursive(true, input, { a : { b: 2 }}), - - { a: { b: 2, c: 1 } } - - ); - - deepEqual({ a: { b: { b: 2 }, c: 1 } }, input); - -}); \ No newline at end of file From da8d5a957fbec139237cd715a7fc000038734f3c Mon Sep 17 00:00:00 2001 From: yeikos Date: Sun, 28 Jul 2019 16:38:42 +0200 Subject: [PATCH 03/17] build: compiled sources --- dist/merge.browser.min.js | 1 + dist/merge.browser.test.html | 22 +++ dist/merge.browser.test.js | 288 +++++++++++++++++++++++++++++++++++ lib/src/index.d.ts | 20 +++ lib/src/index.js | 77 ++++++++++ lib/test/index.d.ts | 1 + lib/test/index.js | 103 +++++++++++++ 7 files changed, 512 insertions(+) create mode 100644 dist/merge.browser.min.js create mode 100644 dist/merge.browser.test.html create mode 100644 dist/merge.browser.test.js create mode 100644 lib/src/index.d.ts create mode 100644 lib/src/index.js create mode 100644 lib/test/index.d.ts create mode 100644 lib/test/index.js diff --git a/dist/merge.browser.min.js b/dist/merge.browser.min.js new file mode 100644 index 0000000..0c5f5ae --- /dev/null +++ b/dist/merge.browser.min.js @@ -0,0 +1 @@ +var merge=function(r){var e={};function t(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return r[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=r,t.c=e,t.d=function(r,e,n){t.o(r,e)||Object.defineProperty(r,e,{enumerable:!0,get:n})},t.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},t.t=function(r,e){if(1&e&&(r=t(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var o in r)t.d(n,o,function(e){return r[e]}.bind(null,o));return n},t.n=function(r){var e=r&&r.__esModule?function(){return r.default}:function(){return r};return t.d(e,"a",e),e},t.o=function(r,e){return Object.prototype.hasOwnProperty.call(r,e)},t.p="",t(t.s=0)}([function(r,e,t){"use strict";function n(){for(var r=[],e=0;e + + + + Mocha Tests + + + + +
      + + + + + + + \ No newline at end of file diff --git a/dist/merge.browser.test.js b/dist/merge.browser.test.js new file mode 100644 index 0000000..cc725df --- /dev/null +++ b/dist/merge.browser.test.js @@ -0,0 +1,288 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var chai_1 = __webpack_require__(1); +var index_1 = __webpack_require__(2); +describe('merge', function () { + it('basic', function () { + chai_1.assert.deepEqual(index_1.default({ a: 1 }, { b: 2 }), { a: 1, b: 2 }); + chai_1.assert.deepEqual(index_1.default({ a: 1 }, { b: { c: { d: 2 } } }), { a: 1, b: { c: { d: 2 } } }); + }); + it('clone', function () { + var input = { + a: 1, + b: { + c: { + d: 2, + e: ['x', 'y', { z: { w: ['k'] } }] + } + }, + f: null, + g: undefined, + h: true + }; + var original = { + a: 1, + b: { + c: { + d: 2, + e: ['x', 'y', { z: { w: ['k'] } }] + } + }, + f: null, + g: undefined, + h: true + }; + var output = index_1.default(true, input); + input.b.c.d++; + input.b.c.e[2].z.w = null; + input.h = null; + chai_1.assert.deepEqual(original, output); + input = original; + output = index_1.default(true, input, { a: 2 }); + chai_1.assert.deepEqual(output.a, 2); + chai_1.assert.deepEqual(input.a, 1); + }); + it('invalid input', function () { + chai_1.assert.deepEqual(index_1.default(), {}); + chai_1.assert.deepEqual(index_1.default(undefined), {}); + chai_1.assert.deepEqual(index_1.default([]), {}); + chai_1.assert.deepEqual(index_1.default(true), {}); + chai_1.assert.deepEqual(index_1.default(null, true, [0, 1, 2], 3, { a: 1 }, function () { }, undefined, { b: 2 }), { a: 1, b: 2 }); + }); + it('prototype pollution attack', function () { + chai_1.assert.deepEqual(index_1.default({}, JSON.parse('{"__proto__": {"a": true}}')), {}); + }); +}); +describe('merge.clone', function () { + it('object', function () { + var object1 = { a: 1, b: { c: 2 } }; + var object2 = index_1.default.clone(object1); + chai_1.assert.deepEqual(object1, object2); + chai_1.assert.deepEqual(object1 === object2, false); + chai_1.assert.deepEqual(object1.b === object2.b, false); + }); + it('array', function () { + var object1 = [{ a: 1, b: { c: 2 } }]; + var object2 = index_1.default.clone(object1); + chai_1.assert.deepEqual(object1, object2); + chai_1.assert.deepEqual(object1 === object2, false); + chai_1.assert.deepEqual(object1[0] === object2[0], false); + chai_1.assert.deepEqual(object1[0].b === object2[0].b, false); + }); + it('invalid input', function () { + chai_1.assert.deepEqual(index_1.default.clone(null), null); + chai_1.assert.deepEqual(index_1.default.clone(undefined), undefined); + chai_1.assert.deepEqual(index_1.default.clone(1), 1); + chai_1.assert.deepEqual(index_1.default.clone('str'), 'str'); + }); +}); +describe('merge.recursive', function () { + it('basic', function () { + chai_1.assert.deepEqual(index_1.default.recursive({ a: { b: 1 } }, { a: { c: 1 } }), { a: { b: 1, c: 1 } }); + chai_1.assert.deepEqual(index_1.default.recursive({ a: { b: 1, c: 1 } }, { a: { b: 2 } }), { a: { b: 2, c: 1 } }); + chai_1.assert.deepEqual(index_1.default.recursive({ a: { b: [1, 2, 3], c: 1 } }, { a: { b: ['a'] } }), { a: { b: ['a'], c: 1 } }); + chai_1.assert.deepEqual(index_1.default.recursive({ a: { b: { b: 2 }, c: 1 } }, { a: { b: 2 } }), { a: { b: 2, c: 1 } }); + }); + it('clone', function () { + var test1 = { a: { b: 1 } }; + chai_1.assert.deepEqual(index_1.default.recursive(true, test1, { a: { c: 1 } }), { a: { b: 1, c: 1 } }); + chai_1.assert.deepEqual({ a: { b: 1 } }, test1); + var test2 = { a: { b: 1, c: 1 } }; + chai_1.assert.deepEqual(index_1.default.recursive(true, test2, { a: { b: 2 } }), { a: { b: 2, c: 1 } }); + chai_1.assert.deepEqual({ a: { b: 1, c: 1 } }, test2); + var test3 = { a: { b: [1, 2, 3], c: 1 } }; + chai_1.assert.deepEqual(index_1.default.recursive(true, test3, { a: { b: ['a'] } }), { a: { b: ['a'], c: 1 } }); + chai_1.assert.deepEqual({ a: { b: [1, 2, 3], c: 1 } }, test3); + var test4 = { a: { b: { b: 2 }, c: 1 } }; + chai_1.assert.deepEqual(index_1.default.recursive(true, test4, { a: { b: 2 } }), { a: { b: 2, c: 1 } }); + chai_1.assert.deepEqual({ a: { b: { b: 2 }, c: 1 } }, test4); + }); + it('prototype pollution attack', function () { + chai_1.assert.deepEqual(index_1.default.recursive({}, JSON.parse('{"__proto__": {"a": true}}')), {}); + }); +}); + + +/***/ }), +/* 1 */ +/***/ (function(module, exports) { + +module.exports = chai; + +/***/ }), +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +function main() { + var items = []; + for (var _i = 0; _i < arguments.length; _i++) { + items[_i] = arguments[_i]; + } + return merge.apply(void 0, items); +} +exports.default = main; +main.clone = clone; +main.isPlainObject = isPlainObject; +main.recursive = recursive; +function merge() { + var items = []; + for (var _i = 0; _i < arguments.length; _i++) { + items[_i] = arguments[_i]; + } + return _merge(items[0] === true, false, items); +} +exports.merge = merge; +function recursive() { + var items = []; + for (var _i = 0; _i < arguments.length; _i++) { + items[_i] = arguments[_i]; + } + return _merge(items[0] === true, true, items); +} +exports.recursive = recursive; +function clone(input) { + if (Array.isArray(input)) { + var output = []; + for (var index = 0; index < input.length; ++index) + output.push(clone(input[index])); + return output; + } + else if (isPlainObject(input)) { + var output = {}; + for (var index in input) + output[index] = clone(input[index]); + return output; + } + else { + return input; + } +} +exports.clone = clone; +function isPlainObject(input) { + return input && typeof input === 'object' && !Array.isArray(input); +} +exports.isPlainObject = isPlainObject; +function _recursiveMerge(base, extend) { + if (!isPlainObject(base)) + return extend; + for (var key in extend) + base[key] = (isPlainObject(base[key]) && isPlainObject(extend[key])) ? + _recursiveMerge(base[key], extend[key]) : + extend[key]; + return base; +} +function _merge(isClone, isRecursive, items) { + var result; + if (isClone || !isPlainObject(result = items.shift())) + result = {}; + for (var index = 0; index < items.length; ++index) { + var item = items[index]; + if (!isPlainObject(item)) + continue; + for (var key in item) { + if (key === '__proto__') + continue; + var value = isClone ? clone(item[key]) : item[key]; + result[key] = isRecursive ? _recursiveMerge(result[key], value) : value; + } + } + return result; +} + + +/***/ }) +/******/ ]); \ No newline at end of file diff --git a/lib/src/index.d.ts b/lib/src/index.d.ts new file mode 100644 index 0000000..a80d995 --- /dev/null +++ b/lib/src/index.d.ts @@ -0,0 +1,20 @@ +declare function main(clone: boolean, ...items: any[]): any; +declare namespace main { + var clone: typeof import(".").clone; + var isPlainObject: typeof import(".").isPlainObject; + var recursive: typeof import(".").recursive; +} +export default main; +declare function main(...items: any[]): any; +declare namespace main { + var clone: typeof import(".").clone; + var isPlainObject: typeof import(".").isPlainObject; + var recursive: typeof import(".").recursive; +} +export default main; +export declare function merge(clone: boolean, ...items: any[]): any; +export declare function merge(...items: any[]): any; +export declare function recursive(clone: boolean, ...items: any[]): any; +export declare function recursive(...items: any[]): any; +export declare function clone(input: T): T; +export declare function isPlainObject(input: any): input is Object; diff --git a/lib/src/index.js b/lib/src/index.js new file mode 100644 index 0000000..63028e3 --- /dev/null +++ b/lib/src/index.js @@ -0,0 +1,77 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +function main() { + var items = []; + for (var _i = 0; _i < arguments.length; _i++) { + items[_i] = arguments[_i]; + } + return merge.apply(void 0, items); +} +exports.default = main; +main.clone = clone; +main.isPlainObject = isPlainObject; +main.recursive = recursive; +function merge() { + var items = []; + for (var _i = 0; _i < arguments.length; _i++) { + items[_i] = arguments[_i]; + } + return _merge(items[0] === true, false, items); +} +exports.merge = merge; +function recursive() { + var items = []; + for (var _i = 0; _i < arguments.length; _i++) { + items[_i] = arguments[_i]; + } + return _merge(items[0] === true, true, items); +} +exports.recursive = recursive; +function clone(input) { + if (Array.isArray(input)) { + var output = []; + for (var index = 0; index < input.length; ++index) + output.push(clone(input[index])); + return output; + } + else if (isPlainObject(input)) { + var output = {}; + for (var index in input) + output[index] = clone(input[index]); + return output; + } + else { + return input; + } +} +exports.clone = clone; +function isPlainObject(input) { + return input && typeof input === 'object' && !Array.isArray(input); +} +exports.isPlainObject = isPlainObject; +function _recursiveMerge(base, extend) { + if (!isPlainObject(base)) + return extend; + for (var key in extend) + base[key] = (isPlainObject(base[key]) && isPlainObject(extend[key])) ? + _recursiveMerge(base[key], extend[key]) : + extend[key]; + return base; +} +function _merge(isClone, isRecursive, items) { + var result; + if (isClone || !isPlainObject(result = items.shift())) + result = {}; + for (var index = 0; index < items.length; ++index) { + var item = items[index]; + if (!isPlainObject(item)) + continue; + for (var key in item) { + if (key === '__proto__') + continue; + var value = isClone ? clone(item[key]) : item[key]; + result[key] = isRecursive ? _recursiveMerge(result[key], value) : value; + } + } + return result; +} diff --git a/lib/test/index.d.ts b/lib/test/index.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/lib/test/index.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/lib/test/index.js b/lib/test/index.js new file mode 100644 index 0000000..aaa23a7 --- /dev/null +++ b/lib/test/index.js @@ -0,0 +1,103 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var chai_1 = require("chai"); +var index_1 = require("../src/index"); +describe('merge', function () { + it('basic', function () { + chai_1.assert.deepEqual(index_1.default({ a: 1 }, { b: 2 }), { a: 1, b: 2 }); + chai_1.assert.deepEqual(index_1.default({ a: 1 }, { b: { c: { d: 2 } } }), { a: 1, b: { c: { d: 2 } } }); + }); + it('clone', function () { + var input = { + a: 1, + b: { + c: { + d: 2, + e: ['x', 'y', { z: { w: ['k'] } }] + } + }, + f: null, + g: undefined, + h: true + }; + var original = { + a: 1, + b: { + c: { + d: 2, + e: ['x', 'y', { z: { w: ['k'] } }] + } + }, + f: null, + g: undefined, + h: true + }; + var output = index_1.default(true, input); + input.b.c.d++; + input.b.c.e[2].z.w = null; + input.h = null; + chai_1.assert.deepEqual(original, output); + input = original; + output = index_1.default(true, input, { a: 2 }); + chai_1.assert.deepEqual(output.a, 2); + chai_1.assert.deepEqual(input.a, 1); + }); + it('invalid input', function () { + chai_1.assert.deepEqual(index_1.default(), {}); + chai_1.assert.deepEqual(index_1.default(undefined), {}); + chai_1.assert.deepEqual(index_1.default([]), {}); + chai_1.assert.deepEqual(index_1.default(true), {}); + chai_1.assert.deepEqual(index_1.default(null, true, [0, 1, 2], 3, { a: 1 }, function () { }, undefined, { b: 2 }), { a: 1, b: 2 }); + }); + it('prototype pollution attack', function () { + chai_1.assert.deepEqual(index_1.default({}, JSON.parse('{"__proto__": {"a": true}}')), {}); + }); +}); +describe('merge.clone', function () { + it('object', function () { + var object1 = { a: 1, b: { c: 2 } }; + var object2 = index_1.default.clone(object1); + chai_1.assert.deepEqual(object1, object2); + chai_1.assert.deepEqual(object1 === object2, false); + chai_1.assert.deepEqual(object1.b === object2.b, false); + }); + it('array', function () { + var object1 = [{ a: 1, b: { c: 2 } }]; + var object2 = index_1.default.clone(object1); + chai_1.assert.deepEqual(object1, object2); + chai_1.assert.deepEqual(object1 === object2, false); + chai_1.assert.deepEqual(object1[0] === object2[0], false); + chai_1.assert.deepEqual(object1[0].b === object2[0].b, false); + }); + it('invalid input', function () { + chai_1.assert.deepEqual(index_1.default.clone(null), null); + chai_1.assert.deepEqual(index_1.default.clone(undefined), undefined); + chai_1.assert.deepEqual(index_1.default.clone(1), 1); + chai_1.assert.deepEqual(index_1.default.clone('str'), 'str'); + }); +}); +describe('merge.recursive', function () { + it('basic', function () { + chai_1.assert.deepEqual(index_1.default.recursive({ a: { b: 1 } }, { a: { c: 1 } }), { a: { b: 1, c: 1 } }); + chai_1.assert.deepEqual(index_1.default.recursive({ a: { b: 1, c: 1 } }, { a: { b: 2 } }), { a: { b: 2, c: 1 } }); + chai_1.assert.deepEqual(index_1.default.recursive({ a: { b: [1, 2, 3], c: 1 } }, { a: { b: ['a'] } }), { a: { b: ['a'], c: 1 } }); + chai_1.assert.deepEqual(index_1.default.recursive({ a: { b: { b: 2 }, c: 1 } }, { a: { b: 2 } }), { a: { b: 2, c: 1 } }); + }); + it('clone', function () { + var test1 = { a: { b: 1 } }; + chai_1.assert.deepEqual(index_1.default.recursive(true, test1, { a: { c: 1 } }), { a: { b: 1, c: 1 } }); + chai_1.assert.deepEqual({ a: { b: 1 } }, test1); + var test2 = { a: { b: 1, c: 1 } }; + chai_1.assert.deepEqual(index_1.default.recursive(true, test2, { a: { b: 2 } }), { a: { b: 2, c: 1 } }); + chai_1.assert.deepEqual({ a: { b: 1, c: 1 } }, test2); + var test3 = { a: { b: [1, 2, 3], c: 1 } }; + chai_1.assert.deepEqual(index_1.default.recursive(true, test3, { a: { b: ['a'] } }), { a: { b: ['a'], c: 1 } }); + chai_1.assert.deepEqual({ a: { b: [1, 2, 3], c: 1 } }, test3); + var test4 = { a: { b: { b: 2 }, c: 1 } }; + chai_1.assert.deepEqual(index_1.default.recursive(true, test4, { a: { b: 2 } }), { a: { b: 2, c: 1 } }); + chai_1.assert.deepEqual({ a: { b: { b: 2 }, c: 1 } }, test4); + }); + it('prototype pollution attack', function () { + chai_1.assert.deepEqual(index_1.default.recursive({}, JSON.parse('{"__proto__": {"a": true}}')), {}); + }); +}); From 29e46a8c7de7c35ce8f0f26273826e705ff9dfe2 Mon Sep 17 00:00:00 2001 From: yeikos Date: Sun, 28 Jul 2019 16:40:26 +0200 Subject: [PATCH 04/17] build: ts and webpack config --- tsconfig.json | 17 +++++++++++++++++ webpack.config.js | 30 ++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 tsconfig.json create mode 100644 webpack.config.js diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..bfe3bdd --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "target": "es5", + "lib": [ + "es2015", + "es2016" + ], + "module": "commonjs", + "declaration": true, + "outDir": "./lib", + "strict": true + }, + "include": [ + "src/index.ts", + "test/index.ts", + ] +} \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 0000000..4b36644 --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,30 @@ +var webpack = require('webpack'); +var path = require('path'); + +module.exports = [{ + entry: path.join(__dirname, 'lib', 'src', 'index.js'), + mode: 'production', + optimization: { + minimize: true + }, + output: { + path: path.join(__dirname, 'dist'), + filename: 'merge.browser.min.js', + libraryExport: 'default', + libraryTarget: 'var', + library: 'merge' + } +}, { + entry: path.join(__dirname, 'lib', 'test', 'index.js'), + mode: 'production', + optimization: { + minimize: false + }, + output: { + path: path.join(__dirname, 'dist'), + filename: 'merge.browser.test.js' + }, + externals: { + chai: 'chai' + } +}] \ No newline at end of file From 7cc6574a14ae245813367a25a6a4ece66af8a641 Mon Sep 17 00:00:00 2001 From: yeikos Date: Sun, 28 Jul 2019 16:40:59 +0200 Subject: [PATCH 05/17] build: package-lock.json --- package-lock.json | 4852 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 4852 insertions(+) create mode 100644 package-lock.json diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..b75c500 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,4852 @@ +{ + "name": "merge", + "version": "1.2.1", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@types/chai": { + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.1.7.tgz", + "integrity": "sha512-2Y8uPt0/jwjhQ6EiluT0XCri1Dbplr0ZxfFXUz+ye13gaqE8u5gL5ppao1JrUYr9cIip5S6MvQzBS7Kke7U9VA==", + "dev": true + }, + "@types/mocha": { + "version": "5.2.7", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.7.tgz", + "integrity": "sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ==", + "dev": true + }, + "@webassemblyjs/ast": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.8.5.tgz", + "integrity": "sha512-aJMfngIZ65+t71C3y2nBBg5FFG0Okt9m0XEgWZ7Ywgn1oMAT8cNwx00Uv1cQyHtidq0Xn94R4TAywO+LCQ+ZAQ==", + "dev": true, + "requires": { + "@webassemblyjs/helper-module-context": "1.8.5", + "@webassemblyjs/helper-wasm-bytecode": "1.8.5", + "@webassemblyjs/wast-parser": "1.8.5" + } + }, + "@webassemblyjs/floating-point-hex-parser": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.8.5.tgz", + "integrity": "sha512-9p+79WHru1oqBh9ewP9zW95E3XAo+90oth7S5Re3eQnECGq59ly1Ri5tsIipKGpiStHsUYmY3zMLqtk3gTcOtQ==", + "dev": true + }, + "@webassemblyjs/helper-api-error": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.8.5.tgz", + "integrity": "sha512-Za/tnzsvnqdaSPOUXHyKJ2XI7PDX64kWtURyGiJJZKVEdFOsdKUCPTNEVFZq3zJ2R0G5wc2PZ5gvdTRFgm81zA==", + "dev": true + }, + "@webassemblyjs/helper-buffer": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.8.5.tgz", + "integrity": "sha512-Ri2R8nOS0U6G49Q86goFIPNgjyl6+oE1abW1pS84BuhP1Qcr5JqMwRFT3Ah3ADDDYGEgGs1iyb1DGX+kAi/c/Q==", + "dev": true + }, + "@webassemblyjs/helper-code-frame": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.8.5.tgz", + "integrity": "sha512-VQAadSubZIhNpH46IR3yWO4kZZjMxN1opDrzePLdVKAZ+DFjkGD/rf4v1jap744uPVU6yjL/smZbRIIJTOUnKQ==", + "dev": true, + "requires": { + "@webassemblyjs/wast-printer": "1.8.5" + } + }, + "@webassemblyjs/helper-fsm": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-fsm/-/helper-fsm-1.8.5.tgz", + "integrity": "sha512-kRuX/saORcg8se/ft6Q2UbRpZwP4y7YrWsLXPbbmtepKr22i8Z4O3V5QE9DbZK908dh5Xya4Un57SDIKwB9eow==", + "dev": true + }, + "@webassemblyjs/helper-module-context": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-module-context/-/helper-module-context-1.8.5.tgz", + "integrity": "sha512-/O1B236mN7UNEU4t9X7Pj38i4VoU8CcMHyy3l2cV/kIF4U5KoHXDVqcDuOs1ltkac90IM4vZdHc52t1x8Yfs3g==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.8.5", + "mamacro": "^0.0.3" + } + }, + "@webassemblyjs/helper-wasm-bytecode": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.8.5.tgz", + "integrity": "sha512-Cu4YMYG3Ddl72CbmpjU/wbP6SACcOPVbHN1dI4VJNJVgFwaKf1ppeFJrwydOG3NDHxVGuCfPlLZNyEdIYlQ6QQ==", + "dev": true + }, + "@webassemblyjs/helper-wasm-section": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.8.5.tgz", + "integrity": "sha512-VV083zwR+VTrIWWtgIUpqfvVdK4ff38loRmrdDBgBT8ADXYsEZ5mPQ4Nde90N3UYatHdYoDIFb7oHzMncI02tA==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.8.5", + "@webassemblyjs/helper-buffer": "1.8.5", + "@webassemblyjs/helper-wasm-bytecode": "1.8.5", + "@webassemblyjs/wasm-gen": "1.8.5" + } + }, + "@webassemblyjs/ieee754": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.8.5.tgz", + "integrity": "sha512-aaCvQYrvKbY/n6wKHb/ylAJr27GglahUO89CcGXMItrOBqRarUMxWLJgxm9PJNuKULwN5n1csT9bYoMeZOGF3g==", + "dev": true, + "requires": { + "@xtuc/ieee754": "^1.2.0" + } + }, + "@webassemblyjs/leb128": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.8.5.tgz", + "integrity": "sha512-plYUuUwleLIziknvlP8VpTgO4kqNaH57Y3JnNa6DLpu/sGcP6hbVdfdX5aHAV716pQBKrfuU26BJK29qY37J7A==", + "dev": true, + "requires": { + "@xtuc/long": "4.2.2" + } + }, + "@webassemblyjs/utf8": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.8.5.tgz", + "integrity": "sha512-U7zgftmQriw37tfD934UNInokz6yTmn29inT2cAetAsaU9YeVCveWEwhKL1Mg4yS7q//NGdzy79nlXh3bT8Kjw==", + "dev": true + }, + "@webassemblyjs/wasm-edit": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.8.5.tgz", + "integrity": "sha512-A41EMy8MWw5yvqj7MQzkDjU29K7UJq1VrX2vWLzfpRHt3ISftOXqrtojn7nlPsZ9Ijhp5NwuODuycSvfAO/26Q==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.8.5", + "@webassemblyjs/helper-buffer": "1.8.5", + "@webassemblyjs/helper-wasm-bytecode": "1.8.5", + "@webassemblyjs/helper-wasm-section": "1.8.5", + "@webassemblyjs/wasm-gen": "1.8.5", + "@webassemblyjs/wasm-opt": "1.8.5", + "@webassemblyjs/wasm-parser": "1.8.5", + "@webassemblyjs/wast-printer": "1.8.5" + } + }, + "@webassemblyjs/wasm-gen": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.8.5.tgz", + "integrity": "sha512-BCZBT0LURC0CXDzj5FXSc2FPTsxwp3nWcqXQdOZE4U7h7i8FqtFK5Egia6f9raQLpEKT1VL7zr4r3+QX6zArWg==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.8.5", + "@webassemblyjs/helper-wasm-bytecode": "1.8.5", + "@webassemblyjs/ieee754": "1.8.5", + "@webassemblyjs/leb128": "1.8.5", + "@webassemblyjs/utf8": "1.8.5" + } + }, + "@webassemblyjs/wasm-opt": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.8.5.tgz", + "integrity": "sha512-HKo2mO/Uh9A6ojzu7cjslGaHaUU14LdLbGEKqTR7PBKwT6LdPtLLh9fPY33rmr5wcOMrsWDbbdCHq4hQUdd37Q==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.8.5", + "@webassemblyjs/helper-buffer": "1.8.5", + "@webassemblyjs/wasm-gen": "1.8.5", + "@webassemblyjs/wasm-parser": "1.8.5" + } + }, + "@webassemblyjs/wasm-parser": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.8.5.tgz", + "integrity": "sha512-pi0SYE9T6tfcMkthwcgCpL0cM9nRYr6/6fjgDtL6q/ZqKHdMWvxitRi5JcZ7RI4SNJJYnYNaWy5UUrHQy998lw==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.8.5", + "@webassemblyjs/helper-api-error": "1.8.5", + "@webassemblyjs/helper-wasm-bytecode": "1.8.5", + "@webassemblyjs/ieee754": "1.8.5", + "@webassemblyjs/leb128": "1.8.5", + "@webassemblyjs/utf8": "1.8.5" + } + }, + "@webassemblyjs/wast-parser": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-parser/-/wast-parser-1.8.5.tgz", + "integrity": "sha512-daXC1FyKWHF1i11obK086QRlsMsY4+tIOKgBqI1lxAnkp9xe9YMcgOxm9kLe+ttjs5aWV2KKE1TWJCN57/Btsg==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.8.5", + "@webassemblyjs/floating-point-hex-parser": "1.8.5", + "@webassemblyjs/helper-api-error": "1.8.5", + "@webassemblyjs/helper-code-frame": "1.8.5", + "@webassemblyjs/helper-fsm": "1.8.5", + "@xtuc/long": "4.2.2" + } + }, + "@webassemblyjs/wast-printer": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.8.5.tgz", + "integrity": "sha512-w0U0pD4EhlnvRyeJzBqaVSJAo9w/ce7/WPogeXLzGkO6hzhr4GnQIZ4W4uUt5b9ooAaXPtnXlj0gzsXEOUNYMg==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.8.5", + "@webassemblyjs/wast-parser": "1.8.5", + "@xtuc/long": "4.2.2" + } + }, + "@xtuc/ieee754": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", + "dev": true + }, + "@xtuc/long": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", + "dev": true + }, + "acorn": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.2.1.tgz", + "integrity": "sha512-JD0xT5FCRDNyjDda3Lrg/IxFscp9q4tiYtxE1/nOzlKCk7hIRuYjhq1kCNkbPjMRMZuFq20HNQn1I9k8Oj0E+Q==", + "dev": true + }, + "ajv": { + "version": "6.10.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz", + "integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==", + "dev": true, + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ajv-errors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.1.tgz", + "integrity": "sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ==", + "dev": true + }, + "ajv-keywords": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.4.1.tgz", + "integrity": "sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ==", + "dev": true + }, + "ansi-colors": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", + "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", + "dev": true + }, + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "dev": true, + "requires": { + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + }, + "dependencies": { + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + } + } + }, + "aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "dev": true + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true + }, + "asn1.js": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", + "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", + "dev": true, + "requires": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "assert": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz", + "integrity": "sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==", + "dev": true, + "requires": { + "object-assign": "^4.1.1", + "util": "0.10.3" + }, + "dependencies": { + "inherits": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", + "dev": true + }, + "util": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", + "dev": true, + "requires": { + "inherits": "2.0.1" + } + } + } + }, + "assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true + }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true + }, + "async-each": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", + "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", + "dev": true + }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "base64-js": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz", + "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==", + "dev": true + }, + "big.js": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", + "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", + "dev": true + }, + "binary-extensions": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", + "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", + "dev": true + }, + "bluebird": { + "version": "3.5.5", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.5.tgz", + "integrity": "sha512-5am6HnnfN+urzt4yfg7IgTbotDjIT/u8AJpEt0sIU9FtXfVeezXAPKswrG+xKUCOYAINpSdgZVDU6QFh+cuH3w==", + "dev": true + }, + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", + "dev": true + }, + "browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true + }, + "browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dev": true, + "requires": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "browserify-cipher": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "dev": true, + "requires": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" + } + }, + "browserify-des": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", + "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "browserify-rsa": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "randombytes": "^2.0.1" + } + }, + "browserify-sign": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", + "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", + "dev": true, + "requires": { + "bn.js": "^4.1.1", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.2", + "elliptic": "^6.0.0", + "inherits": "^2.0.1", + "parse-asn1": "^5.0.0" + } + }, + "browserify-zlib": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", + "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", + "dev": true, + "requires": { + "pako": "~1.0.5" + } + }, + "buffer": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", + "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", + "dev": true, + "requires": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4", + "isarray": "^1.0.0" + } + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", + "dev": true + }, + "builtin-status-codes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", + "dev": true + }, + "cacache": { + "version": "11.3.3", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-11.3.3.tgz", + "integrity": "sha512-p8WcneCytvzPxhDvYp31PD039vi77I12W+/KfR9S8AZbaiARFBCpsPJS+9uhWfeBfeAtW7o/4vt3MUqLkbY6nA==", + "dev": true, + "requires": { + "bluebird": "^3.5.5", + "chownr": "^1.1.1", + "figgy-pudding": "^3.5.1", + "glob": "^7.1.4", + "graceful-fs": "^4.1.15", + "lru-cache": "^5.1.1", + "mississippi": "^3.0.0", + "mkdirp": "^0.5.1", + "move-concurrently": "^1.0.1", + "promise-inflight": "^1.0.1", + "rimraf": "^2.6.3", + "ssri": "^6.0.1", + "unique-filename": "^1.1.1", + "y18n": "^4.0.0" + }, + "dependencies": { + "glob": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } + } + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + } + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "chai": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", + "integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==", + "dev": true, + "requires": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.2", + "deep-eql": "^3.0.1", + "get-func-name": "^2.0.0", + "pathval": "^1.1.0", + "type-detect": "^4.0.5" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "dependencies": { + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "check-error": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", + "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", + "dev": true + }, + "chokidar": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.6.tgz", + "integrity": "sha512-V2jUo67OKkc6ySiRpJrjlpJKl9kDuG+Xb8VgsGzb+aEouhgS1D0weyPU4lEzdAcsCAvrih2J2BqyXqHWvVLw5g==", + "dev": true, + "requires": { + "anymatch": "^2.0.0", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "fsevents": "^1.2.7", + "glob-parent": "^3.1.0", + "inherits": "^2.0.3", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^3.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.2.1", + "upath": "^1.1.1" + } + }, + "chownr": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.2.tgz", + "integrity": "sha512-GkfeAQh+QNy3wquu9oIZr6SS5x7wGdSgNQvD10X3r+AZr1Oys22HW8kAmDMvNg2+Dm0TeGaEuO8gFwdBXxwO8A==", + "dev": true + }, + "chrome-trace-event": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.2.tgz", + "integrity": "sha512-9e/zx1jw7B4CO+c/RXoCsfg/x1AfUBioy4owYH0bJprEYAx5hRFLRhWBqHAG57D0ZM4H7vxbP7bPe0VwhQRYDQ==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "cliui": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", + "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "dev": true, + "requires": { + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" + } + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "commander": { + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", + "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", + "dev": true + }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, + "component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "concurrently": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-4.1.1.tgz", + "integrity": "sha512-48+FE5RJ0qc8azwKv4keVQWlni1hZeSjcWr8shBelOBtBHcKj1aJFM9lHRiSc1x7lq416pkvsqfBMhSRja+Lhw==", + "dev": true, + "requires": { + "chalk": "^2.4.1", + "date-fns": "^1.23.0", + "lodash": "^4.17.10", + "read-pkg": "^4.0.1", + "rxjs": "^6.3.3", + "spawn-command": "^0.0.2-1", + "supports-color": "^4.5.0", + "tree-kill": "^1.1.0", + "yargs": "^12.0.1" + }, + "dependencies": { + "get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "dev": true + }, + "has-flag": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-2.0.0.tgz", + "integrity": "sha1-6CB68cx7MNRGzHC3NLXovhj4jVE=", + "dev": true + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "dev": true + }, + "supports-color": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", + "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "dev": true, + "requires": { + "has-flag": "^2.0.0" + } + }, + "yargs": { + "version": "12.0.5", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", + "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", + "dev": true, + "requires": { + "cliui": "^4.0.0", + "decamelize": "^1.2.0", + "find-up": "^3.0.0", + "get-caller-file": "^1.0.1", + "os-locale": "^3.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1 || ^4.0.0", + "yargs-parser": "^11.1.1" + } + }, + "yargs-parser": { + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", + "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, + "console-browserify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", + "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", + "dev": true, + "requires": { + "date-now": "^0.1.4" + } + }, + "constants-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", + "dev": true + }, + "copy-concurrently": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz", + "integrity": "sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==", + "dev": true, + "requires": { + "aproba": "^1.1.1", + "fs-write-stream-atomic": "^1.0.8", + "iferr": "^0.1.5", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.4", + "run-queue": "^1.0.0" + } + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "create-ecdh": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", + "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "elliptic": "^6.0.0" + } + }, + "create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dev": true, + "requires": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "dev": true, + "requires": { + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" + } + }, + "cyclist": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-0.2.2.tgz", + "integrity": "sha1-GzN5LhHpFKL9bW7WRHRkRE5fpkA=", + "dev": true + }, + "date-fns": { + "version": "1.30.1", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-1.30.1.tgz", + "integrity": "sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw==", + "dev": true + }, + "date-now": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", + "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=", + "dev": true + }, + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true + }, + "deep-eql": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", + "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "dev": true, + "requires": { + "type-detect": "^4.0.0" + } + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "des.js": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", + "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "detect-file": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", + "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=", + "dev": true + }, + "diff": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "dev": true + }, + "diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + } + }, + "domain-browser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", + "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==", + "dev": true + }, + "duplexify": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", + "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", + "dev": true, + "requires": { + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" + } + }, + "elliptic": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.0.tgz", + "integrity": "sha512-eFOJTMyCYb7xtE/caJ6JJu+bhi67WCYNbkGSknu20pmM8Ke/bqOfdnZWxyoGN26JgfxTbXrsCkEw4KheCT/KGg==", + "dev": true, + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" + } + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "emojis-list": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", + "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=", + "dev": true + }, + "end-of-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, + "enhanced-resolve": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.1.0.tgz", + "integrity": "sha512-F/7vkyTtyc/llOIn8oWclcB25KdRaiPBpZYDgJHgh/UHtpgT2p2eldQgtQnLtUvfMKPKxbRaQM/hHkvLHt1Vng==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "memory-fs": "^0.4.0", + "tapable": "^1.0.0" + } + }, + "errno": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", + "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", + "dev": true, + "requires": { + "prr": "~1.0.1" + } + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "es-abstract": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", + "integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.0", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "is-callable": "^1.1.4", + "is-regex": "^1.0.4", + "object-keys": "^1.0.12" + } + }, + "es-to-primitive": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", + "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "eslint-scope": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz", + "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "dev": true, + "requires": { + "estraverse": "^4.1.0" + } + }, + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + }, + "events": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.0.0.tgz", + "integrity": "sha512-Dc381HFWJzEOhQ+d8pkNon++bk9h6cdAoAj4iE6Q4y6xgTzySWXlKn05/TVNpjnfRqi/X0EpJEJohPjNI3zpVA==", + "dev": true + }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, + "requires": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "dev": true, + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + } + } + }, + "expand-tilde": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/expand-tilde/-/expand-tilde-2.0.2.tgz", + "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", + "dev": true, + "requires": { + "homedir-polyfill": "^1.0.1" + } + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true + }, + "figgy-pudding": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/figgy-pudding/-/figgy-pudding-3.5.1.tgz", + "integrity": "sha512-vNKxJHTEKNThjfrdJwHc7brvM6eVevuO5nTj6ez8ZQ1qbXTvGthucRF7S4vf2cr71QVnT70V34v0S1DyQsti0w==", + "dev": true + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "find-cache-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", + "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^2.0.0", + "pkg-dir": "^3.0.0" + } + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "findup-sync": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz", + "integrity": "sha512-YbffarhcicEhOrm4CtrwdKBdCuz576RLdhJDsIfvNtxUuhdRet1qZcsMjqbePtAseKdAnDyM/IyXbu7PRPRLYg==", + "dev": true, + "requires": { + "detect-file": "^1.0.0", + "is-glob": "^4.0.0", + "micromatch": "^3.0.4", + "resolve-dir": "^1.0.1" + } + }, + "flat": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.0.tgz", + "integrity": "sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw==", + "dev": true, + "requires": { + "is-buffer": "~2.0.3" + } + }, + "flush-write-stream": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.1.1.tgz", + "integrity": "sha512-3Z4XhFZ3992uIq0XOqb9AreonueSYphE6oYbpt5+3u06JWklbsPkNv3ZKkP9Bz/r+1MWCaMoSQ28P85+1Yc77w==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "readable-stream": "^2.3.6" + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "requires": { + "map-cache": "^0.2.2" + } + }, + "from2": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", + "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.0" + } + }, + "fs-write-stream-atomic": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", + "integrity": "sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "iferr": "^0.1.5", + "imurmurhash": "^0.1.4", + "readable-stream": "1 || 2" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz", + "integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==", + "dev": true, + "optional": true, + "requires": { + "nan": "^2.12.1", + "node-pre-gyp": "^0.12.0" + }, + "dependencies": { + "abbrev": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true, + "dev": true + }, + "aproba": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "chownr": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true, + "dev": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "debug": { + "version": "4.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ms": "^2.1.1" + } + }, + "deep-extend": { + "version": "0.6.0", + "bundled": true, + "dev": true, + "optional": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.3", + "bundled": true, + "dev": true, + "optional": true + }, + "fs-minipass": { + "version": "1.2.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "glob": { + "version": "7.1.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "iconv-lite": { + "version": "0.4.24", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore-walk": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minimatch": "^3.0.4" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true, + "dev": true + }, + "ini": { + "version": "1.3.5", + "bundled": true, + "dev": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true, + "dev": true + }, + "minipass": { + "version": "2.3.5", + "bundled": true, + "dev": true, + "requires": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + } + }, + "minizlib": { + "version": "1.2.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "needle": { + "version": "2.3.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "debug": "^4.1.0", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + } + }, + "node-pre-gyp": { + "version": "0.12.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "detect-libc": "^1.0.2", + "mkdirp": "^0.5.1", + "needle": "^2.2.1", + "nopt": "^4.0.1", + "npm-packlist": "^1.1.6", + "npmlog": "^4.0.2", + "rc": "^1.2.7", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^4" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + }, + "npm-bundled": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "optional": true + }, + "npm-packlist": { + "version": "1.4.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1" + } + }, + "npmlog": { + "version": "4.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "osenv": { + "version": "0.1.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "process-nextick-args": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "rc": { + "version": "1.2.8", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.3.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "rimraf": { + "version": "2.6.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "glob": "^7.1.3" + } + }, + "safe-buffer": { + "version": "5.1.2", + "bundled": true, + "dev": true + }, + "safer-buffer": { + "version": "2.1.2", + "bundled": true, + "dev": true, + "optional": true + }, + "sax": { + "version": "1.2.4", + "bundled": true, + "dev": true, + "optional": true + }, + "semver": { + "version": "5.7.0", + "bundled": true, + "dev": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "tar": { + "version": "4.4.8", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "chownr": "^1.1.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.3.4", + "minizlib": "^1.1.1", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.2" + } + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "wide-align": { + "version": "1.1.3", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "string-width": "^1.0.2 || 2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "yallist": { + "version": "3.0.3", + "bundled": true, + "dev": true + } + } + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "get-func-name": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", + "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", + "dev": true + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true + }, + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "requires": { + "is-extglob": "^2.1.0" + } + } + } + }, + "global-modules": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", + "integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==", + "dev": true, + "requires": { + "global-prefix": "^3.0.0" + }, + "dependencies": { + "global-prefix": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz", + "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==", + "dev": true, + "requires": { + "ini": "^1.3.5", + "kind-of": "^6.0.2", + "which": "^1.3.1" + } + } + } + }, + "global-prefix": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-1.0.2.tgz", + "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", + "dev": true, + "requires": { + "expand-tilde": "^2.0.2", + "homedir-polyfill": "^1.0.1", + "ini": "^1.3.4", + "is-windows": "^1.0.1", + "which": "^1.2.14" + } + }, + "graceful-fs": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.0.tgz", + "integrity": "sha512-jpSvDPV4Cq/bgtpndIWbI5hmYxhQGHPC4d4cqBPb4DLniCfhJokdXhwhaDuLBGLQdvvRum/UiX6ECVIPvDXqdg==", + "dev": true + }, + "growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "dev": true + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "has-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", + "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", + "dev": true + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "hash-base": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", + "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "dev": true, + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "homedir-polyfill": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", + "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", + "dev": true, + "requires": { + "parse-passwd": "^1.0.0" + } + }, + "hosted-git-info": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", + "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==", + "dev": true + }, + "https-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", + "dev": true + }, + "ieee754": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", + "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", + "dev": true + }, + "iferr": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz", + "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=", + "dev": true + }, + "import-local": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz", + "integrity": "sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ==", + "dev": true, + "requires": { + "pkg-dir": "^3.0.0", + "resolve-cwd": "^2.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "dev": true + }, + "interpret": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.2.0.tgz", + "integrity": "sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw==", + "dev": true + }, + "invert-kv": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", + "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", + "dev": true + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "requires": { + "binary-extensions": "^1.0.0" + } + }, + "is-buffer": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.3.tgz", + "integrity": "sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw==", + "dev": true + }, + "is-callable": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", + "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", + "dev": true + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-date-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "dev": true + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true + } + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "is-regex": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", + "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "dev": true, + "requires": { + "has": "^1.0.1" + } + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "is-symbol": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", + "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", + "dev": true, + "requires": { + "has-symbols": "^1.0.0" + } + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true + }, + "is-wsl": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz", + "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=", + "dev": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } + } + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "dev": true + }, + "lcid": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", + "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", + "dev": true, + "requires": { + "invert-kv": "^2.0.0" + } + }, + "loader-runner": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.4.0.tgz", + "integrity": "sha512-Jsmr89RcXGIwivFY21FcRrisYZfvLMTWx5kOLc+JTxtpBOG6xML0vzbc6SEQG2FO9/4Fc3wW4LVcB5DmGflaRw==", + "dev": true + }, + "loader-utils": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.2.3.tgz", + "integrity": "sha512-fkpz8ejdnEMG3s37wGL07iSBDg99O9D5yflE9RGNH3hRdx9SOwYfnGYdZOUIZitN8E+E2vkq3MUMYMvPYl5ZZA==", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^2.0.0", + "json5": "^1.0.1" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + }, + "log-symbols": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", + "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", + "dev": true, + "requires": { + "chalk": "^2.0.1" + } + }, + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dev": true, + "requires": { + "yallist": "^3.0.2" + } + }, + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dev": true, + "requires": { + "pify": "^4.0.1", + "semver": "^5.6.0" + } + }, + "mamacro": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/mamacro/-/mamacro-0.0.3.tgz", + "integrity": "sha512-qMEwh+UujcQ+kbz3T6V+wAmO2U8veoq2w+3wY8MquqwVA3jChfwY+Tk52GZKDfACEPjuZ7r2oJLejwpt8jtwTA==", + "dev": true + }, + "map-age-cleaner": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", + "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", + "dev": true, + "requires": { + "p-defer": "^1.0.0" + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "requires": { + "object-visit": "^1.0.0" + } + }, + "md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "mem": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", + "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", + "dev": true, + "requires": { + "map-age-cleaner": "^0.1.1", + "mimic-fn": "^2.0.0", + "p-is-promise": "^2.0.0" + } + }, + "memory-fs": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", + "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", + "dev": true, + "requires": { + "errno": "^0.1.3", + "readable-stream": "^2.0.1" + } + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "dev": true, + "requires": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + } + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + }, + "mississippi": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-3.0.0.tgz", + "integrity": "sha512-x471SsVjUtBRtcvd4BzKE9kFC+/2TeWgKCgw0bZcw1b9l2X3QX5vCWgF+KaZaYm87Ss//rHnWryupDrgLvmSkA==", + "dev": true, + "requires": { + "concat-stream": "^1.5.0", + "duplexify": "^3.4.2", + "end-of-stream": "^1.1.0", + "flush-write-stream": "^1.0.0", + "from2": "^2.1.0", + "parallel-transform": "^1.1.0", + "pump": "^3.0.0", + "pumpify": "^1.3.3", + "stream-each": "^1.1.0", + "through2": "^2.0.0" + } + }, + "mixin-deep": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", + "dev": true, + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "mocha": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-6.2.0.tgz", + "integrity": "sha512-qwfFgY+7EKAAUAdv7VYMZQknI7YJSGesxHyhn6qD52DV8UcSZs5XwCifcZGMVIE4a5fbmhvbotxC0DLQ0oKohQ==", + "dev": true, + "requires": { + "ansi-colors": "3.2.3", + "browser-stdout": "1.3.1", + "debug": "3.2.6", + "diff": "3.5.0", + "escape-string-regexp": "1.0.5", + "find-up": "3.0.0", + "glob": "7.1.3", + "growl": "1.10.5", + "he": "1.2.0", + "js-yaml": "3.13.1", + "log-symbols": "2.2.0", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "ms": "2.1.1", + "node-environment-flags": "1.0.5", + "object.assign": "4.1.0", + "strip-json-comments": "2.0.1", + "supports-color": "6.0.0", + "which": "1.3.1", + "wide-align": "1.1.3", + "yargs": "13.2.2", + "yargs-parser": "13.0.0", + "yargs-unparser": "1.5.0" + } + }, + "move-concurrently": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", + "integrity": "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=", + "dev": true, + "requires": { + "aproba": "^1.1.1", + "copy-concurrently": "^1.0.0", + "fs-write-stream-atomic": "^1.0.8", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.4", + "run-queue": "^1.0.3" + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + }, + "nan": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", + "dev": true, + "optional": true + }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + } + }, + "neo-async": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz", + "integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==", + "dev": true + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "node-environment-flags": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.5.tgz", + "integrity": "sha512-VNYPRfGfmZLx0Ye20jWzHUjyTW/c+6Wq+iLhDzUI4XmhrDd9l/FozXV3F2xOaXjvp0co0+v1YSR3CMP6g+VvLQ==", + "dev": true, + "requires": { + "object.getownpropertydescriptors": "^2.0.3", + "semver": "^5.7.0" + } + }, + "node-libs-browser": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.2.1.tgz", + "integrity": "sha512-h/zcD8H9kaDZ9ALUWwlBUDo6TKF8a7qBSCSEGfjTVIYeqsioSKaAX+BN7NgiMGp6iSIXZ3PxgCu8KS3b71YK5Q==", + "dev": true, + "requires": { + "assert": "^1.1.1", + "browserify-zlib": "^0.2.0", + "buffer": "^4.3.0", + "console-browserify": "^1.1.0", + "constants-browserify": "^1.0.0", + "crypto-browserify": "^3.11.0", + "domain-browser": "^1.1.1", + "events": "^3.0.0", + "https-browserify": "^1.0.0", + "os-browserify": "^0.3.0", + "path-browserify": "0.0.1", + "process": "^0.11.10", + "punycode": "^1.2.4", + "querystring-es3": "^0.2.0", + "readable-stream": "^2.3.3", + "stream-browserify": "^2.0.1", + "stream-http": "^2.7.2", + "string_decoder": "^1.0.0", + "timers-browserify": "^2.0.4", + "tty-browserify": "0.0.0", + "url": "^0.11.0", + "util": "^0.11.0", + "vm-browserify": "^1.0.1" + }, + "dependencies": { + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + } + } + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "requires": { + "path-key": "^2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "requires": { + "isobject": "^3.0.0" + } + }, + "object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + } + }, + "object.getownpropertydescriptors": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz", + "integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "es-abstract": "^1.5.1" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "os-browserify": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", + "dev": true + }, + "os-locale": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", + "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", + "dev": true, + "requires": { + "execa": "^1.0.0", + "lcid": "^2.0.0", + "mem": "^4.0.0" + } + }, + "p-defer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", + "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", + "dev": true + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true + }, + "p-is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", + "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==", + "dev": true + }, + "p-limit": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", + "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "pako": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.10.tgz", + "integrity": "sha512-0DTvPVU3ed8+HNXOu5Bs+o//Mbdj9VNQMUOe9oKCwh8l0GNwpTDMKCWbRjgtD291AWnkAgkqA/LOnQS8AmS1tw==", + "dev": true + }, + "parallel-transform": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.1.0.tgz", + "integrity": "sha1-1BDwZbBdojCB/NEPKIVMKb2jOwY=", + "dev": true, + "requires": { + "cyclist": "~0.2.2", + "inherits": "^2.0.3", + "readable-stream": "^2.1.5" + } + }, + "parse-asn1": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.4.tgz", + "integrity": "sha512-Qs5duJcuvNExRfFZ99HDD3z4mAi3r9Wl/FOjEOijlxwCZs7E7mW2vjTpgQ4J8LpTF8x5v+1Vn5UQFejmWT11aw==", + "dev": true, + "requires": { + "asn1.js": "^4.0.0", + "browserify-aes": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.0", + "pbkdf2": "^3.0.3", + "safe-buffer": "^5.1.1" + } + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "parse-passwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", + "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", + "dev": true + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true + }, + "path-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz", + "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==", + "dev": true + }, + "path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "pathval": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz", + "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", + "dev": true + }, + "pbkdf2": { + "version": "3.0.17", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", + "integrity": "sha512-U/il5MsrZp7mGg3mSQfn742na2T+1/vHDCG5/iTI3X9MKUuYUZVLQhyRsg06mCgDBTd57TxzgZt7P+fYfjRLtA==", + "dev": true, + "requires": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + }, + "pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "dev": true, + "requires": { + "find-up": "^3.0.0" + } + }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true + }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true + }, + "promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", + "dev": true + }, + "prr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", + "dev": true + }, + "public-encrypt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz", + "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "pumpify": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", + "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", + "dev": true, + "requires": { + "duplexify": "^3.6.0", + "inherits": "^2.0.3", + "pump": "^2.0.0" + }, + "dependencies": { + "pump": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", + "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + } + } + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "querystring": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", + "dev": true + }, + "querystring-es3": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", + "dev": true + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "dev": true, + "requires": { + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + } + }, + "read-pkg": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-4.0.1.tgz", + "integrity": "sha1-ljYlN48+HE1IyFhytabsfV0JMjc=", + "dev": true, + "requires": { + "normalize-package-data": "^2.3.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0" + }, + "dependencies": { + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + } + } + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "readdirp": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" + } + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "resolve": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.1.tgz", + "integrity": "sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "resolve-cwd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", + "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", + "dev": true, + "requires": { + "resolve-from": "^3.0.0" + } + }, + "resolve-dir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-1.0.1.tgz", + "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", + "dev": true, + "requires": { + "expand-tilde": "^2.0.0", + "global-modules": "^1.0.0" + }, + "dependencies": { + "global-modules": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz", + "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", + "dev": true, + "requires": { + "global-prefix": "^1.0.1", + "is-windows": "^1.0.1", + "resolve-dir": "^1.0.0" + } + } + } + }, + "resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=", + "dev": true + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true + }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true + }, + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "run-queue": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", + "integrity": "sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=", + "dev": true, + "requires": { + "aproba": "^1.1.1" + } + }, + "rxjs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.2.tgz", + "integrity": "sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "requires": { + "ret": "~0.1.10" + } + }, + "schema-utils": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", + "integrity": "sha512-i27Mic4KovM/lnGsy8whRCHhc7VicJajAjTrYg11K9zfZXnYIt4k5F+kZkwjnrhKzLic/HLU4j11mjsz2G/75g==", + "dev": true, + "requires": { + "ajv": "^6.1.0", + "ajv-errors": "^1.0.0", + "ajv-keywords": "^3.1.0" + } + }, + "semver": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "dev": true + }, + "serialize-javascript": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.7.0.tgz", + "integrity": "sha512-ke8UG8ulpFOxO8f8gRYabHQe/ZntKlcig2Mp+8+URDP1D8vJZ0KUt7LYo07q25Z/+JVSgpr/cui9PIp5H6/+nA==", + "dev": true + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "set-value": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", + "dev": true + }, + "sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, + "requires": { + "kind-of": "^3.2.0" + }, + "dependencies": { + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "source-list-map": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.1.tgz", + "integrity": "sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "source-map-resolve": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", + "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", + "dev": true, + "requires": { + "atob": "^2.1.1", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "source-map-support": { + "version": "0.5.12", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz", + "integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "dev": true + }, + "spawn-command": { + "version": "0.0.2-1", + "resolved": "https://registry.npmjs.org/spawn-command/-/spawn-command-0.0.2-1.tgz", + "integrity": "sha1-YvXpRmmBwbeW3Fkpk34RycaSG9A=", + "dev": true + }, + "spdx-correct": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", + "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", + "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", + "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", + "dev": true + }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.0" + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "ssri": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz", + "integrity": "sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA==", + "dev": true, + "requires": { + "figgy-pudding": "^3.5.1" + } + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "stream-browserify": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz", + "integrity": "sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg==", + "dev": true, + "requires": { + "inherits": "~2.0.1", + "readable-stream": "^2.0.2" + } + }, + "stream-each": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.3.tgz", + "integrity": "sha512-vlMC2f8I2u/bZGqkdfLQW/13Zihpej/7PmSiMQsbYddxuTsJp8vRe2x2FvVExZg7FaOds43ROAuFJwPR4MTZLw==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "stream-shift": "^1.0.0" + } + }, + "stream-http": { + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", + "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", + "dev": true, + "requires": { + "builtin-status-codes": "^3.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.3.6", + "to-arraybuffer": "^1.0.0", + "xtend": "^4.0.0" + } + }, + "stream-shift": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", + "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, + "supports-color": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", + "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "tapable": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", + "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==", + "dev": true + }, + "terser": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-4.1.2.tgz", + "integrity": "sha512-jvNoEQSPXJdssFwqPSgWjsOrb+ELoE+ILpHPKXC83tIxOlh2U75F1KuB2luLD/3a6/7K3Vw5pDn+hvu0C4AzSw==", + "dev": true, + "requires": { + "commander": "^2.20.0", + "source-map": "~0.6.1", + "source-map-support": "~0.5.12" + } + }, + "terser-webpack-plugin": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-1.3.0.tgz", + "integrity": "sha512-W2YWmxPjjkUcOWa4pBEv4OP4er1aeQJlSo2UhtCFQCuRXEHjOFscO8VyWHj9JLlA0RzQb8Y2/Ta78XZvT54uGg==", + "dev": true, + "requires": { + "cacache": "^11.3.2", + "find-cache-dir": "^2.0.0", + "is-wsl": "^1.1.0", + "loader-utils": "^1.2.3", + "schema-utils": "^1.0.0", + "serialize-javascript": "^1.7.0", + "source-map": "^0.6.1", + "terser": "^4.0.0", + "webpack-sources": "^1.3.0", + "worker-farm": "^1.7.0" + } + }, + "through2": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "dev": true, + "requires": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "timers-browserify": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.10.tgz", + "integrity": "sha512-YvC1SV1XdOUaL6gx5CoGroT3Gu49pK9+TZ38ErPldOWW4j49GI1HKs9DV+KGq/w6y+LZ72W1c8cKz2vzY+qpzg==", + "dev": true, + "requires": { + "setimmediate": "^1.0.4" + } + }, + "to-arraybuffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", + "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", + "dev": true + }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + }, + "tree-kill": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.1.tgz", + "integrity": "sha512-4hjqbObwlh2dLyW4tcz0Ymw0ggoaVDMveUB9w8kFSQScdRLo0gxO9J7WFcUBo+W3C1TLdFIEwNOWebgZZ0RH9Q==", + "dev": true + }, + "tslib": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.10.0.tgz", + "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==", + "dev": true + }, + "tty-browserify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", + "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", + "dev": true + }, + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "typescript": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.3.tgz", + "integrity": "sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g==", + "dev": true + }, + "union-value": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" + } + }, + "unique-filename": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", + "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", + "dev": true, + "requires": { + "unique-slug": "^2.0.0" + } + }, + "unique-slug": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", + "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4" + } + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true + } + } + }, + "upath": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.2.tgz", + "integrity": "sha512-kXpym8nmDmlCBr7nKdIx8P2jNBa+pBpIUFRnKJ4dr8htyYGJFokkr2ZvERRtUN+9SY+JqXouNgUPtv6JQva/2Q==", + "dev": true + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true + }, + "url": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", + "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", + "dev": true, + "requires": { + "punycode": "1.3.2", + "querystring": "0.2.0" + }, + "dependencies": { + "punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", + "dev": true + } + } + }, + "use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true + }, + "util": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/util/-/util-0.11.1.tgz", + "integrity": "sha512-HShAsny+zS2TZfaXxD9tYj4HQGlBezXZMZuM/S5PKLLoZkShZiGk9o5CzukI1LVHZvjdvZ2Sj1aW/Ndn2NB/HQ==", + "dev": true, + "requires": { + "inherits": "2.0.3" + }, + "dependencies": { + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + } + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "v8-compile-cache": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.0.3.tgz", + "integrity": "sha512-CNmdbwQMBjwr9Gsmohvm0pbL954tJrNzf6gWL3K+QMQf00PF7ERGrEiLgjuU3mKreLC2MeGhUsNV9ybTbLgd3w==", + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "vm-browserify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.0.tgz", + "integrity": "sha512-iq+S7vZJE60yejDYM0ek6zg308+UZsdtPExWP9VZoCFCz1zkJoXFnAX7aZfd/ZwrkidzdUZL0C/ryW+JwAiIGw==", + "dev": true + }, + "watchpack": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.6.0.tgz", + "integrity": "sha512-i6dHe3EyLjMmDlU1/bGQpEw25XSjkJULPuAVKCbNRefQVq48yXKUpwg538F7AZTf9kyr57zj++pQFltUa5H7yA==", + "dev": true, + "requires": { + "chokidar": "^2.0.2", + "graceful-fs": "^4.1.2", + "neo-async": "^2.5.0" + } + }, + "webpack": { + "version": "4.38.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.38.0.tgz", + "integrity": "sha512-lbuFsVOq8PZY+1Ytz/mYOvYOo+d4IJ31hHk/7iyoeWtwN33V+5HYotSH+UIb9tq914ey0Hot7z6HugD+je3sWw==", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.8.5", + "@webassemblyjs/helper-module-context": "1.8.5", + "@webassemblyjs/wasm-edit": "1.8.5", + "@webassemblyjs/wasm-parser": "1.8.5", + "acorn": "^6.2.0", + "ajv": "^6.1.0", + "ajv-keywords": "^3.1.0", + "chrome-trace-event": "^1.0.0", + "enhanced-resolve": "^4.1.0", + "eslint-scope": "^4.0.0", + "json-parse-better-errors": "^1.0.2", + "loader-runner": "^2.3.0", + "loader-utils": "^1.1.0", + "memory-fs": "~0.4.1", + "micromatch": "^3.1.8", + "mkdirp": "~0.5.0", + "neo-async": "^2.5.0", + "node-libs-browser": "^2.0.0", + "schema-utils": "^1.0.0", + "tapable": "^1.1.0", + "terser-webpack-plugin": "^1.1.0", + "watchpack": "^1.5.0", + "webpack-sources": "^1.3.0" + } + }, + "webpack-cli": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-3.3.6.tgz", + "integrity": "sha512-0vEa83M7kJtxK/jUhlpZ27WHIOndz5mghWL2O53kiDoA9DIxSKnfqB92LoqEn77cT4f3H2cZm1BMEat/6AZz3A==", + "dev": true, + "requires": { + "chalk": "2.4.2", + "cross-spawn": "6.0.5", + "enhanced-resolve": "4.1.0", + "findup-sync": "3.0.0", + "global-modules": "2.0.0", + "import-local": "2.0.0", + "interpret": "1.2.0", + "loader-utils": "1.2.3", + "supports-color": "6.1.0", + "v8-compile-cache": "2.0.3", + "yargs": "13.2.4" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "dev": true, + "requires": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + } + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + }, + "supports-color": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", + "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + } + }, + "yargs": { + "version": "13.2.4", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.4.tgz", + "integrity": "sha512-HG/DWAJa1PAnHT9JAhNa8AbAv3FPaiLzioSjCcmuXXhP8MlpHO5vwls4g4j6n30Z74GVQj8Xa62dWVx1QCGklg==", + "dev": true, + "requires": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "os-locale": "^3.1.0", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.0" + } + }, + "yargs-parser": { + "version": "13.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", + "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, + "webpack-sources": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.3.0.tgz", + "integrity": "sha512-OiVgSrbGu7NEnEvQJJgdSFPl2qWKkWq5lHMhgiToIiN9w34EBnjYzSYs+VbL5KoYiLNtFFa7BZIKxRED3I32pA==", + "dev": true, + "requires": { + "source-list-map": "^2.0.0", + "source-map": "~0.6.1" + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "wide-align": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "dev": true, + "requires": { + "string-width": "^1.0.2 || 2" + } + }, + "worker-farm": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.7.0.tgz", + "integrity": "sha512-rvw3QTZc8lAxyVrqcSGVm5yP/IJ2UcB3U0graE3LCFoZ0Yn2x4EoVSqJKdB/T5M+FLcRPjz4TDacRf3OCfNUzw==", + "dev": true, + "requires": { + "errno": "~0.1.7" + } + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "dev": true, + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "^2.0.0" + } + } + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true + }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "dev": true + }, + "yallist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", + "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", + "dev": true + }, + "yargs": { + "version": "13.2.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.2.tgz", + "integrity": "sha512-WyEoxgyTD3w5XRpAQNYUB9ycVH/PQrToaTXdYXRdOXvEy1l19br+VJsc0vcO8PTGg5ro/l/GY7F/JMEBmI0BxA==", + "dev": true, + "requires": { + "cliui": "^4.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "os-locale": "^3.1.0", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "yargs-parser": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.0.0.tgz", + "integrity": "sha512-w2LXjoL8oRdRQN+hOyppuXs+V/fVAYtpcrRxZuF7Kt/Oc+Jr2uAcVntaUTNT6w5ihoWfFDpNY8CPx1QskxZ/pw==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + }, + "yargs-unparser": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.5.0.tgz", + "integrity": "sha512-HK25qidFTCVuj/D1VfNiEndpLIeJN78aqgR23nL3y4N0U/91cOAzqfHlF8n2BvoNDcZmJKin3ddNSvOxSr8flw==", + "dev": true, + "requires": { + "flat": "^4.1.0", + "lodash": "^4.17.11", + "yargs": "^12.0.5" + }, + "dependencies": { + "get-caller-file": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", + "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==", + "dev": true + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "dev": true + }, + "yargs": { + "version": "12.0.5", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", + "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", + "dev": true, + "requires": { + "cliui": "^4.0.0", + "decamelize": "^1.2.0", + "find-up": "^3.0.0", + "get-caller-file": "^1.0.1", + "os-locale": "^3.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1 || ^4.0.0", + "yargs-parser": "^11.1.1" + } + }, + "yargs-parser": { + "version": "11.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", + "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + } + } +} From 2b22e6b076028addf23212f155a5796fc03c29aa Mon Sep 17 00:00:00 2001 From: yeikos Date: Sun, 28 Jul 2019 23:58:03 +0200 Subject: [PATCH 06/17] docs: update readme --- README.md | 90 +++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 58 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index f5fed8d..a260900 100644 --- a/README.md +++ b/README.md @@ -1,58 +1,84 @@ # Merge -Merge multiple objects into one, optionally creating a new cloned object. -Similar to the jQuery.extend but more flexible. Works in Node.js and the -browser. +(recursive)? merging of (cloned)? objects. -## Node.js Usage +# Install + +## Node.js ```sh -npm install merge --save +npm i merge +``` +```js +import merge from 'merge' ``` +## Browser + +```html + +``` ```js -var merge = require('merge'), original, cloned; +window.merge +``` -console.log(merge({one:'hello'}, {two: 'world'})); -// -> {"one": "hello", "two": "world"} +# API -original = { x: { y: 1 } }; -cloned = merge(true, original); -cloned.x.y++; +```typescript +merge(clone: boolean, ...items: Object[]) +merge(...items: Object[]) +merge.recursive(clone: boolean, ...items: Object[]) +merge.recursive(...items: Object[]) +``` -console.log(original.x.y, cloned.x.y); -// -> 1, 2 +# Examples -console.log(merge.recursive(true, original, { x: { z: 2 } })); -// -> {"x": { "y": 1, "z": 2 } } +```js -``` +// Merge -## Browser Usage +{ + var objectA = {} -```html - - + merge.recursive(objectA, + { level: { value: 1 } }, + { level: { str: 'hello world' } } + ) + var objectB = merge.recursive(true, objectA, + { level: { value: 2 } } + ) + + objectA.level // { value: 1, str: 'hello world' } + objectB.level // { value: 2, str: 'hello world' } +} ``` +# Test -## Tests +## Node.js ```sh npm test ``` +## Browser + +``` +./dist/merge.browser.test.html +``` \ No newline at end of file From 1385593d56ccf613a2c991a8d62476aaba911fff Mon Sep 17 00:00:00 2001 From: yeikos Date: Mon, 29 Jul 2019 00:04:31 +0200 Subject: [PATCH 07/17] build: update main script and description --- bower.json | 42 +++++++++++++++++++++--------------------- package.json | 4 ++-- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/bower.json b/bower.json index a35de11..af6c88e 100644 --- a/bower.json +++ b/bower.json @@ -1,22 +1,22 @@ { - "name": "merge", - "version": "1.2.1", - "homepage": "https://github.com/yeikos/js.merge", - "authors": [ - "yeikos " - ], - "description": "Merge multiple objects into one, optionally creating a new cloned object. Similar to the jQuery.extend but more flexible. Works in Node.js and the browser.", - "main": "merge.js", - "keywords": [ - "merge", - "recursive", - "extend", - "clone", - "object", - "browser" - ], - "license": "MIT", - "ignore": [ - "tests" - ] -} + "name": "merge", + "version": "1.2.1", + "homepage": "https://github.com/yeikos/js.merge", + "authors": [ + "yeikos" + ], + "description": "(recursive)? merging of (cloned)? objects.", + "main": "dist/merge.browser.min.js", + "keywords": [ + "merge", + "recursive", + "extend", + "clone", + "object", + "browser" + ], + "license": "MIT", + "ignore": [ + "tests" + ] +} \ No newline at end of file diff --git a/package.json b/package.json index 00441a2..fe33469 100644 --- a/package.json +++ b/package.json @@ -2,8 +2,8 @@ "name": "merge", "version": "1.2.1", "author": "yeikos", - "description": "Merge multiple objects into one, optionally creating a new cloned object. Similar to the jQuery.extend but more flexible. Works in Node.js and the browser.", - "main": "merge.js", + "description": "(recursive)? merging of (cloned)? objects.", + "main": "lib/src/index.js", "license": "MIT", "homepage": "https://github.com/yeikos/js.merge", "repository": { From b36036a5e4b415a077ec8ec52c69f69dce3146de Mon Sep 17 00:00:00 2001 From: yeikos Date: Mon, 29 Jul 2019 00:05:31 +0200 Subject: [PATCH 08/17] docs: remove license copyright --- LICENSE | 2 -- 1 file changed, 2 deletions(-) diff --git a/LICENSE b/LICENSE index 5538057..749aa1e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,7 +1,5 @@ The MIT License (MIT) -Copyright (c) 2014 yeikos - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights From 2d2b54a24988f6e4644a0c40bc6fcd9a8fc62117 Mon Sep 17 00:00:00 2001 From: yeikos Date: Mon, 29 Jul 2019 00:06:11 +0200 Subject: [PATCH 09/17] build: update ignored files --- .gitignore | 1 + .npmignore | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 .gitignore delete mode 100644 .npmignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b512c09 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/.npmignore b/.npmignore deleted file mode 100644 index 3598c30..0000000 --- a/.npmignore +++ /dev/null @@ -1 +0,0 @@ -tests \ No newline at end of file From 75ba781153ae92bd32b8d4924ca9dc3f84857cef Mon Sep 17 00:00:00 2001 From: yeikos Date: Mon, 29 Jul 2019 00:06:55 +0200 Subject: [PATCH 10/17] build: add editor config --- .editorconfig | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..2b52ff2 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,11 @@ +root = true + +[{*.ts,*.md,*.html,*.json,webpack.config.js}] +end_of_line = lf +charset = utf-8 +indent_style = tab +indent_size = 4 + +[package-lock.json] +indent_style = space +indent_size = 2 \ No newline at end of file From bf85170a5b293f269dcda68d3c8755d3a828d9ac Mon Sep 17 00:00:00 2001 From: yeikos Date: Mon, 29 Jul 2019 00:07:43 +0200 Subject: [PATCH 11/17] test: add merge script --- dist/merge.browser.test.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dist/merge.browser.test.html b/dist/merge.browser.test.html index 62807a3..def3aca 100644 --- a/dist/merge.browser.test.html +++ b/dist/merge.browser.test.html @@ -13,7 +13,8 @@ + +